I made a custom component, where I receive data from some homemade device. The value doesn’t always change, but I’m still interested in the “last_updated” attribute, because I’d like to know whether my device is still alive.
In my custom component, I update my sensors like this :
entity_id = "sensor.tzb_beekje_waterlevel"
value = "7"
hass.states.async_set(entity_id, value)
In the docs I see :
state.last_updated Time the state was written to the state machine. Note that writing the exact same state including attributes will not result in this field being updated. Example: 2017-10-28 08:13:36.715874+00:00.
This is very weird, as a value that doesn’t change on any update, but only when values are different, rather looks like the definition of last_CHANGED and not last_UPDATED.
Why would it be like that ? Is there some trickery I can do to just make it update whenever any value comes in ?