WebCoRE piston to Follow motion sensors

webcore

(Joe) #1

I am trying to get webcore to disarm SHM if 3 different internal motion sensors are triggered within 30 seconds of each other. The way I was attempting to design it seems like it’s more complex than it needs to be, so I’m asking the community for Ideas.

Has anyone done something similar?


(Eric) #2

What brand of motion sensor and how long do they stay active once there is not physical motion in their view?


( I hate Mondays) #3

@Mike_Maxwell has a DTH that compounds several sensors into one and I think can do that, it’s called Motion Zone or something?

As for webCoRE, doing what you want to do, that is a fairly very extremely overly complicated thing to do. In short, it can’t be done. :slight_smile:

I’d start by defining a device variable in which to place all your motion sensors (the ones you want to watch, at least)

define
   device sensors = Motion Sensor 1, Motion Sensor 2, .., Motion Sensor N
end define;

execute
   if
      any of {sensors}'s motion changes to active
      and
      {newer([sensors:motion], 30000)} is larger than or equal to 3
   then
      ...go crazy here, sound the horn, shoot the flare, etc...
   end if;
end execute;

The newer part is an expression in which you just type in:

newer([sensors:motion], 30000)

What it does is this:

/******************************************************************************/
/*** newer returns the number of devices whose attribute had the current    ***/
/*** value for less than the specified number of milliseconds                ***/
/*** Usage: newer([device:attribute] [,.., [device:attribute]], threshold)    ***/
/******************************************************************************/

The trick is, motion being a bi-stable attribute, if the device’s current state is less than 30s old, it means it’s been active at some point during the last 30 seconds (regardless of whether it’s now active or inactive). Just a trick, but it works.


(Mike Maxwell) #4

zone motion manager, have a look at the false motion reduction zone type.
it triggers a virtual motion when the selected motion sensors all fire within the selected intervals.
It currently doesn’t have a 30 activation window (it jumps from 10 seconds to 1 minute, however you can add a 30 second option simply enough.


Dynamic Disabling/Enabling of SHM
(Robin) #5

In webCoRE I would do it as follows:

On events from motion1’s, motion2’s or motion3’s motion

IF

age([motion1 : motion]) is less than or equal to 30000
AND
age([motion2 : motion]) is less than or equal to 30000
AND
age([motion3 : motion]) is less than or equal to 3000

THEN

Disarm SHM

Or just import and tweak this:

Edit: I didn’t allow for your motion sensor reset times, so deduct that from the comparisons. If sensor reverts to inactive after 10 seconds then change that comparison to 20000ms


#6

Where did you get the newer function write up? Is that in the Wiki? I’ve been looking to get a list of the available functions, their format, and how they work. Is this from a list somewhere?


#7

https://wiki.webcore.co/Functions


#8

Perfect, thanks.