I am looking for an Automation condition that let me verify that the State has been on a certain value for X amount of time.
I am looking to do something like this:
trigger:
platform: time
at: '10:00:00'
condition:
condition: state
entity_id: device_tracker.nito
state: not_home
for:
hours: 36
This would allow me to create daily alerts if I have been out for more than a 1.5 days.
This is possible on triggers:
trigger:
- platform: state
entity_id: device_tracker.nito
to: not_home
for:
hours: 36
However, triggers would only trigger once and I want to trigger the automation daily.
The current condition state does not seem to support “for value”.
I was thinking of using something like “last_updated”, but I guess it could be the case that the state was updated more recently but did not change value? So I guess it’s not the same.
You can create a boolean that will trigger “on” when you are away for more than 36 hours. Then create an automation that will trigger at 10:00:00 but with condition that boolean to be “on”.
Then you can go on with your actions.
To be able to trigger this daily, you can use the alert component:
EDIT: Actually, now that I am thinking of it, you may not need the alert at all. I think if you have a time trigger, it will be triggered daily… Anyway, you can try this and see for yourself.