#when is attribute last_update used/created/set?

4 messages · Page 1 of 1 (latest)

grizzled hollow
#

just discovered that one of my custom integrations creates several sensor entities with an attribute last_update, and they all show 'null'.
that made me look for other entities with that attribute, and I would have figured all automations, sensors, binary sensrs etc to have that, but I now discover only a handful do (I mean, 21 in a setup of over 4500 entities...).

So before being able to find out why the attribute remains null in the integration, Id like to understand when this attribute is actually created and how

hoary gulch
#

last_update is a custom attribute added by the integration and probably relates to the last time it polled the collection service, rather than the last_updated that all entities have (and are displayed on the right in your screenshot) - the reason it is null is likely because either they stopped using that in some code update, or you have restarted HA since the last time it updated itself and the integration doesn't bother restoring that data across saves
If you want to access the latter you can use - states.<entity_id>.last_updated in a template

grizzled hollow
#

thanks, yes, I was aware it was not the last_updated state attribute, but didnt realize it was 'custom'. Ill relay this to the custom integration author (via this issue ) . (Afvalwijzer). The other integrations are core GDACS and DWD. Would it be odd for core integrations to carry that 'custom' attribute?