-
Notifications
You must be signed in to change notification settings - Fork 768
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
Home Assistant MQTT sensors unavailable due to healthy but data is available #4327
Comments
Thanks for reporting, nice catch.
I do agree to both |
Is there an alternative to "healthy" that can be used for the MQTT sensor availability? |
What do we want "healthy" to indicate? Maybe a car that drives into and out of a mobile black spot should still be considered healthy? What if the car drives into a black spot and parks there overnight? Could be tricky. How do we distinguish a problem that should be ignored vs one that should not be ignored? |
By no means I'm a Home Assistant expert, but I do wonder if the sensor "availability" is sort of misleading here since there's no correlation between sensor values/states like "location" and "speed" with "healthy" or "not healthy". The way I'm thinking about it, the "location" or "speed" sensor only updates if there is a new value pushed from MQTT. If there is no value, the last value/state is persisted in Home Assistant with a timestamp of when it was set. So if the car is offline/unreachable, then the MQTT topic will not have any new values and the sensor will not update, then the last value is the last known value for that sensor. I believe that's also what Teslamate's own dashboard would show as well, the last known location and speed if the car suddenly became unreachable. There is a "car is unhealthy" indicator but it doesn't hide/stop all the other values from being shown. Since there is in fact a "Healthy" sensor tied to the However for certain sensors like the "Active route", here the "availability" topic is meaningful because if the car is not actively routing, then the "Active route" should not be the last set state because that's not reflective of the actual state, so the "Unavailable" state has meaning here. |
@JakobLichterfeld since I haven't heard back from anyone about this, my opinion is that the |
Agree.
Ty! |
Is there an existing issue for this?
What happened?
I've noticed that my Home Assistant MQTT sensors sometimes report "unavailable" even though data is actually available and logged in Teslamate.
For example there was no "speed" data between 6:51am and 6:56am.
But looking at Teslamate's trip, speed was logged for the whole strip including the portion before 6:56am. I suspect this data came from the "Streaming API" which I have enabled.
Looking at some of the other sensors, I then realised that the sensor state was "unavailable" at the same time
Looking at the Home Assistant MQTT sensors documentation I then realised that all of the sensors have an
availability
tied to theteslamate/cars/X/healthy
topicFrom the container logs I can verify that my vehicle became "unhealthy" around the same time due to consequtive
408
errors from the Owners API.I'm not familiar enough with the "healthy" state/topic, so I'm not sure if the problem is either
false
if streaming data is available (as it was in my scenario)healthy
topic as an availabillity source since it may be misleadingExpected Behavior
Home Assistant sensors to have data if data is available
Steps To Reproduce
No response
Relevant log output
Screenshots
No response
Additional data
No response
Type of installation
Docker
Version
v1.31.1
The text was updated successfully, but these errors were encountered: