Now that I understand that it is pedantically reset upon HA restarts just because HA cannot possibly know if anything has happened during the restart, I’ve completely stopped using “last changed”. I find it meaningless.
There was a request to do something like “Last Observed Changed” at least that survives a HA restart but that request was archived.
I’m curious, however – am I missing something and are people finding some utility in this? What could I use it for?
It’s a semi-ranty question but I’m asking mostly out of curiosity how this field can be leveraged.
It can also be used in an automation condition; let’s say you want to trigger an automation when a door is opened, but only if it has been closed for at least 10 minutes before it opened. You can use trigger.from_state.last_changed in that case.
Yes, this gets reset upon a restart, but it is still useful if the duration you’re interested in is short.
For me, the question is rather rhetoric.
If HA was not restarted - last-changed/updated may be used for processing in templates/automations, not to mention “look at the screen and see when it changed”.
If HA was restarted - depends:
In normal scenario & not-test-setup - HA is not supposed to be restarted very often; OK, a few times a month if you need to update it to every new version.
Some entities change more frequent than HA is restarted - so restarts mostly do not affect these entities.
For critical places - there are technics like “keep last-changed in a separate attribute”, and some other technics which I do not use myself but other people do.