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
MQTT lights stuck in "unavailable" after reload (new format) #74019
Comments
Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration ( mqtt documentation |
@michalk-k Thanks for the very detailed issue description with configuration for the various permutations and so on 👍 However, the reproduction steps are incomplete; after a reload the entities with availability will be in state Are your shellies configured to publish retained messages, or do you maybe have some automation which makes the shellies republish the state after a HA reload? It would be helpful if you clarify the reproduction steps and also collect a log with the settings below which shows what happens when you reload MQTT. logger:
default: info
logs:
homeassistant.core: debug
homeassistant.components.mqtt: debug |
Yes. The availability topic is retained for sure. State topic probably too (I have to back home to confirm). I have retained option enabled in all owned Shellies. I'll try to provide requested log. edit:
Indeed. I have two automations triggered by system start and event_mqtt_reloaded event. I completely forgot about them. here is a code of one of them. The second one differs by trigger only:
|
Thanks @michalk-k 👍 The automation is very likely to cause the problem, MQTT internally also uses the Your automation already has a delay in it, as a workaround I suggest you increase that to a few seconds. |
Never mind this, it won't work. |
The problem should be fixed by #74226 which will be included in Home Assistant Core 2022.7.0 |
Thank you. |
The problem
When reloading manually configured MQTT entities, MQTT light entities which:
get stuck with an unavailable state. Such a state doesn't change even by changes in tracked MQTT topic.
Worth to mention that HA restart causes all entities to recover. Granted, those with availability set, require a minute or so more after restart is confirmed by UI.
The code below configures 4 entities. All do use the same settings and MQTT topics.
Two of them are using the old format, and another two are using the new format. Each pair has one entity with and without availability option (suffixes av and nav respectively).
To reproduce:
The result: 3 of them are available, while
test_mqtt_av
is not available.This test case is deterministic and confirmed with every light entity I reconfigured in order to use the new format. Other domains like sensors or covers seem to be free of this bug. But worth checking all possible domains.
What version of Home Assistant Core has the issue?
core-2022.6.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
MQTT Light
Link to integration documentation on our website
https://www.home-assistant.io/integrations/light.mqtt/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: