Master motion sensor

One of our users, @thegoose_1369, came up with this idea, which I find quite ingenious. He wanted a virtual motion sensor that would be active if any of several motion sensors are active, and inactive only after there has been no motion for some time, in his case, an hour.

First step is to create a Virtual Motion Sensor device. In my example below, it's called All Motion Quiet. Then the rule is straight forward, using Delay with Cancel on truth change. The clever part is using a Custom Action to control the virtual motion sensor, setting it to active or inactive. Presumably, one would use the All Motion Quiet becoming inactive as a trigger for another rule, perhaps to change mode or turn something off.

6 Likes

Spot on, @bravenel This is used to trigger a rule which sets HSM to Armed-Home overnight once there's no motion anywhere in the house for an hour (Everyone's probably fallen asleep without setting the alarm). Here's the rule:

3 Likes

I know I'm missing the obvious, but how is this different from the motion aggregator option in the Zone Motion Controllers app?

3 Likes

It isn't..., that's exactly how the motion aggregation zone type works.

It isn't. There are always multiple ways to skin a cat with Hubitat. The idea is to show how some type of function can be done in RM, so that it can be applied in more complex scenarios, or possibly with other sensors besides motion.

1 Like

My understanding is that Zone Motion Controllers app does not allow you to set the Aggregated Zone to 'inactive'.

With HUE, you would want to tell the mZone that it is inactive if the EU presses the Off Switch in HUE.

The outcome without a more advanced rule is that upon re-entering the room within the mZone timeout, the lights do not come back on - becuase the zone believes it is already active and has no way to know that EU in HUE has turned off the HUE Dim Switch

I don't think I understand what you trying to accomplish. The mzone is a virtual motion sensor that aggregates multiple real world motion sensors. Are you saying you want to change the motion status using a switch? If you do, you would have no way of changing the motion status of the real sensors, which would create further complications depending on their timeouts. For example, what would be used to turn the lights back on if you reentered the room while the real motion sensors were still in an active state?
Essentially you would be right back to this same outcome, no?

This is the problem currently.

Because there is no feedback of status from a HUE Switch on HUE Bridge to HE Hub.

So imagine a room with a 10m timeout. You walk in at minute 0 and upon leaving you use the HUE Dim Switch to turn off the zone at minute 1.

At this point the HE mZone still has 9m left before timeout. It has no knowledge of the lights being off because HE can't see that change. (if you know how to do this please let me know.)

If the user walks back in now before the mZone times out, the lights remain off. The mZone is still active so no command is sent to turn on.

Sorry, but I'm totally confused. What does "status from a HUE switch" refer too. It's the status of the light that should be relevant, no? The switch would be turning the lights on/off and it's the status of the light that be need to be maintained in HE.

Also, the mzone is a virtual motion sensor. It's task is simply to be active or inactive based on motion. The aggregator portion simply allows multiple motion sensors to act as one. Are you attempting to control the state of a motion sensor with a switch? That is not it's designed purpose.

Thank you for asking @stephack. When the user turns off the Hue Lights using the Hue Dim Switch, the status of those lights is reported in HE.

But the mZone does not recognise that the light status has changed.

So, it carries on awaiting its 10 minute activity timeout.

No matter how much motion you present to the Sensors during this timeout the mZone is already active from the previous motion.

Ergo, it doesn't send a new command to turn on the lights again. User reports Sensor is not working but in fact the reality is the code is not triggered.

If you wait until after the 10 minute timeout, the mZone becomes inactive. At that point motion under the sensors triggers the mZone active and lights come on.

So: design is good for sensors - walk in turn on after 10 mins of inactivity turn off. Expectations fulfilled.

But if the user walks in and then turns off the lights using the switch... And walks in again before the 10m timeout, the lights will remain off.

Yup. I guess I don't understand, from you first reply, if you are asking for something to be changed in the motion aggregator app. What you are describing seems to be something outside of the scope of a motion sensor driver. You would need to use RM or another app to cater for a switch manually changing the lights. I apologise but I just don't see how this relates to mzone (motion zone) functionality.

10 minutes is a pretty long timeout.
The aggregation zone type is useful in areas where a single motion sensor can't cover the entire area, but you wish to treat it as such.
As long is there is at least one discrete motion event within the timeout window the zone will remain active.
You select a timeout value based on the expected time someone could remain inactive within the area.
Except bathrooms and showers I use 5 minutes.

There is some user training as well, people need to learn that the lights will go off on their own, they don't have to turn them off when automated.

Agree. How long do you use in Bathrooms and Showers?

30 minutes in bathrooms where there is no dedicated detector covering the tub/shower, 10 otherwise.

The longest I have is 5 minutes, most are 3 (with shower sensor). Shower is only 1 or 2 minutes because you're moving around, but a tub-shower is longer, as there is no way to tell if it's the tub or shower being used.