Help with ring doorbell motion light loop


#1

1) Give a description of the problem
Currently when trying to use the ST light automation I can turn on the lights when motion is detected but when the lights turn off the camera thinks it is valid motion and instantly turns the lights back on throwing it into a loop.

2) What is the expected behavior?
Trying to create a piston to turn on the eve lights when the ring doorbell detects motion between sunset and sunrise for 5 minutes and then when the lights turn off it ignores the camera motion for 10 seconds before resuming motion detection.

3) What is happening/not happening?
Light loop

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(4‎/‎20‎/‎2018‎ ‎10‎:‎26‎:‎40‎ ‎PM +175ms
+2ms
â•”Received event [Front Door - Ring Doorbell].motion = inactive with a delay of 81ms
+123ms
â•‘RunTime Analysis CS > 15ms > PS > 39ms > PE > 68ms > CE
+125ms
â•‘Runtime (37925 bytes) successfully initialized in 39ms (v0.3.104.20180323) (123ms)
+126ms
â•‘â•”Execution stage started
+137ms
â•‘â•‘Comparison (enum) inactive is (string) active = false (2ms)
+139ms
║║Cancelling condition #6’s schedules…
+140ms
â•‘â•‘Condition #6 evaluated false (8ms)
+141ms
║║Cancelling condition #1’s schedules…
+142ms
â•‘â•‘Condition group #1 evaluated false (state changed) (10ms)
+145ms
â•‘â•šExecution stage complete. (18ms)
+146ms
â•šEvent processed successfully (146ms)
‎4‎/‎20‎/‎2018‎ ‎10‎:‎26‎:‎10‎ ‎PM +574ms
+1ms
â•”Received event [Front Door - Ring Doorbell].motion = active with a delay of 56ms
+108ms
â•‘RunTime Analysis CS > 12ms > PS > 30ms > PE > 66ms > CE
+110ms
â•‘Runtime (37931 bytes) successfully initialized in 30ms (v0.3.104.20180323) (109ms)
+111ms
â•‘â•”Execution stage started
+122ms
â•‘â•‘Comparison (enum) active is (string) active = true (1ms)
+124ms
║║Cancelling condition #6’s schedules…
+125ms
â•‘â•‘Condition #6 evaluated true (7ms)
+155ms
║║Comparison (datetime) 1524281170701 is_between (datetime) 1524272100000 … (datetime) 1524223800000 = true (3ms)
+157ms
â•‘â•‘Condition #7 evaluated true (31ms)
+164ms
â•‘â•‘Comparison (boolean) true is (boolean) true = true (2ms)
+166ms
║║Cancelling condition #12’s schedules…
+167ms
â•‘â•‘Condition #12 evaluated true (8ms)
+168ms
║║Cancelling condition #1’s schedules…
+169ms
â•‘â•‘Condition group #1 evaluated true (state changed) (51ms)
+171ms
║║Cancelling statement #2’s schedules…
+192ms
â•‘â•‘Executed physical command [Eve Lights].on() (17ms)
+192ms
â•‘â•‘Executed [Eve Lights].on (18ms)
+196ms
â•‘â•‘Executed virtual command [Eve Lights].wait (0ms)
+198ms
â•‘â•‘Requesting a wake up for Fri, Apr 20 2018 @ 10:31:10 PM CDT (in 300.0s)
+203ms
â•‘â•šExecution stage complete. (92ms)
+205ms
â•‘Setting up scheduled job for Fri, Apr 20 2018 @ 10:31:10 PM CDT (in 299.994s)
+214ms
â•šEvent processed successfully (215ms))


Prevent Motion Light Piston from Triggering When Voice Command is Used to Turn Lights On
#2

The light turning on/off sets off motion detection on my ring doorbell.


#3

Yes, same issue with mine. which causes it to keep turning the lights back on. I am new to webcore so I am learning as I go on trying to create a piston to turn the lights on but ignore the motion from the ring doorbell for a few seconds when the light are turned off then resume motion detection after that elapsed time.


#4

#5

I saw that post earlier and they are trying to keep the lights alive if any motion is detected and continues…But they are having the loop issue as well. I just want my light to run 5 minutes then ignore the motion while turning off then resume motion detection. Being new to this is going to take me a little time to get up to speed.


#6

You should be able to do what you want with one variable.

Define variable - IgnoreMotion (Boolean)

If Motion sensor is active
AND $utc is between…
AND IgnoreMotion is not true

Then

Switch 1
Turn on
Wait 5 minutes
Set variable IgnoreMotion = true
Turn off
Wait 10 seconds
Set variable IgnoreMotion = false


#7

I will work on implementing this…thanks for the help


#8

Ok, I made changes to the piston to add the variable and updated the snapshot of the piston. lights are still getting hung in a loop so I have something totally missing in the piston or I have something ordered incorrectly. I have also attached the logs I captured from one of the test… thanks for the help.


#9

Can you post a green snapshot of your latest piston?

Edit: Never mind, I see you updated the first post with a snapshot and logs. I’ll take a look at it after lunch.


#10

Try clicking on your WITH statement, click the gear cog at the bottom, and then change your Task Cancellation Policy to Never Cancel.

The problem is this:

When your piston hits a WAIT command, it sets a wake-up call in the future.

When the wake-up time arrives, it evaluates your IF condition to see if it’s still true

If the conditions are still true, it carries on with execution in the WITH statement. If the conditions evaluate false (yours will unless the motion sensor happens to be active that second), it cancels all pending tasks and executes any code in the ELSE statement.

By changing you WITH statement to “never cancel tasks”, you’ll get around the issue above without having to move tasks around and possibly creating yourself all new headaches.

If for some reason the task cancellation policy fix still doesn’t get us there, we can try the same change at the IF level.

One or both of them will get it working for you.


#11

I will make that change and test this again piston again…I did however sit down and come up another way to solve the looping motion/light approaching it from different angle see below.


#12

I’m new to webcore and new to coding so I am learning as I go and trying to teach myself…Thanks for all the help and suggestions. I did test the above last night and it works as it should to trigger the light upon motion and when the light turn off it stops the motion loop and the lights turning back on.


#13

Thanks, this really helped, was going nuts trying to figure it out!


#14

Glad it helped