Disarm Safety Monitor on movement for x min during night

Hi all,

I am just looking into making my alarms less likely to trigger by someone intentionally opening a door or having to leave early before the alarm disarms automatically. My significant other does not want to deal with the tablet to disarm and since I thought of using the motion sensor during the night to detect indoor motion and deactivate the alarm until motion stops + x min.

Anyone an idea how to realize this?

Bonus question: I am using xiaomi contact sensors for the doors. I want to add some more and since they sometimes having trouble staying connected (lately stable) I am looking for different once. Are the sonoff any better?

You could do this with a rule, though you'd have to find one that works for you. Maybe something like:

Trigger: Bedroom Motion Sensor Active


IF (Time is between 7:00 and 8:00 AM) THEN
  Wait for events: Front Door Contact Sensor opened --> timeout 0:05:00
  IF (Front Door Contact Sensor open AND HSM Mode is Armed-Night) THEN
    Set HSM Status to Disarmed
    Delay 0:05:00
    Set HSM Status to Armed-Home

I didn't think this through 100%, but something like that should be pretty close. :slight_smile: I'd pick a motion sensor that you think should be active within a few minutes of the door opening (in my house, I'd pick the one at the top of the stairs under the assumption that I'd be up there and go downtairs shortly before leaving). I'd also restrict it to a certain timeframe when you'd normally leave (I said 7-8 AM here, but you could make this even narrower). There is some room for problems here: if you happen to have created motion on the sensor during this particular time and someone breaks down your front door, then...everything in this rule would disarm HSM. Unlikely, probably, but without some manual way to disarm like a keypad, I think you're going to have something like that no matter how you do it (but you can make it less likely to happen by picking a good motion sensor and limiting the timeframe). Perhaps others will have better ideas.

I have a few of the new Sonoff Zigbee devices, and all work well for me (though I don't have this particular sensor). They aren't officially supported; you'll need a community driver, like Xiaomi. Unlike Xiaomi, I haven't seen any reports of these being picky about your Zigbee network (Xiaomi are well known to be picky--see this thread if you haven't already). My guess is they will work well. But you can also read that thread for ways to make your network more Xiaomi-friendly if you haven't already and don't want to replace your sensors.

1 Like

Personally, I would do this with a virtual contact sensor tied into HSM and that virtual sensor controlled by the real sensor and the motion sensor.

Trigger:  Real Contact Sensor Changes

If Motion Foyer motion inactive and Real Sensor Open Then 
     Open Virtual Sensor
ELSE IF Real sensor closed THEN
    Close virtual sensor

That way you're not screwing with arming/disarming HSM. Your rule would still result in HSM going into alarm-night-delayed so you would need to have a delay defined. If you didn't, you would still get the siren for a brief second.

You can also leave all your real sensors tied into HSM for armed-away, since they can be configured separately.

I would achieve this using a global variable. Each time you get motion during the night, increment the variable. Have a separate rule that triggers the alarm when the variable reaches whatever value you want. Motion detectors have a timeout feature which means they won't retrigger for that period (say, 60 seconds in the case of the Xiaomi's). So if you didn't want the alarm to sound for, say 2 minutes of sensed motion, in effect this would be 3 triggers - the initial one at time=0 and then 2 others at 1 and 2 minutes later. Remember to reset the counter to zero when the alarm is activated.

But the motion sensor is not included in HSM because they are in the house. So, why would you add the motion sensor to the alarm? Wouldn't that make the alarm go off more often rather than less? You don't even mention the central question about disabling the alarm being triggered by the contact sensor.

Maybe I misunderstood or your post wasn't clear.
You can control HSM using RM, so you can do whatever you want with it, hence my suggestion.

Thank you for the reply! Somehow I was not aware that I can arm and disarm HSM with rule machine ... The proposed solution worked and the alarm is disarmed when someone from inside goes outside! Thanks a lot!

1 Like

Download the Hubitat app