State of alarm is reset after update/restart of HA

Hi,

I have a setup which contains of a server running OpenMediaVault (based on Debian). Home Assistant is installed in a Docker container, and I have Watchtower running each night checking for updates. If an update of Home Assistant is found it will stop the container, download and update the new one and start it up. This results in me always having the latest version. But this also means that Home Assistant is restarted in the process.

I have now started building an alarm system with HA and using this as an alarm panel:

If I do the Arm Home and an update is installed, and Home Assistant is updated and restarted it will revert back to Disarmed when it is back on.
I have done a trial with this and I can see that alarm_control_panel.ha_alarm is changed at every restart to Disarmed.

Is there a way for Home Assistant to remember the last state of everything, before a restart is performed?

I don’t see how I can do this in a reliable way, except me having to manually update Home Assistant everytime.

Thank you!

Bump. I’m also interested in knowing how to do this!

I finally added the ‘Retain = True’ for each message published on MQTT, and now, after a HA restart, the last status that was assigned to the MQTT Alarm Control Panel is reassigned.

Cheers !

Hey can you please paste an exempel how to write retain: true with mqtt alarm.
Thx in advance

How did you get it working?

I set it to true in the config file. Is that not the correct way?

alarm_control_panel:
platform: manual_mqtt
state_topic: home/alarm
command_topic: home/alarm/set
retain: true
pending_time: 30
delay_time: 20
trigger_time: 4
disarmed:
trigger_time: 0
armed_home:
pending_time: 0
delay_time: 0

The retain option is no longer valid for a manual_mqtt alarm.