I’m using hassio in an Intel Nuc (docker) and I’ve added zigbee2mqtt add-on and successfully paired a Xiaomi Aqara sensor.
The problem comes when I restart home assistant, the value of the temperature/humidity/preasure/battery is unknown until a new message from the sensor is received or I press the sensor’s button.
I added in devices.yaml the option “retain: true” but it seems that does not work
I’ve observed that if I use the mqtt service and I listen for the topic I can see that (pressing the sensor’s button or when it is updated automatically):
I think I have found a workaround for that.
Restarting zigbee2mqtt add-on when home assistant starts you can get the latest values stored on share/zigbee2mqtt/state.json. Keep in mind that this file is updated every 5 min so you may lose the latest value if the reset is produced before state.json is stored.
The automation is:
default topic of mqtt broker has changed to homeassistant/status is there anyway to change the topic for zigbee2mqtt to listen to that default topic instead off hass/status ?