Hello,
I am trying to trigger an automation when it is more than 5 minutes past since the PC is active. The last active sensor is a date-time, how can I compare with “now” to get the delta on an automation trigger?
Thank you for your help!
Hi,
For me at least, the data is coming in via MQTT & the sensors created don’t include any time stamp. Maybe you could mess around with an MQTT trigger, or create a customer sensor based on specific topic & payload.
Automation → When → template
{{ now() >= as_datetime(states(‘sensor._lastactive’) | as_datetime + timedelta(minutes=90)).astimezone() }}
The only issue i still need to figure out is why lastactive is getting updated even though I did not type / move my mouse at all.
1 Like