Hi, would like to have some assistance in setting this up:
Automation starts on trigger
set random delay of x minutes to variable
send actionable notification which says “steps will run in x minutes”, and which includes a “cancel” button
start delay set in the variable
if the cancel button on the notification is not pressed before the end of the delay, continue with the actions - ELSE - finish other automation steps so it is ready for the next time the trigger occurs
If the cancel button is pressed within the delay period you said it should finish “other automation steps”. What are the other steps and how do they differ from the ones executed when the cancel button is not pressed?
Hi again, thanks for responding, things have been a bit hectic around here.
Automation is used to turn off the lights in the evening, but I’d like to build in a “warning” message that allows me to prevent the lights from turning off (eg. in the case of guests, you never know, once that is allowed again)
This is my current automation:
---
# Turn off the lights in the living room around midnight, and send notification
#
alias: Turn Off Evening Lights
id: turn_off_evening_lights
trigger:
- at: '23:30:00'
platform: time
action:
- delay: '{{ (range(0, 1)|random|int) }}:{{ (range(1, 59)|random|int) }}:00'
- entity_id:
- 'group.downstairs_lights'
service: switch.turn_off
- condition: state
entity_id: group.downstairs_lights
state: 'on'
- data:
message: 'Living room lights turned off automatically'
service: notify.mainplatform