Last_updated (or last_changed) as sub_entity

Hi all
Is there a way to use the last_updated (or last_changed) state of an entity (sensor and others) as sub_entity in Hadashboard?

What is the differences between the two ? :open_mouth:

Thanks

whats the difference:

  1. last_updated is the last time an entity did send its value to HA
  2. last_changed is the last time there was a difference between the previous value and the new.

both are atrributes and they can be set as subentity for a sensor as described here:

http://appdaemon.readthedocs.io/en/latest/DASHBOARD_CREATION.html#sensor

2 Likes

Hi @ReneTode

Sorry, but I donโ€™t understand how to do it.

I have this sensor showed in the dashboard and I would like to see also when was updated.

consumo_attuale:
    widget_type: sensor
    title: Consumo attuale
    units: "kW"
    precision: 1
    entity: sensor.owl_attuale
    sub_entity: sensor.owl_attuale.last_updated
    refresh: 15 

What is the correct code to insert as sub_entity?

Can I use last_updated also for device_tracker entities?

Thanks!!

you need entity_to_sub_entity_attribute in stead of sub_entity
sensor doesnt have a refresh

devicetracker doesnt have a sub_entity, but you can use a sensor widget for the devicetracker (but it will show the state and not an icon)