Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating from Polling to Fleet Telemetry for Cost Efficiency #1092

Open
flaviorighi opened this issue Feb 4, 2025 · 4 comments
Open

Migrating from Polling to Fleet Telemetry for Cost Efficiency #1092

flaviorighi opened this issue Feb 4, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@flaviorighi
Copy link

According to the Tesla developer site, continuously polling the vehicle_data endpoint is costly and inefficient.
Instead, it's recommended to transition to using the Telemetry service.

By migrating to a setup that uses Fleet-Api for sending commands and Telemetry for gathering data, we can achieve significant improvements, particularly for users managing multiple Tesla vehicles through the same Home Assistant instance.

After last year fleet migration, each HA instance is already need to be exposed to the internet, transitioning to the Telemetry service should be a straightforward process. This change would help reduce costs and improve efficiency for all users relying on this integration.

@flaviorighi flaviorighi added the enhancement New feature or request label Feb 4, 2025
@DeadDjembe
Copy link

This would be great, Tesla started charging for polling in Feb. Each user receives $10 of credit per month, but I chewed threw the credit in a just few days. Currently, this integration polls driving cars every 60 seconds and this is not configurable. This will eat up the credit quickly.

Ultimately it would be ideal to integrate Telemetry into this integration, but for the meantime it would be nice to have the option to turn off automatic polling all together (including while driving) but allow the option to manually poll. I have the Telemetry service integrated into MQTT that works very well and is updated nearly instantaneously, so I can get the data into HA. But, this integration is required to send the command. Writing a script to manually poll when something interesting happens in the Telemetry MQTT is an easy work around to keep under the free limit and limit the number of polls.

See here for more info about the new billing, there is a section about Cost Optimization that discusses integrating the Telemetry service in place of continually polling: https://developer.tesla.com/docs/fleet-api/billing-and-limits

@flaviorighi
Copy link
Author

Yeah, probably I missed the main reason because I wrote that, but @DeadDjembe explained very well the point.

After opened this issue I've took a look deeper at the code and at the Tesla's API calls graph and I figured out that the problem is all about the 60 sec polling while driving.
But they doesn't have control on that here, cause the hardcoded polling value is on the teslajsonpy side.

So since it would be a faster change to have in our HA sistems, I've ended opening another issue on teslajsonpy library.

@BogdanDIA
Copy link

It will be good to have the telemetry-api integrated. However, for now I created my own add-on in HA that send commands through bluetooth. It works great for charging from solar surplus.

@rubin110
Copy link

rubin110 commented Feb 7, 2025

Got a fun email. So I've had 3 trips since the start of the month, total of 60 miles...

Image

Image

@flaviorighi Thanks for opening up the upstream bug.

I believe #1038 is similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants