But it doesn’t work all the time, sometimes working, sometimes not, any way to debug or check if last_changed was written properly to the database by Home Assistant?
sqlite> select last_changed from states where entity_id = 'binary_sensor.0x00158d000273bb1d_contact' and state = 'on' order by last_changed desc;
2020-05-14 17:55:50.469958
2020-05-14 17:55:50.469958
2020-05-14 16:27:23.455198
2020-05-14 16:27:23.455198
2020-05-14 16:15:27.194371
2020-05-14 16:15:27.194371
2020-05-14 16:14:58.551793
2020-05-14 16:14:58.551793
sqlite>
This is one example.
I need to restart HA all the time to see last_changed updated on lovelace
I think I will need to subscribe to zigbee2mqtt directly, post the notification via firebase and update my own app, for the best update/stability