Lack of Presence

Trying to get my brain around some logic. I have a Zooz motion detector looking for human presence. If 24 hours passes without it being trigger I would like the mode set to Away. When it actually detects someone I want the mode to be set to Home.

Can someone help me code this.

You could use rule machine to do this. One way would be:

Triggers: Motion or Inactive and stays for 24 hours
Actions: If motion, set mode to Home
Else, set mode to Away

Remember, however, that motion sensors like the Zooz are susceptible to warm air currents, etc., so you may want to think about handling false motions. Maybe a second sensor?

1 Like

mmW sensors are much better for home/away applications in my personal experience. The ones I've used can actually detect occupancy accurately, at all times. This of course depends on how you have them setup and if there are interference objects such as fans, etc.

But I will say that the ones I have in place that do not have interference sources and have been carefully posiitoned and adjusted are working better than any motion or purpose built occupancy sensor I've used previously.

1 Like

The condition for Mode to be set to Away is 24 hour of no activity. If Mode is Away then any activity sets it to Home immediately.

Then add a conditional to the triggers. The rule would be:

Triggers: Motion (if mode is away) or Inactive and stays for 24 hours
Action: If motion, set mode to Home
Else, set mode to Away
End-If

Your rule would only run with Motion if mode is Away or the sensor goes inactive and stays that way for 24 hours. Motion would set the mode to Home. The Inactive trigger would set the mode to Away.

The other way of doing this is just using two separate rules with Required Expressions.

Rule 1
Required Expression: Mode is Away
Trigger: Motion
Action: Set mode to Home

Rule 2
Required Expression: Mode is Home
Trigger: Inactive and stays for 24 hours
Action: Set Mode to Away

If you want to use the “two sensors activated” idea to reduce false “someone is home” events, this might work for you:

Trigger Event:
MotionA, MotionB all motion active
Actions:
Cancel Timed Actions: This Rule
Set TheMode to 'Home'
Wait for event: MotionA, MotionB all motion inactive
Set TheMode to 'Away'
-> delayed: 24:00:00

I'm sure you thought of this, but if you are gone and someone breaks into the house, by just using motion in the home, the mode will be set to "home". I would just be aware of this for anything related to door locks, garage doors, alarm system arming etc.

This is why I rely upon actual presence of the occupants of the home. If someone throws a brick through a window, I don't want to welcome them with unlocking the doors, turning on the lights and disabling the cameras.

Again, probably stating the obvious, but just in case.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.