I have a bunch of various sensors, some MQTT smartthings, some from a company called wireless tags that come in via the HTTP sensor component, and a few other things. I am looking to keep a display of the last time each sensor was updated. I have tried something like what is below and keep getting errors. Obviously HA stores a date/time with each sensor read regardless of the sensor type since I can click on each and see a time graph of values. How do I get the last date/time updated so I can display it?
- platform: template
sensors:
garage_time:
value_template: ‘{{relative_time(states.sensor.Garage_Temperature.attributes.last_updated)}}’
entity_id: sensor.Garage_Temperature
2018-08-19 13:37:49 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template garage_time: UndefinedError: ‘mappingproxy object’ has no attribute ‘last_updated’