alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
552 stars 99 forks source link

Location data not updating in HA via MQTT (or at least that's what it seems to be) #986

Closed aatifk closed 3 weeks ago

aatifk commented 1 month ago

Is there an existing issue for this?

I have read about the Fleet API and understand I may need to use it

Version of the Tesla component

v3.22.0

Version of the Tesla car software

2024.14.9

Model

Model Y

Current Behavior

It seems that location data is not being polled via Teslamate MQTT. I moved by Teslamate installation to a new machine and Teslamate itself is running fine. I can see my broker receiving data via MQTT. The Tesla Custom Integration used to be perfectly fine before this migration, but now it seems it won't pick any data via MQTT (specifically, location). I've even completely removed the integration and reinstalled it but nothing seems to work. The integration IS receiving data via MQTT - I can see that in debug logs - but it doesn't update the Home Assistant sensors based on that. My Garage Door was automated to open and close based on the location sensors and that takes almost 60 seconds now versus the almost instant behavior that I had come to expect. I'm completely confused here.

Expected Behavior

Sensors, especially location, should update in almost real-time because it's being polled via MQTT

Debug logs

Log File attached because it's too large to paste

Anything else?

home-assistant_tesla_custom_2024-06-03T00-46-18.324Z.log

Log file attached because it's too large to paste otherwise

slovenec88 commented 1 month ago

I can observe the same issue. Reverting one version back to .21 fixed it.

DBestman commented 4 weeks ago

I see the same behavior in .22. The sensors (location, for example) update every minute or so instead of instantaneously. Version .21 doesn't show this behavior.

aatifk commented 4 weeks ago

Glad to know that I wasn’t the only one! I thought I broke something when I migrated teslamate and couldn’t figure out what I did wrong.

FWIW, I can confirm as well that downgrading to .21 fixed everything for me as well.

dandelionclock commented 4 weeks ago

I wonder if it has anything to do with 954

knobunc commented 4 weeks ago

What do people have the polling interval set to when they are using teslamate? I can't tell if it is polling twice... or if the direct poll is disabled when the data is coming from mqtt. Thanks

DBestman commented 4 weeks ago

My polling interval is set at a very high interval - 1 month: 2592000

top-gun commented 3 weeks ago

I believe there are two issues with .22:

Both issues are gone after a downgrade to .21. In .21, I can set my polling interval to high numbers like 3600s, and any change like different charging power propagates to Home Assistant within seconds.

aatifk commented 3 weeks ago

@alandtse it seems this is a legit issue if you can perhaps take a look...

MattJeanes commented 3 weeks ago

Yeah I also have a super high poll time and use MQTT to push data from TeslaMate and it appears to just get stuck on the latest version, reverting back to .21 is fine.

alandtse commented 3 weeks ago

@bdraco I believe #954 may have broken updates coming from MQTT (primarily via teslamate). If you have time to take a quick look I'd appreciate it. No worries if you don't have this setup. Thanks!

bdraco commented 3 weeks ago

I don't use the mqtt/teslamate code, but I'll take a look and see if there is anything obvious

bdraco commented 3 weeks ago

I think https://github.com/alandtse/tesla/pull/989 should solve it, but I don't have a way to test it

bdraco commented 3 weeks ago

There are also some tasks being created that could be simple callbacks

https://github.com/alandtse/tesla/pull/990

top-gun commented 3 weeks ago

Thanks a lot, with 3.22.1, getting data via MQTT works as well as with 3.21.