Hi,
I witness a weird situation - I added a custom attribute to an entity I control 100% and still it sometimes lose its value within a 1 min.
This is the setup:
The entity is MQTT device_tracker. The custom attribute (added through customize.yaml) is ‘last_update’ - datetime stamp for last MQTT message with location (having ‘secondary_info: last-changed’ is not good enough as if my tracker is in the same zone, I don’t see the last update but only how much time it was at the zone).
I send the MQTT location messages from my Android Tasker - so I control it 100% and knows exactly when messages are being send and if they were sent.
This is the entry on customize.yaml:
device_tracker.xyz_gps:
last_update: '-'
After witnessing the ‘-’ reappear after a successful update, I wrote an AppDaemon app that does 2 things:
- waits for MQTT location messages, updates the attribute and also keeps the value in memory.
- runs a timer every 1 min that takes the value from memory and set it to the attribute again.
Checking AD logs - all seem to work as expected.
Only that I still see sometimes the value as ‘-’ on the Lovelace -> Overview -> entity.
BTW, didn’t want to complex the explanation above but I added the same attribute also to the person entity with the same logic all over the way with same results…
Why isn’t it persistent? How can I fix it? Is there a better way than mine to solve what I want to do?
Thanks!