I’m trying to create an automation task that does the following:
- When door open is detected, do something (call script in my case)
- For next time don’t call the script again until at least 2minutes have passed.
I was setting up this automation by using the condition that the script is in the “off” state for 2minutes. Something like the code below:
automation:
- alias: 'mudroom garage open'
trigger:
platform: state
entity_id: binary_sensor.everspring_unknown_type0002_id0002_sensor_6
to: 'on'
condition:
platform: state
entity_id: script.mudroom_garage_opened
state: 'off'
for:
hours: 0
minutes: 0
seconds: 10
action:
service: script.turn_on
entity_id: script.mudroom_garage_opened
I had set 10 seconds for debug purposes. When I tried it out, it didn’t look like the 10 seconds was being followed and the script was always being run. I also noticed that the script object in the front end didn’t show me the duration that it’s on or off like the sensors do.
Should I assume script states can’t be used in the condition? If so, anybody have suggestion on how I can implement the behaviour above?
Thanks,
James