Commit Graph

422 Commits

Author SHA1 Message Date
Matthias Wirtz
dffbf3c1d0 perf: add ideal_battery_range_km as query condition (#4305)
* perf: add ideal_battery_range_km as query condition

* fix: add alias to select

* in case of min_id > 0 pass min_id to first query as well
2024-10-28 08:56:35 +01:00
Matthias Wirtz
999e947464 tuple returned here (#4293) 2024-10-22 07:43:56 +02:00
Matthias Wirtz
b582b0be8b limit positions to set elevation for to last 10 days (#4228) 2024-10-06 12:33:48 +02:00
Martin Kolací
16e90899ca Update vehicle.ex with marketing name for Model Y SR (#4042)
Signed-off-by: kolaCZek <mail@kolaczek.cz>
2024-07-06 10:35:45 +02:00
Jakob Lichterfeld
00fdadcd06 feat: add LFP Battery setting for car settings (#4007) -> master 2024-07-05 19:11:12 +02:00
Atrox
21439f1a14 publish center_display_state to mqtt (#3813) 2024-07-05 16:55:03 +02:00
mark3-dev
c90cde871d feat: Add ability to enable and disable data collection for cars (#3993)
* Add ability to enable and disable cars

* Add default value for enabled in car_settings.

* Fix unit tests.

* Fix formatting.

* Update text to be more descriptive

* Update lables.
2024-07-05 09:01:16 +02:00
Stefan Lange
272a99bf5f Update vehicle.ex with marketing name for Model Y Long Range RWD (#3989)
Add marketing name for Model Y LR RWD.
2024-07-03 15:58:44 +02:00
jlestel
c8159cfc51 Customize intervals between vehicle_data calls (#3940)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

* fix: rebound variable issuer_url

* fix: compilation warning on the issuer_url variable

* fix: format code

* fix: issuer_url assignments

* feat: customize polling intervals

* typo

* update doc

* typo

* add online interval

* add POLLING_ONLINE_INTERVAL

* format

* add minimum interval

* Add minimum on fetch parameter

* typo

* format

* respect immediate fetch, add charging interval

* add log level

* Respect log_level

* format

* use LOG_LEVEL env var to facilitate debug

* revert on log_level

* format

* typo

* format again

* revert on default error intervals

* Add a note in MD about polling settings

* not let the user set intervals via env variables shorter than our defaults

---------

Co-authored-by: Julien <julien@citio.digital>
2024-07-02 15:36:46 +02:00
Saswat Padhi
195433c319 Track open/close states for individual doors (#3962)
* feat: track open/close states for individual doors

* doc: add individual door open states
2024-06-19 10:28:19 +02:00
jlestel
b900a98d08 feat: Respect Retry-After header on 429 response code (#3943)
* Respect 429 response code instructions

* format

* up

* up

---------

Co-authored-by: Julien <julien@citio.digital>
2024-06-07 10:10:35 +02:00
jlestel
4313409323 feat: Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3903)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

* fix: rebound variable issuer_url

* fix: compilation warning on the issuer_url variable

* fix: format code

* fix: issuer_url assignments

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-27 11:03:23 +02:00
Wilfried Chauveau
0db778e06c feat: Update TeslaFi importer to accept newer export formats (#3431)
* Update TeslaFi importer to accept newer export formats

* Update documentation
2024-05-24 09:01:50 +02:00
Jakob Lichterfeld
10995a3ce5 Revert "Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)"
This reverts commit 263f207dc9.
2024-05-20 14:07:26 +02:00
jlestel
263f207dc9 Dynamic endpoints and token to use official Tesla API (self-hosted or from third party provider) (#3866)
* feat: endpoints by env

* fix: typo

* fix: useless env

* fix: format

* fix: distinct auth domain and url

* format

* fix: force issuer url if needed

* feat: new streaming based on vin

* fix refresh

* revert

* up

* feat: no need for access token / refresh token if the TOKEN env var is present

* feat: update login if token env var exists

* feat: add ENV var to allow insecure wss

* fix: remove TESLA_CN

* fix(naming): TESLA_API_URL to TESLA_API_DOMAIN

* feat: add an env var to allo invalid certs on WSS

* doc: add API domains env vars description

* fix: typo

* feat: add env var to change log level

* fix: APP_LOG_LEVEL

* feat: add TOKEN documention and wording

* fix: refacto insecure param

* feat: naming and doc

* fix: missing env var usage

---------

Co-authored-by: Julien <julien@citio.digital>
2024-05-20 13:11:13 +02:00
Brian May
c684252940 Publish extra active_route fields to mqtt output (#3789)
This refactors the existing code to make it more maintainable.

Nil values are published as "nil" string. This ensures that they will
get published, and ensures that MQTT doesn't drop the retained data.

Fixes #3748
2024-04-05 17:29:00 +11:00
Brian May
b5285d2ace Add location topic (lat and long in one json blob) (#3729)
* Add location topic

Fixes #3660.

* doc: update mqtt topics with new location topic

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2024-03-18 08:36:21 +01:00
Brian May
cdd6298f55 Replace tortoise library with tortoise311 (#3697) 2024-03-16 11:55:04 +01:00
Michael Vestergaard
46b971070a Fix agressive switch to offline when stream gets offline message (#3672)
* Changed when stream reports offline to fetch data and let result decide the real state instead of switching directly to offline.

* Adjusted test
2024-03-16 11:52:55 +01:00
Long Zheng
78fe8116ad Add navigation active route drive state data (#3657)
* Add navigation active route drive state data

* Add active_route data to MQTT

* Update MQTT documentation

* Fix streaming test drive state
2024-02-08 08:45:42 +01:00
Michael Vestergaard
1857f25d0f Handle stream getting the message "Vehicle is offline" and change the state to offline in vehicle (#3508) 2024-01-19 14:09:59 +01:00
Nir Klinger
b5fa0242a3 Fix an issue when car is could enter sleep mode while dog mode is enabled (#3538)
* Fix an issue when car is could enter sleep mode while dog mode is enabled.

* Update pot files

* revert change

* Fix tests

* Fix tests and issue when try to sleep was not showing

* Fix lint issue
2023-12-12 13:18:03 +01:00
Brian May
b643b45ca0 Add charging_state to VehicleSummary (#3471)
* Add charging_state to VehicleSummary

Fixes: #3078

* WIP
2023-11-23 09:06:51 +01:00
JakobLichterfeld
b03783be9c Revert "Add charging_state to VehicleSummary (#3087)" (#3468)
This reverts commit 6d0405dbff. as it breaks the elixir test cases
2023-11-20 18:55:17 +01:00
Brian May
6d0405dbff Add charging_state to VehicleSummary (#3087)
Fixes: #3078
2023-11-16 16:20:11 +01:00
Nir Klinger
fba87d7e88 added tire low pressure icon to teslamate web (#3424)
* added tire low pressure icon to teslamate web

* updated new fields to mqtt md

* Update default.pot and errors.pot
2023-11-13 19:07:03 -06:00
Adrian Kumpf
9df62aee54 Update repo URL 2023-11-12 19:30:36 +01:00
Adrian Kumpf
2ac9ac49bd Update srtm to 0.8.0 2023-11-12 19:12:47 +01:00
Adrian Kumpf
faa002bab4 Trim geo fence name 2023-11-12 17:51:28 +01:00
Adrian Kumpf
adf798ee49 Fix deprecation warnings 2023-06-11 01:10:35 +02:00
Adrian Kumpf
b2b0c4555d Format code 2023-06-11 00:58:26 +02:00
Adrian Kumpf
e243645abb Add Dialyzer 2023-06-10 18:44:18 +02:00
Adrian Kumpf
db59717d04 Fix deprecation warnings on Elixir v1.15 2023-06-10 18:44:18 +02:00
Adrian Kumpf
6af97bafc8 Read vehicle name from vehicle_data response 2023-06-10 17:29:51 +02:00
Adrian Kumpf
8756c66bca Fix typos 2023-02-03 21:20:10 +01:00
Adrian Kumpf
a413e8ce2c Add setting to select tire pressure units 2022-07-18 11:35:14 +02:00
Brian May
4a11ef8421 If no geofence is found map then use default value (#2564)
This is required because the default value is "" which tells the mqtt
server to delete the retained value.

This in turn means that applications that care about when the car is in
a unknown location will not get the retained value.

This is a bit different from all of the other values in
`@always_published`. For them "" is only published if the value is
unknown or an error occurred. So it makes sense to delete the retained
value.

In this case however, a value of "" generally means "the car is outside
any known geofence" which is a valid condition it itself, and it should
be retained.

There was speculation this might affect the shift_state, but
unfortunately this was not followed up with any evidence or details. #1912

There are any number of solutions that could be deployed here. The
advantage of this solution however is it is not going to break anything
unless you specifically define the TESLAMATE_DEFAULT_GEOFENCE variable.

Fixes: #1336
2022-07-15 10:59:46 +02:00
NirKli
7a9c6b9ad1 Added tire pressure (#2706)
* - Added support for tire pressure graph per drive

* - Fixed migration script

* - Added tire pressure documentation in mqtt.md

* Use add command instead of add_if_not_exists

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>

* Remove drop function command from migration script

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>

* Format code

Co-authored-by: Adrian Kumpf <8999358+adriankumpf@users.noreply.github.com>
2022-06-24 15:24:39 +02:00
Adrian Kumpf
a0e12c3808 Store marketing names
... and identify new Model S and X.

Closes #2494, #2496
2022-04-22 15:42:25 +02:00
Adrian Kumpf
b209d348f8 Restart stream process if token expired
Addresses #2450
2022-02-20 14:18:00 +01:00
Adrian Kumpf
0d6e288c70 Encrypt API tokens (#2360)
Store API tokens encrypted in the database.

During the database migration a randomly generated key will be used encrypt the tokens if no ENCRYPTION_KEY environment variable was provided.

If the application is started without the presence of an ENCRYPTION_KEY (or if the key failed to decrypt the existing tokens), the UI will display a warning with further instructions.
2022-02-18 17:03:13 +01:00
Adrian Kumpf
a8bcb906b1 Add charge_current_request(_max) MQTT topics
Implements #2412
2022-02-09 17:13:35 +01:00
cwanja
c89088f7d6 Update vehicle.ex (#2455)
Added support for the 2021.5+ Model X. Fixes #2454
2022-02-09 16:01:01 +01:00
Adrian Kumpf
25e572bb9b Don't warn in case of common faulty update status
After successfully installing an update the Tesla API often reports
"downloading" as `status` while `install_perc` is at 100%.
2022-01-22 13:03:48 +01:00
Adrian Kumpf
6c53788738 Don't suspend logging while downloading an update
Fixes #2194
2022-01-22 13:00:50 +01:00
Adrian Kumpf
8aa772872a Remove support for logins with username/password 2022-01-21 19:09:32 +01:00
Adrian Kumpf
3fb0d2f8d0 Guard against duplicate vehicle responses
Addresses #2230
2022-01-01 17:29:36 +01:00
Adrian Kumpf
2c3e8e0560 Revert "Use built-in get_in/2"
This reverts commit e53bdc1784.

Due to a bug with Elixir < 1.13 the built-in get_in/2 handles nil values
incorrectly.
2021-12-14 15:31:32 +01:00
Adrian Kumpf
fc2b188a31 Fix detection of refreshed Model S
Addresses #2193
2021-12-14 15:16:54 +01:00
Adrian Kumpf
e53bdc1784 Use built-in get_in/2 2021-12-13 19:40:43 +01:00