Baby Gate Automation

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

1 Like

Yes, I do. I will try adding the other cancel delayed actions entry.

1 Like

What are you triggers for the rule? The trigger is the contact "Changes" correct?

Also, have you checked the status of the contact sensor to see that it is not flipping back and forth when closed? Sometimes, if the magnet is misaligned, it will go from open to closed and then back to open as you are closing the door/gate.

Yes, trigger is 'changes'. I'll investigate the status a little closer this evening.