roopesh / ad-qolsys

AppDaemon app for Qolsys IQ Panel 2
MIT License
22 stars 10 forks source link

Change info message to be retained #6

Closed mzac closed 3 years ago

mzac commented 3 years ago

I notice that when I restart Home Assistant all the entities disappear and I need to re-start AppDaemon to get them back.

Could the message that sends the info, ie the config of the entities be set with a retain flag in mqtt?

roopesh commented 3 years ago

Thinking about this... I don't think the info needs to be retained. Each mqtt config and state message needs to be retained. Still thinking.

smwoodward commented 3 years ago

@roopesh what are some ways you would like the availability tested?

roopesh commented 3 years ago

This is how I tested:

  1. Shutdown AppDaemon (AD) while HA was still running. Alarm control panel (ACP) and binary sensors (BS) become Unavailable (but still exist).
  2. Restart HA while AD is running. All sensors come back online as expected with the last state of the sensors and panel.
  3. Shutdown HA and AD. ACP and BS come back as unavailable until AD is started.
smwoodward commented 3 years ago

I will confirm that it does work. Shutting down AD and the devices become unavailable, restarting HA the entities stay and show unavailable, and restarting AD they come back from unavailable.

roopesh commented 3 years ago

@smwoodward I think you had some use cases with HomeKit and customizing entities as well.

smwoodward commented 3 years ago

@roopesh correct. The entities do stay passed into HomeKit and show as "no response" if AD is shut down.