Why do all automations reload, after editing one single automation? That means all delayed automations are reset and never trigger the action.
Because that’s how it works, reloading any integration (and yes, automations are an integration) reloads the whole integration.
It would need some developer to add the ability to only reload individual automations, which likely isn’t a small piece of work. Maybe open a feature request?
And that is why delayed automations are not recommended.
If the delay is more than a few seconds then use a date time helper instead.
That makes sense. How do I set the date/time helper to + 20 min and how to reset if not needed anymore?
Using timedelta
, and then set it to a previous time to “clear” it:
automation:
- alias: "In twenty minutes"
trigger:
- platform: state
entity_id: binary.sensor.whale
to: 'off'
action:
- service: input_datetime.set_datetime
data:
entity_id: input_datetime.petunia
timestamp: "{{ as_timestamp(now() + timedelta(minutes=20)) }}"
- alias: "The whale landed"
trigger:
- platform: state
entity_id: binary.sensor.whale_impact
to: 'on'
action:
- service: input_datetime.set_datetime
data:
entity_id: input_datetime.petunia
timestamp: 0
2 Likes