Turn off Motion detection during the day isn't working


#1

1) Give a description of the problem
Motion detection was supposed to turn off at Sunrise (6:09 AM), but it’s still registering movement (my dogs)

2) What is the expected behaviour?
Motion detection was supposed to turn off at Sunrise (6:09 AM)

3) What is happening/not happening?
Still registering movement after sunrise

**4) Post a Green Snapshot of the piston![image|45x37]

4/23/2022, 6:20:32 AM +458ms
+120ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+120ms ║ Motion Detection is ON
4/23/2022, 6:20:27 AM +382ms
+68ms ║ Back Patio MOTION light is ON at 6:20 A.M. on Sat, 4/23/2022
+68ms ║ Motion Detection is ON
4/23/2022, 6:20:21 AM +460ms
+317ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+317ms ║ Motion Detection is ON
4/23/2022, 6:20:17 AM +407ms
+342ms ║ Back Patio MOTION light is ON at 6:20 A.M. on Sat, 4/23/2022
+342ms ║ Motion Detection is OFF
4/23/2022, 6:20:16 AM +994ms
+101ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+101ms ║ Motion Detection is ON
4/23/2022, 6:20:16 AM +449ms
+202ms ║ Back Patio MOTION light is ON at 6:20 A.M. on Sat, 4/23/2022
+203ms ║ Motion Detection is OFF
4/23/2022, 6:20:15 AM +889ms
+162ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+162ms ║ Motion Detection is ON
4/23/2022, 6:20:15 AM +108ms
+234ms ║ Back Patio MOTION light is ON at 6:20 A.M. on Sat, 4/23/2022
+234ms ║ Motion Detection is OFF
4/23/2022, 6:20:14 AM +390ms
+251ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+251ms ║ Motion Detection is ON
4/23/2022, 6:20:03 AM +191ms
+128ms ║ Back Patio MOTION light is ON at 6:20 A.M. on Sat, 4/23/2022
+128ms ║ Motion Detection is OFF
4/23/2022, 6:20:00 AM +541ms
+216ms ║ Back Patio MOTION light is OFF at 6:20 A.M. on Sat, 4/23/2022
+216ms ║ Motion Detection is ON


#2

I am not certain the switch physically changes to On ever worked in webcore for all models of switches. If it is for Hubitat, @E_Sch should be able to offer better assistance. :slight_smile:


#3

It does, but my issue is that the “Time is not between sunrise and sunset” wasn’t working.


#4

I do not see a time restriction for that IF block… only on the 1st and last one.


#5

Yes, it’s the first block that I’m having issues with. It should not have run after 6:09 (Sunrise), but it was running at 6:20.


#6

Fuller logging might help as then you could see which events are causing the piston to run and how the piston is being evaluated.

To me it looks like the successive executions at 6:20am are all caused by the switch toggling and motion is continuous. However I misread your log first time around and I may have got it wrong again.

I am a bit suspicious of the timed trigger (stays) on line 106 as the time restriction may prevent it being cancelled and so cause activity after sunrise.


#7

I think you are going to want to consider a design:

  • that uses trigger aggregation (perhaps at top of piston)

  • and the use condition comparisons below (and your restrictions).

As the warnings show, you have a lot of nested tracking triggers. If you have trigger aggregation at the top you likely can do this otherwise (except for the stays part).

Using statement restrictions on a if statement is likely to cause you problems. I would suggest not use statement restrictions on if statements…