Try making a template sensor that counts the time since it’s last update. There should be some info in this thread. Relative_time template extension
Once the template sensor works (test it in dev tools) you can create an automation with a template trigger. Something like if state of template sensor is greater than x run action.
Example:
- platform: time_date
display_options:
- 'time'
- 'date'
- platform: template
sensors:
derick_location_for:
value_template: "{% if states.device_tracker.derick_nexus_6p %}{{(as_timestamp(now())-as_timestamp(states.device_tracker.derick_nexus_6p.last_updated)) // 60 }} Minutes{% else %}??{% endif %}"
entity_id:
- sensor.time
#Automation
- alias: trigger after last update reaches a time
trigger:
platform: template
value_template: “{% if is_state(‘derick_location_for’, ‘2 minutes’) %}true{% endif %}”
action:
service: persistent_notification.create
data:
notification_id: “1234”
message: “Sensor is Down”
title: “Test”