I’m looking for a solution for a reminder automation that I’m trying to isolate into a single automation and also without having to create any external boolean.
This is the use-case:
Whenever switch.test is changed to on, a reminder shall be sent out (using the notify service) at the event and then every 30 minute until switch.test has been turned off.
The constraints are:
a) Only using one Automation, since creating a second automation (e.g. for the second reminders) will clutter the HA environment.
b) Not using any “external” boolean, once again since this will clutter the HA environment
c) The trigger shall not leave any traces in the history if the switch is turned of. I.E. only execute as long as the switch is not turned off, then just rest
I guess there are two programmatic schematic solutions for this and booth are recursive, something I guess automation does not support. Anyone that has a better idea or if it would be worth requesting recursive automations
-
Recursive calls to the automation: The automation will trigger on the state change, but then the automation will call itself with a 30 minute delay until the switch has been turned of. From the GUI I can trigger the automation manually, but is that possible from within an automation action?
-
Recursively calling an action: Something like below, but with the actions executed recurvsivly
automation:
- alias: "Turn off reminder"
trigger:
- platform: state
entity_id: switch.test
to: 'on'
action:
- service: notify.notify
data:
title: "Reminder"
message: "Please turn off the switch"
- delay:
minutes: 30
- condition: state
entity_id: switch.test
state: 'on'
- action:
- service: notify.notify
data:
title: "Reminder"
message: "Please turn off the switch"
- delay:
minutes: 30
- condition: state
entity_id: switch.test
state: 'on'
- action:
...