I’m writing an automation for a robot vacuum which after performing mopping, waits at a location for the mop to be removed. After arriving at location, I send a notify message via Alexa and then want to perform a loop reminding to remove the mop every 20 mins if it hasn’t been done yet.
The below code partly works, however it doesn’t immediately exit the delay/loop after removing the mop, instead, it waits for the remainder of the 20min delay; I want to continue with the next part of the automation (send her back to the dock) as soon as the mop sensor changes, any ideas appreciated!?
repeat:
while:
- condition: state
entity_id: binary_sensor.sandy_mop_attached
state: 'on'
for:
hours: 0
minutes: 20
seconds: 0
sequence:
- service: notify.alexa_media_everywhere
data:
data:
type: announce
method: speak
message: Sandy is still waiting near the sink for the mop pad to be removed.
- delay:
minutes: 20
- service: vacuum.return_to_base
data: {}
target:
entity_id: vacuum.sandy
1 post - 1 participant