Lights not turning off after motion ends


#1

1) Give a description of the problem
The Lights wont turn off with no motion from time to time.

2) What is the expected behaviour?
Lights should turn off with no motion after 3 minutes

3) What is happening/not happening?
1/2 the time, the lights stay on and dont turn off. The devices section for the lights in Smartthings app shows the off command but the lights dont turn off.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full

12/26/2019, 11:14:50 PM +544ms
+1846ms ║Piston waited at a semaphore for 1754ms

I have removed and re added the lights 2 times trying to correct the issue.


#2

Not sure about the lights not turning off. Posting logs will probably help us here. I would also consider changing your second IF (Time is between 11 pm and 5 am) to Time IS NOT between 5 am and 11 pm. If not, what would happen if this piston fires at exactly 11 pm or exactly at 5 am? Both of your Time conditions could be true.

Notice the negative approach towards the time since your original code spanned midnight.


#3

@WCmore, yes I plagiarized you :smile:


#4

I would just make it an ELSE


#5

LOL
I know he loves this one:))) and I’m still trying to figure out how this works LOL


#6

Was this working previously, but then suddenly stopped? Does it work sometimes?

Do you see the motion events in the smartthings graph events? (Device tab -> Your Motion Sensor, List Events)

I’d expect it to look something like this: