Smart Zone motion detector (Zone Motion Manager) [Deprecated -- no longer supported]

@greg @Mike_Maxwell I just implemented this (for myself, as I wanted the same behavior), and made a Pull Request to Mike’s repository on GitHub here: https://github.com/MikeMaxwell/zmm/pull/1

If you want this behavior before the PR is merged, you can grab the updated code directly on my fork here: https://github.com/smileyborg/zmm/tree/false-reduction-threshold

Note that the changes required to implement this are only to the zoneMotionChild SmartApp. You don’t need to modify the device type (simulatedMotionSensor) or the Zone Motion Manager SmartApp.

Enjoy!

1 Like

This change has been merged!, thanks!

1 Like

Hi all

I think this might help me.
We have a 3 story house and I want to activate the lights on the top floor (3rd), our master bedroom, when
the Motion Sensor at the bottom of the stairs up to the 3rd floor is active
AND
the switch installed on the bottom stair of the staircase up to the 3rd floor is closed
AND (within a timeframe)
the switch installed on the top stair of the staircase up to the 3rd floor is activated.

This sequence of events means someone is going up to the 3rd floor :wink:

Any ideas? If this clever solution isnt appropriate to this situation has anyone got any suggestions please?

1 Like

Hi Mike,

I must be doing something stupid here but the app cant seem to create any simulated motion sensors when I create a zone.

In the IDE I’m getting:

physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘simulatedMotionSensor’ in namespace ‘MikeMaxwell’ not found. @ line 69

What am I doing wrong here? Do I need to create a device called “simulatedMotionSensor” and it copies that?

Kraeg

you need to create a new device handler (under my device handelers) using the simulatedMotionSensor code.
Once you save and publish this, then the smart app will be able to create the devices.

Sorry Mike, I completely missed that in the github!

I thought it used the SmartThings stock Simulated Sensor…I shall hang my head in shame, RTFM :frowning:

Thanks for the quick response :slight_smile:

Kraeg

1 Like

@Mike_Maxwell I just downloaded the smartapp and started using for a couple of aggregation zones where I have multiple motion sensors. Using the aggregated sensor allows me to use Smart Lighting instead of CoRe and that’s awesome. Thank you!

I do have one other use case that doesn’t quite fit what you’ve done. Any interest in adding this as a fourth scenario?

What I am looking for is a way to utilize a device state (on/off or open/closed) to prevent a motion sensor from activating or from timing out when the switch or contact sensor is in the defined state. I have two specific scenarios that this would be handy for:

Scenario 1: I’ve created virtual “Motion Disable” buttons for some of my rooms. When the disable buttons are “on”, my CoRE routines don’t respond to the motion activity in the room. I obviously have a straightforward way to deal with this but if I could embed the “disable” into a virtual motion zone, it would allow me to use the virtual zone in other apps like Smart Home Monitor and Smart Lighting

Scenario 2: In the bathrooms in our house, we have some blindspots (like behind the shower curtain) so I’ve added logic to watch a contact sensor on the bathroom door. If the door is closed, the motion sensor going inactive won’t turn off the lights. Basically, the logic is set so the automation acts like there is continuous motion until the door is opened, then it reverts back to normal behavior. Being able to watch for the door contact being closed in the virtual zone would allow me to use Smart Lighting for these bathroom applications (I have 3 of them). I thought the Triggered Activation scenario was going to work for me, and although it’s somewhat similar, it’s not the same.

Here’s a visualization of what I’m thinking…

Those are good ideas, I just don’t have time to do them currently…

1 Like

@Mike_Maxwell Fair enough. I’m a rather out of practice programmer, but I’m going to take a crack at forking the code and implementing these features. If I get it working successfully, would you consider bringing it back into the master code so everyone can take advantage?

Looking at the code, it looks like all the work is in the Child app, but it’s been almost 20 years since I had to write any code that works so this will be an interesting project for me. We’ll see if my antiquated Fortran and Python skills translate to groovy. :slight_smile:

1 Like

Yes, I’ll accept pull requests on this.
You’re off to a good start. Each child represents a seperate zone.

1 Like

Here’s what I’ve managed to hack together today. For my test cases at home, it seems to be working but I’m sure this could use some pounding on by other users with different test cases and multiple sensors/override devices.

I made essentially two modifications to your existing code:

  1. Added “locks” as a Trigger Device for Triggered Activation as well as my new option…
  2. Added the “Override State” as a 4th option. Basically, if any Override Device is in a pre-defined state, the zone controller does not experience a state change with motion sensors going active or inactive. The pre-defined states for override devices are:
  • Motion Sensors–>active
  • Contact Sensors–>closed
  • Switches–>on
  • Acceleration Sensors–>active
  • Locks–>unlocked

If someone wants to reverse those states, it’s easy enough to find in the code and modify per user. In the long run, I should add these as user selectable options for each zone.

Here’s the child app code:

There were no required changes to the DH or the Parent.

And the state diagram:

I’ve tested for 3 use cases here at my house:

  1. Use a virtual “motion disable” switch to override the motion sensor and prevent automatic lights coming on.
  2. Use a closed door on the bathroom to keep the lights on even when the motion sensor falls inactive
  3. Use the front door being unlocked to override my front porch motion sensor so as not send alerts when I walk out my own door.

I will continue to test additional use cases and let you know what I discover. If you decide you want to use any of this code in the application, please feel free to do so.

3 Likes

once you’re satisfied, issue me a pull request in git and I’ll update the main code base after reviewing your changes.
Mike

2 Likes

Im still using this and its a phenomenal Smart App,
Is there a similar App for contact sensors? Looking at a group of contact sensors for e.g.
Thanks!

Sorry seems there is something for the thread in the history…studying it now…
thanks

Won’t the Trigger mode work with contact sensors?

it does, however it seems he’s looking for a contact output, IE Zone Contact Manager…
which doesn’t exist…

2 Likes

Thanks for being so prompt as usual Mike,
Essentially I am looking to see if I can group a set of contact sensors by themselves and or motion sensors together. I currently use the false motion reduction to make sure a trigger is only when 2 or 3 motion sensors detect motion (so I dont have a false alarm because of a device malfunctioning). Im trying to see if I can do the same for contact sensors (for e.g 2 contact sensors opening during a specified time period)

Thanks so much

1 Like

"An unexpected error occurred"
not sure what I’m doing wrong, here is what I’ve done.
I selected 11 motion sensors, zone type is False Motion Reduction
activation window is 3 minutes, minimum threshold is 2, only for Away mode.

I am editing this within the Zone Motion Manager
Correct me if I’m wrong, If 2 of the 11 sensors trigger within 3 minutes, then a virtual motion sensor will trip (virtual motion sensor isn’t appearing either)

Did you install the virtual motion detector device handler in the ide that’s part of this? It sounds like it’s missing from your setup.

Thanks for the quick reply,
I’ve installed the device handler and now everything is working as expected.
Thanks!!

1 Like