I've got an 18 month old at home that is walking, but we have a baby gate to keep her from going downstairs to the basement. My two other kids are a fair bit older, so we are often forgetful of ensuring the baby gate is closed. Hubitat to the rescue! I added a contact sensor on the gate and put together the following rule. It works well for the most part, but sometimes, it the gate is closed at the same instant that the sonos TTS message is being played, it gets confused and keeps repeating the TTS message even though the gate is closed. Can anyone see why? Any tweaks to the rule you'd recommend?
IF (Baby Gate Sensor open(F) AND
Time between 7:00 AM EST and 7:00 PM EST(T) [FALSE]) THEN
Delay 0:00:10 (cancelable)
Repeat every 0:00:10 (stopable)
Speak on Basement Sonos, Living Room Sonos(volume: 75): 'close the gate'
END-REP
ELSE
Cancel Delayed Actions
Stop Repeating Actions
END-IF