arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
462 stars 104 forks source link

How to handle Homebridge restart #531

Closed smhex closed 2 years ago

smhex commented 2 years ago

Hi, I am using the plugin for my garage door controller. Everything works as expected except when Homebridge is restarted. Although the new and the current door state are retained messages (flag set by my controller) the HomeKit Status is always "opening...". I can easily fix this by periodically sending the door status, however I would like to understand the behavior first. What happens after a Homebridge restart? I enabled the log but there is not output after restart.

Thank you!

Maybe my issue is somehow related to this

smhex commented 2 years ago

Problem solved - I did not set the retained flag correctly. Now the status set as soon as the plugin is initialized.

culpeppers commented 2 years ago

@smhex I am having the same issue, how do you set the retained flag? Thanks!

smhex commented 2 years ago

@katrovman I had to set in my own controller code (Arduino in my case). The respective function call has a flag for this.