Detect motion multiple times in order to activate a light

A place to discuss everything about all4hue.
Ein Ort um alles Mögliche über all4hue zu diskutieren.
Post Reply
User avatar
siegmundfreud
Posts: 2
Joined: Tue Apr 09, 2019 4:02 pm

Detect motion multiple times in order to activate a light

Post by siegmundfreud » Tue Apr 09, 2019 4:04 pm

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

User avatar
ReneWahl
Site Admin
Posts: 182
Joined: Wed Jan 16, 2019 8:44 pm

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

Post by ReneWahl » 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
all4hue Developer / Entwickler

User avatar
siegmundfreud
Posts: 2
Joined: Tue Apr 09, 2019 4:02 pm

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

Post by siegmundfreud » Thu Apr 18, 2019 5:04 am

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

WimFields
Posts: 3
Joined: Sun Jan 20, 2019 6:45 pm

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

Post by WimFields » Fri Apr 19, 2019 3:15 pm

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.

User avatar
MarcusZ.
Posts: 151
Joined: Sun Jan 20, 2019 4:44 pm

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

Post by MarcusZ. » Tue Jun 18, 2019 12:55 am

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
2x Bridge V2 (+deCONZ/HA-Bridge)
Hue Go (+BT), Lightstrip (in/out), Play, Bloom; E14+E27 Bulb; Iris, Aura.
Motion sensor (in/out), Dimmer (old/new), Smart Button, Tap Dial.

P.S.: Ich bin *kein* Entwickler von all 4 hue, aber Hue Poweruser!

Post Reply