Shelly Cloud integration add device_status _updated field in entity attributes

For Shelly cloud devices, like H&T, it would be very useful to get the _updated field of device_status as an attribute of the entity in HASS so as to know when was the latest triggerd date and time. Many thanks!

Every entity has last_updated and last_changed attributes.

@Bieniu the point is to know the last time the device updated the Shelly cloud.It might happen that the device is taking too long to update a change and thus, the information is old. Do you think last_changed will do it? Many thanks!

Shelly integration is (and will be) a local integration and is not related to the Shelly Cloud. If you need an information from Shelly Cloud you need to use Shelly Cloud.

@Bieniu OK, I understand. So then, is it correct to think that last_changed might be different from last_updated in the case, for example, that the date is updated from HASS and it has not been changed from the previous update? The point is that last_changed will get the most recent update of the device, regardless of the HASS updates? Many thanks!

Yes… and no :smiley: last_changed and last_updated can be different as you wrote, if you want to track the last update time you should use last_updated. But… you have to remember that last_changed and last_updated attributes will not survive HA restart, after restart both attributes will contain the restart date/time.

@Bieniu OK thanks a lot for your answer, I’m trying to understand what to use and how to use it…:slight_smile: For Shelly H&T I need to know when was the latest update for temperature and humidity… I printed the attributes last_updated and last_changed in the HASS template to see the differences and they are identical, although I expected to be different? But I don’t know how HASS triggers updates? In addition, I created what I called external sensor to get the date of the cloud update, and the cloud udates are about 10 minutes newer than HASS attributes… The point is that temperature and humidity do not change that often, right? So this is why I expected last_changed to be older than last_updated… Am I correct?

now = {{ as_local(now()) }}
---
Temp = {{ states("sensor.rebost_arreu_temperature") }}
Temp changed = {{ as_local(states.sensor.rebost_arreu_temperature.last_changed) }}
Temp updated = {{ as_local(states.sensor.rebost_arreu_temperature.last_updated) }}
---
Humid = {{ states("sensor.rebost_arreu_humidity") }}
Humid changed = {{ as_local(states.sensor.rebost_arreu_humidity.last_changed) }}
Humid updated = {{ as_local(states.sensor.rebost_arreu_humidity.last_updated) }}
---
extended = {{ as_local(as_datetime(states("sensor.rebost_arreu_extended") + "+00:00")) }}
extended changed = {{ as_local(states.sensor.rebost_arreu_extended.last_changed) }}
extended updated = {{ as_local(states.sensor.rebost_arreu_extended.last_updated) }}

RESULT:
-------
now = 2025-05-21 13:22:00.462773+02:00
---
Temp = 16.38
Temp changed = 2025-05-21 12:46:25.566022+02:00
Temp updated = 2025-05-21 12:46:25.566022+02:00
---
Humid = 71.0
Humid changed = 2025-05-21 12:46:25.566079+02:00
Humid updated = 2025-05-21 12:46:25.566079+02:00
---
extended = 2025-05-21 13:16:41+02:00
extended changed = 2025-05-21 13:16:55.203685+02:00
extended updated = 2025-05-21 13:16:55.203685+02:00