Commit Graph
652 Commits
Author SHA1 Message Date
54a4ee8b61 feat: check Postgres version on startup, require 16.7 / 17.3, update earthdistance extension (#4648)
* check postgres version on startup

* update earthdistance to 1.2

* detail postgres requirement

* align additional requirements

* 17 is available on nixpkgs now

* allow upcoming major as well but issue a warning

* style: linter findings

* ci: skip ghcr build for PRs from outside repo (#4660)

* ci: skip ghcr build for PRs from outside repo

* docs: update changelog

* ci: early exit if check paths triggers

* ci: improve ghcr check_if_pr_from_outside_repo logging

* feat:show tpms value to the low pressure tooltip in webview (#4654)

* Added the tpms value to the tooltip

* Update pot files

* mix format

* Revert "mix format"

This reverts commit bbfe5aaa9f.

* style: linter findings

* Update pot files

* docs: update changelog

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>

* docs: update changelog

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
Co-authored-by: Nir Klinger <45952578+NirKli@users.noreply.github.com>
2025-04-15 10:53:38 +02:00
Nir KlingerandJakob Lichterfeld 2837ebf7e3 feat:show tpms value to the low pressure tooltip in webview (#4654)
* Added the tpms value to the tooltip

* Update pot files

* mix format

* Revert "mix format"

This reverts commit bbfe5aaa9f.

* style: linter findings

* Update pot files

* docs: update changelog

---------

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2025-04-15 10:29:32 +02:00
Jakob Lichterfeld 3762bbec5a feat: add conditions to enter Charging
Only goes to Charging when the car is plugged in (power < 0) and its not preconditioning or in dog mode.

changes from @micves from #3262
2025-01-07 08:06:22 +11:00
Jakob Lichterfeld 229ab1ecbe feat: cancel an ongoing suspended state/trying to sleep and go back to online
When power > 0.

power > 0 is when e.g. the climate is on which could be scheduled preconditioning or starting preheat from the app.

changes from @micves from #3262
2025-01-07 08:06:22 +11:00
Jakob Lichterfeld 1aa2d09984 feat: don't try to sleep if power > 0
power > 0 is when e.g. the climate is on which could be scheduled
preconditioning or starting preheat from the app.

This code will make sure it doesn't enter 'trying to sleep' (the internal state
suspended) when power > 0.

changes from @micves from #3262
2025-01-07 08:06:22 +11:00
Brian MayandJakob Lichterfeld e68893befc feat: improve logging messages (#4467)
changes from @micves from #3262

Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2025-01-03 08:32:51 +01:00
Chris Wanja 4cf8acc521 feat: Update marketing name to recognize Model S LR+ (#4370)
Update marketing name to recognize Model S LR+
2024-11-12 16:56:12 +01:00
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
JakobLichterfeld 2a922e321c feat: update to Phoenix HTML 4.1, bump dependencies (#4277)
* feat: update to Phenix HTML 4.1

* fix: updating to the new Gettext.Backend approach

* chore: update pot files ro locale version 45.0.0

* fix: downgrade cloack back to 1.1.2

* revert: merge of mix.lock

* fix: new syntax for field name generation for phx-feedback-for

* Revert "fix: new syntax for field name generation for phx-feedback-for"

This reverts commit 4d95e4f1c9.

* fix: downgrade floki back to 0.35.2

* Revert "fix: downgrade floki back to 0.35.2"

This reverts commit a4f0b6bf4b.

* fix: ensure floki nil is handled

* style: linter findings

* Revert "fix: ensure floki nil is handled"

* fix: new syntax for field name generation for phx-feedback-for

* debug: floki paramter error

* Revert "debug: floki paramter error"

This reverts commit 61920267ed.

* fix: Remove unnecessary code in settings_test.exs which breaks floki 0.36+
2024-10-27 08:17:49 +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
jlestelandJulien c8fed077bb Fix 401 on direct Fleet API calls (#4095)
* 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

* Fix 401 on direct Fleet API

* try to fix in prod context

* log test

* up

* up

* format

* revert on log

* Update refresh.ex

---------

Co-authored-by: Julien <julien@citio.digital>
2024-07-27 14:06:57 +02:00
JakobLichterfeld 1ee48c9547 feat: update breadcrumb links to use Phoenix path helpers (#4052)
* feat: update breadcrumb links to use Phoenix path helpers

fixes: #3905

* doc: update changelog
2024-07-07 11:19:34 +02:00
JakobLichterfeld 1e1ebffd3b style: fix single quoted string in car_live (#4049)
* style: fix single quoted string in car_live

* doc: update changelog
2024-07-06 16:22:08 +02:00
Martin KolacíandJakob Lichterfeld 8192f12860 Add icon to summary when Sentry Mode is triggered and recording (#4043)
* Add icon to summary when Sentry Mode is triggered and recording

Signed-off-by: kolaCZek <mail@kolaczek.cz>

* Update pot files

* Update Chinese translation for "Sentry Mode recording"

---------

Signed-off-by: kolaCZek <mail@kolaczek.cz>
Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
2024-07-06 15:44:31 +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
jlestelandJulien 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
jlestelandJulien 2c4639e32d feat: allow Fleet API users to change client_id (#3984)
Co-authored-by: Julien <julien@citio.digital>
2024-06-26 10:58:31 +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
jlestelandJulien 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
jlestelandJulien 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
jlestelandJulien 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
dyxyl 7a5625f09f fix: errors from Timex.Timezone.local() during switchover to DST. (#3848)
* Fix errors from Timex.Timezone.local() during switchover to DST.

* Update the gettext files to match.
2024-04-17 14:49:41 +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
b1c1l1 97cfb79493 feat: Add URL_PATH environment variable for reverse proxy deployments (#3771)
* Add URL_PATH environment variable for reverse proxy deployments

For example, this can be used to run TeslaMate behind a reverse proxy, using a
URL path such as "/teslamate".

* gettext: update pot and po files

Generated using:
  mix gettext.extract --merge

* web: run mix format

* gettext: update pot and po files

Re-generating gettext files after running mix format.

Generated using:
  mix gettext.extract --merge
2024-03-25 09:21:34 +01:00
Brian May 2b5cdbdffd Add nix flake (#3485)
This will add support for nix flakes. Which really helps with my
development on nixos. This has two basic parts:

1. DEVELOPMENT

After this you can use the following commands on computer with nix and a
patched version of direnv:

direnv allow
devenv up

And it will automatically start and instance of postgresql and mosquitto
for development.

And the environment variables are already configured for teslamate.

So then can start teslamate with:

npm install --prefix ./assets && npm run deploy --prefix ./assets
iex -S mix phx.server

This part is all working as designed. And pretty simple and straight
forward.

2. NIX PACKAGE OF TESLA

This is 99% complete, but some pain points I haven't addressed yet.
Because I don't yet know of good solutions.

* There are two checksums in flake.nix that needs to be updated whenever
  mix.lock or package-lock.json changes.
2024-03-19 09:37:17 +01:00
Brian MayandJakob Lichterfeld 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
marvelmandJakobLichterfeld da819054f6 feat: Upgrade web development framework to Phoenix 1.7 (#3615)
* Upgrade to phoenix 1.7.0
The minimal changes necessary to compile the application

* Import Phoenix.Component instead of LiveView

* Fix compilation warnings

* mix format

* Update tests to trim newline characters

* mix gettext.extract --merge

* style: correct linting

* rebuild gettext

* fix: correct spacing before unit for energy added

* fix: use unicode character for whitespace

* fix: spacing with witespace

* fix: use numeric value for charge_energy_added in charging test

* fix: avoid warning about unsued function, which is actually used in plug

* fix: use whitespace in test before charge_energy_added

---------

Co-authored-by: JakobLichterfeld <jakob-lichterfeld@gmx.de>
2024-02-07 19:23:53 +01:00
JakobLichterfeld a09a7fa30c fix: use product api endpoint to fetch vehicles (#3630)
* fix: use product api endpoint to fetch vehicles

* feat: add handle_response function in Vehicle module to filter for only vehicles in products api endpoint

* style: correct linting
2024-02-02 09:09:35 +01:00
Nir Klinger 00a704b394 Added expected finish charging localtime to teslamate site (#3646)
* Added expected finish charging localtime to teslamate site

* format text

* fixing indentation

* fixing indentation

* format text

* Remove UTC timezone and use the local timezone
2024-02-02 09:08:46 +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
libotony c520af5732 ui: sync meta theme-color with header background color (#2840) 2023-11-16 08:49:22 +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 b545eaf8f4 Remove donation links 2023-11-12 19:26:52 +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