Hello,
I am trying to trigger a notification when my window has been left open every X minutes until it is closed. Unfortunately both WHILE and UNTIL repeat statements give me an "extra" message even after it has been closed (as it appears to be documented so this is probably correct behavior). But how can I improve my automations.yaml entry to mitigate this?
The extra notification erodes user trust in the message. The user cannot know if the window has been closed yet (the message is an extra) or should ignore it (leading to bad user habits). Someone has asked this exact question before but didn't really receive an answer that I know how to make use of.
Thanks in advance.
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.bathroom_window_opening
to: 'on'
for: 00:05:00
condition:
- condition: numeric_state
entity_id:
- weather.home
attribute: temperature
below: 5
action:
- service: notify.all_devices
data:
message: Close the Bathroom Window (t > 5m, T <= 4°C)
- repeat:
until:
- condition: state
entity_id: binary_sensor.bathroom_window_opening
state: 'off'
sequence:
- delay: '00:05:00'
- service: notify.all_devices
data:
message: The window is still open! Close the Bathroom Window! (t > 5m, T <= 4°C)
mode: single
id: redacted ```