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

home assistant problem #80

Closed
gatd4 opened this issue Jan 17, 2023 · 16 comments
Closed

home assistant problem #80

gatd4 opened this issue Jan 17, 2023 · 16 comments

Comments

@gatd4
Copy link

gatd4 commented Jan 17, 2023

if I restart the home assistant computer home assistant does not see the nuki esp unless I restart the esp bridge?
I dont have to restart my other mqttt stuff.

@KitHubek
Copy link

the same here. This problem is from i remeber I had version 6.6 and problem was too.

@technyon
Copy link
Owner

Can you please recheck with version 7.0. My guess is that the discovery topics missed the retained flag, which should be fixed in 7.0.

@KitHubek
Copy link

have 7.0 will write here after some days if problem exist still

@gatd4
Copy link
Author

gatd4 commented Jan 22, 2023

still the same with v7
restart HA and nuki lock is unavailable

@technyon
Copy link
Owner

I'm not really sure what would cause this. As a workaround you could automatically restart the ESP whenever home assistants starts up. There's an MQTT node to trigger the restart (maintenance/reset)

@mundschenk-at
Copy link
Collaborator

What broker are you using? I haven't seen this with Mosquitto.

@gatd4
Copy link
Author

gatd4 commented Jan 22, 2023

I am using mosquitto
it only happens when I restart the computer not home assistant
it does not happen with any other mqtt entities
maybe you could add a reboot option into the web interface as well?

@mundschenk-at
Copy link
Collaborator

mundschenk-at commented Jan 28, 2023

Ah yes, I can confirm the issue when the host is restarted, even with EMQX. I'm assuming it is because the MQTT broker runs on the same machine (at least in my case). The discovery messages appear to have the retained flag (but perhaps not all?).

Note to @technyon: That was with the 7.3-esp-mqtt-3 firmware.

@bcutter
Copy link
Contributor

bcutter commented Feb 7, 2023

Any option to fix that on the Nuki Hub side? Some kind of automatic restart?
Initiating this from the HA side (e. g. on HA OS restarts - which is hard to detect as only an event for HA restarts (Core) exists - and that would be overkill) is a bit hacky and everyone has to implement this on his own...

@technyon
Copy link
Owner

technyon commented Feb 8, 2023

I'm neither sure exactly why this doesn't nor how I should detect if HA has restarted. If someone can enlighten me, I can do something about it. Do the autodiscovery topics need to be republished after HA has started? This should be handled by the retained already. And if so, how can a restart be detected?

@mundschenk-at
Copy link
Collaborator

The problem occurs when the broker is restarted. It's possible this is an issue with persistence (broker configuration), but my other MQTT client with HA auto-discovery does not have this problem, so it must do something differently. I'll try to look into the differences between the two.

@technyon
Copy link
Owner

technyon commented Feb 8, 2023

What do you think about publishing the autodiscovery topics again after reconnect?

@mundschenk-at
Copy link
Collaborator

mundschenk-at commented Feb 8, 2023

Mhm, I experimented a bit, but actually the discovery topics seem to be fine. The ESP however entered into an automatic reboot loop after a broker restart, connecting and disconnecting from the broker again and again, toggling availability in HA. There might be a bug in the MQTT reconnect handling?

Edit: Unplugging/replugging the ESP from its power source fixed the loop.

@technyon
Copy link
Owner

technyon commented Feb 8, 2023

Hmmm, no problem for me to shut down the and restart the broker, the ESP reconnects just fine.

@gatd4 @bcutter @KitHubek Can you get logs while shutting down and restarting the broker?

@bcutter
Copy link
Contributor

bcutter commented Feb 11, 2023

Currently I can't unfortunately.

@enkama
Copy link

enkama commented Jan 19, 2024

Hey. Sorry for opening an old issue. But I still get this Issue to date. Pretty much it works when I start the nuki hub after I start Homeassistant. When I restart Homeassistant it shows as unavailable until I restart the Nuki hub. Then it works again.

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

No branches or pull requests

6 participants