core: HA is not subscribing to newly discovered MQTT topics
The problem
I’m using zwave-js-ui and recently updated my configuration so that I’m now exposing specific device configuration variables over MQTT by default, and this is reflected in the devices discovery payload as well.
I have tried to restart my zwave-js-ui instance and reloaded the MQTT integration in Home Assistant, but I was not able to make HA to subscribe to the new topics.
I was only able to get the newly exposed device config parameters to appear in HA by removing my whole MQTT integration and re-adding it. After this, HA correctly subscirbed to all neccessary topics.
How could I make HA to subscribe to new topics without needing to remove the MQTT integration then re-add it?
What version of Home Assistant Core has the issue?
2024.8.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
mqtt
Link to integration documentation on our website
https://www.home-assistant.io/integrations/mqtt/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (9 by maintainers)
The only changed option is that
enabled_by_defaultis set toTrue(new payload).When an entity is discovered with
enabled_by_defaultset toFalse, the entity will be created in the entity registry. As the entity is disabled, it will not listen to discovery updates as it is disabled. Even when HA is restarted, it will still be disabled, as it is already in the entity registry in a disabled state. Settingenabled_by_defaulttoTrueonly effects new entities.The user should enable the entity, and after that it will update the discovery as well. This is all by design, and not a bug.
It is possible to remove an entity by publishing an empty payload to the the discovery topic. This will completely remove the entity from the entity registry. After that a new discovery payload with
enabled_by_defaultset toTruewill set up an enabled entity. But for users that already enabled the entity this might break their customization, automation’s and scripts.old:
new: