Hello, excuse me for my english. I need help for a problem with the alarm control panel Manual mqtt it don’t retain the state after reset Home Assistant or reboot Raspberry.
This is my System
arch: armv7l
os_name: Linux
python_version: 3.7.3
version: 0.97.2
virtualenv: true
mosquitto version 1.6.4
Did you get an answer to this please? Mine was retaining, but all of a sudden it has stopped. The Alarm goes to Disarmed after a reboot… which isn’t great
It looks to be as though the alarm state initializes to the command_topic state on boot.
Problem is the local mqtt manual alarm control panel doesn’t update this topic…
My workaround is
automatons to update the command topic with mqtt.publish when the alarm control panel state changes. (This is messy and may cause issues with pending states in certain conditions?)
use mqtt.publish with retain:true, rather than the alarm control panel services to change states where ever possible.
I 've done the same thing using node red. The Manual MQTT Alarm saves the last state correctly if it is armed_home/away using an mqtt.publish with retain:true. The wierd thing is that i listened to the state topic of the alarm while i was arming it through HA and saw that the message is set as retain:true but if i restart HA it turns to disarmed again. Only if i publish an mqtt message with retain:true using Alarm Panel (android mqtt alarm app) the state of the Alarm remains in armed_home/away even after restart.
So i did the same thing as you did. Created two trigger nodes (armed_home , disarmed) on node red that they re-publish the state of the alarm to the topic using mqtt-out node with retain-true.
Till now it works fine!