Page 1 of 1

Detect motion multiple times in order to activate a light

Posted: Tue Apr 09, 2019 4:04 pm
by siegmundfreud
Hey,

I'd like to know if it's possible to have the motion sensor triggered multiple times eg 3 times within a minute in order to activate a light.
If it can't do you know any other ways to do it that don't require programming? (not into it)

Best Regards,

Ars4l4n

Re: Detect motion multiple times in order to activate a light

Posted: Tue Apr 16, 2019 9:47 am
by ReneWahl
Hello,

Without having tested it, I guess there should be a way to realize it with some rules in combination with a timer. But I am not sure, if the sensor itself can trigger "presence" e.g. 3 times within one minute. Maybe there is a hysteresis implemented in the sensor that prevents toggling of presence detection to often. Did you test already if the sensor "is fast enough"?

BR
Rene

Re: Detect motion multiple times in order to activate a light

Posted: Thu Apr 18, 2019 5:04 am
by siegmundfreud
ReneWahl wrote: Tue Apr 16, 2019 9:47 am Hello,

Without having tested it, I guess there should be a way to realize it with some rules in combination with a timer. But I am not sure, if the sensor itself can trigger "presence" e.g. 3 times within one minute. Maybe there is a hysteresis implemented in the sensor that prevents toggling of presence detection to often. Did you test already if the sensor "is fast enough"?

BR
Rene
the sensor can be triggered every couple of seconds
I have tried setting up "movement detected" as a condition 3 times but it doesn't work. The app thinks the condition being fulfilled 3 times is as good as fulfilling it once and doesn't know the difference
I tried another thing:
when movement is detected the first time, a number value in the memory sensor called "presenceState" is changed to 1
When movement is detected the second time and the presenceState value is 1 then it is changed to 2
When movement is detected the third time and the presenceState value is 2 the lights will be turned off and presenceState value is changed to 0

but that didn't work either

Re: Detect motion multiple times in order to activate a light

Posted: Fri Apr 19, 2019 3:15 pm
by WimFields
When motion is detected, the motion sensor sends a message, but this can be multiple messages per second I think. Therefore, after the detection of motion, you have to build in a pause.

To get this done, you have to add another timer "wait3" that define a pause of (for example) 3 seconds. And you need to add an extra memory sensor "pause3".
For your 60 seconds you need a timer "wait60".

Then:
  • When movement is detected the first time: "presenceState"=0 and "pause3"=0; then make "presenceState"=1, make "pause3=1, start timer "wait3", start timer "wait60".
  • Timer "wait3" makes after 3 seconds the memory sensor "pause3"=0.
  • When movement is detected the second time: "presenceState"=1 and "pause3"=0; then make "presenceState"=2, make "pause3=1, and start timer "wait3".
  • When movement is detected the third time: "presenceState"=2 and "pause3"=0; then make "presenceState"=0, and change lights off.
  • Timer "wait60" makes after 60 seconds the memory sensor "presenceState"=0.
This is a bit more rules, but I think this should work.

Re: Detect motion multiple times in order to activate a light

Posted: Tue Jun 18, 2019 12:55 am
by MarcusZ.
If this is still of interest: The sensor should send an update to the bridge only on change of presence (to preserve battery power), that is:
- no motion to motion: directly, once
- motion to no motion: in absence of motion for 10 seconds

More or less continuous motion will just reset the internal 10 second timer, but is not updated on the bridge, according to a short one minute test.

But you could modify the trigger condition with a delay of 30 seconds, so there has to be motion for 30 seconds to have the rule actions executed. For that, have the trigger added on save, and open the rule again to modify the trigger (the delay setting can be found at the bottom then).

Just curious: what is your specific use case?

Regards, Marcus