LAB02-Research / HASS.Agent

Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.
https://hassagent.lab02-research.org
MIT License
1.6k stars 74 forks source link

Bug: MQTT not reconnecting if HASS is not available on startup #325

Open goooroooX opened 1 year ago

goooroooX commented 1 year ago

Hi,

I have just figured out that HASS.Agent does not tying to reconnect MQTT when workstation was waked from hibernation, but Home Assistant API wasn't available at that moment.

The expected behavior would be to re-try connection after some time. But right now, if connection goes to error state, it would not restore again.

Can you please take a look? This re-connection functionality shouldn't be too complex for implementation. Thanks!

logs.zip

image

amadeo-alex commented 1 year ago

Hello,

Please use the "Bug" template to update the issue and include the logs from after the computer has been woken up from hibernation (if possible enable the extended logging option in the settings) - this will speed up the investigation a lot.

Edit: you've wrote "but Home Assistant API wasn't available at that moment", MQTT connection does not require any HA API to be available, unless you're using the Home Assistant Supervised/OS and using the MQTT Addon?

goooroooX commented 1 year ago

I have uploaded the log files to initial message, hope this one can help (it's not yet with enabled extended option, I will upload one when this will happen again).

>> MQTT connection does not require any HA API to be available, unless you're using the Home Assistant Supervised/OS and using the MQTT Addon? Yep, I'm using HASS VM with MQTT addon. HASS VM was offline in its entirety when my workstation have woken up from hibernation.