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

Some MQTT devices unavailable after HA restart #135266

Open
richardstone opened this issue Jan 10, 2025 · 2 comments
Open

Some MQTT devices unavailable after HA restart #135266

richardstone opened this issue Jan 10, 2025 · 2 comments

Comments

@richardstone
Copy link

The problem

After a Home Assistant restart, most of the MQTT devices connected through Z-Wave JS UI became available, but a couple of the very same type of device - Aeotec Home Energy Meter - Gen5, are still displayed as unavailable.

Within the Z-Wave JS UI MQTT settings I have retain enabled, and I have turned on retained discovery as well.
I have the discovery prefix set to a different topic than the MQTT prefix.

Connecting to the MQTT broker with MQTT explorer, I can see all the retained discovery messages under the discovery prefix, and I can see new messages arriving on the usual MQTT prefix, containing latest data from the Aeotec Home Energy Meters. With this, I can't see any issues with either Z-Wave JS UI or the MQTT broker I'm using.

In Home Assistant, after a restart, I see these devices discovered but as "Unavailable". At this point I can resolve the issue via various ways:

  1. Restart the Z-Wave JS UI instance.
  2. Delete the device from Home Assistant, then rediscovery the device manually in Z-Wave JS UI.
  3. In Home Assistant MQTT settings, initiate a listen on the device topic, then the device becames available instantly

All three options are very inconvenient to do after every Home Assistant restart.

I have 115 MQTT devices under a single Home Assistant instance, resulting in 5374 entities in total.
image

Interesting thing is that after every HA restart, almost always the very same 8-10 Aeotec Home Energy Meters are the only devices that are unavailable amongst other devices like switches, climates, shutter controllers.

Could you please help me to further debug/resolve this issue?

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

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @emontnemery, @jbouwh, @bdraco, mind taking a look at this issue as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of mqtt can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign mqtt Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


mqtt documentation
mqtt source
(message by IssueLinks)

@richardstone
Copy link
Author

richardstone commented Jan 10, 2025

After checking MQTT debug logs, while I can see messages, like:
INFO (MainThread) [homeassistant.components.mqtt.discovery] Found new component: binary_sensor ...
for most of the devices, I don't see this for any Aeotec Home Energy Meters ..
I have doublechecked that the discovery messages for the HEMs are indeed present in the MQTT broker.

Reading the logs I see that other components, like "number", and "switch" of the very same device are discovered, only "sensor" is missing..

Manually initiating a listen on the "#" topic in Home Assistant within the MQTT configuration settings resolves the issue for all of the Unavailable devices immediately. So this is yet another option to mitigate the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants