I’m trying to set up a system to notify me to get my laundry out of the washer. I’d like this to send me another notification every 5 minutes until I use the actionable notification to mark it complete, I’ve gotten this part to work in a separate automation. But I’d ALSO like to have an option to delay the next notification for a set amount of time, 30 minutes in this example.
I think I have the general set up correct, I have a helper number set to the amount of time to delay the notifications, so when I set to delay 30 minutes the helper gets changed to 30. I think I’m running into issues with me choose / wait for trigger section. Anyone have any thoughts?
alias: Notification_Laundry TEST
description: ""
trigger:
- platform: state
entity_id:
- timer.washing_machine
from: active
to: idle
condition: []
action:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.washing_machine
- service: input_number.set_value
metadata: {}
data:
value: 5
target:
entity_id: input_number.washing_machine_notification
- parallel:
- repeat:
sequence:
- service: notify.mobile_app_nicks_iphone
metadata: {}
data:
message: Laundry is done!
data:
actions:
- action: WASHER_EMPTIED
title: Done
- action: DELAY_30
title: Delay 30 Minutes
- delay:
hours: 0
minutes: >-
{{ states('input_number.washing_machine_notification') | int
}}
seconds: 0
milliseconds: 0
until:
- condition: state
entity_id: input_boolean.washing_machine
state: "off"
- if:
- condition: state
entity_id: input_boolean.washing_machine
state: "on"
then:
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: WASHER_EMPTIED
- platform: event
event_type: mobile_app_notification_action
event_data:
action: DELAY_30
timeout:
hours: 6
minutes: 0
seconds: 0
milliseconds: 0
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == WASHER_EMPTIED }}"
sequence:
- service: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.washing_machine
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == DELAY_30 }}"
sequence:
- service: input_number.set_value
metadata: {}
data:
value: 30
target:
entity_id: input_number.washing_machine_notification
mode: single