WebCoRE piston to Follow motion sensors

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?

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

@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.

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.

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?

https://wiki.webcore.co/Functions

2 Likes

Perfect, thanks.