I have a Lovelace card with about 12 temperature sensors that get their data via mqtt. For each sensor I get temperature, humidity, and battery level. On the temperature, I have edited the entity and set it to show Last updated (under secondary information). What I am finding is that most of the sensors are showing how long since the sensor was last updated (2 mins or less) but on a few it says the last update is hours ago. However if I look at the mqtt data for that sensor (using MQTT Explorer) it shows the sensor sent data minutes ago. Also if I click on that sensor in the dashboard it shows the temperature has been unchanged (updated but constant) for the period shown. Is this the way it is supposed to work? The secondary information has the option of Last changed rather than Last updated but I assumed that was to show when the value changed which is possibly what I am seeing. I want to know the time since a sensor value was received even if it is unchanged so that I know if the sensor is working. Is this a bug or have I made an error in the configuration?
If the value did not change, last_updated will not change.
What about “Last Changed”?
It is the same
So what’s the difference between them?
and more important, if neither of these settings show the last time a value was received, is there a way to show that?
No. It has been asked for though. It would require a new property of the state object.
Last changed and last updated are defined here:
In short, last_updated updates when the state and/or attributes change, last_changed only updates when the state changes.