Hi, so I just imported some devices from VERA. In some cases, like my motion detectors I want to show the last trip time on the UI without having to click around. I’d prefer to show it in “time since” (e.g. 5 minutes ago), but would take even showing the raw datetime.
I found this link
but I’m not convinced this is the simplest way. Any tips are appreciated.
I have a similar situation with my Nest thermostat. I want to show “Away-Mode” from my lake house nest thermostat on the main GUI page. I do it by creating a template sensor, based on the nest thermostat data like this:
If instead you to show the elapsed time (in seconds) you would do it like this:
sensor:
- platform: template
sensors:
detector1_tripped:
value_template: {{as_timestamp(now()) - as_timestamp(states.sensors.detector1.attributes.last_tripped)}}
Finally, if your sensor doesn’t export a last_tripped attribute, you can always use the last update state like this: