Motion sensor-triggered light won't turn off


#1

1) Give a description of the problem
on/off light with motion sensor…light turns on, but not off

2) What is the expected behavior?
light should turn on with motion, then turn off after no motion for 10 seconds

3) What is happening/not happening?
light stays on

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)
‘name’:‘switch’, ‘value’:‘on’, ‘type’:‘physical’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘Landing’, ‘descriptionText’:Landing switch is on, ‘name’:‘level’, ‘value’:20, ‘unit’:’%’, ‘type’:‘physical’, ‘isStateChange’:false, ‘displayed’:false, ‘linkText’:‘Landing’, ‘descriptionText’:Landing level is 20%
e0c5cbe9-0b04-4bbe-9027-32edbc7c84b8 12:07:16 AM: debug description: zw device: 0C, command: 2603, payload: 14

I’m totally confused as to why these lights just won’t turn off. I thought this may have something to do with the custom DTH I was using for this light (GE/Jasco Z-Wave Plus Dimmer Switch). But, when I tried to change back to the Z-Wave Generic Dimmer Switch DTH, I get an “Access Denied/403 error.”

I’m flummoxed. Help!


#2

Change your second IF to IS INACTIVE or set the TCP to never.

You could also simplify your piston to this.

IF
Motion sensor is active.
WITH
Light
DO
Set level.
Wait 10 seconds.
Turn off.

Set TCP to never.

EDIT. Just for information. The reason why your light does not turn off is this. In your second IF you are using CHANGES TO INACTIVE. When this happens the second IF becomes true. After a few seconds webCoRE then needs to start looking for it to change to INACTIVE again, therefore the statement will change to false. This then stops the 10 second timer. If you set TCP to never, then the task/timer will not cancel and the light will turn off.
If you use the method I described above, then if the motion sensor becomes INACTIVE the timer start. If motion is detected before the 10 seconds mature, the piston restarts and the timer cancels. While there is motion the light will remain on.
TCP (Task Cancellation Policy) can be found by clicking on the IF and scroll down to the settings cog. Click on it and change it there.


#3

Thanks, @bobbles. I was leery of putting a trigger and a condition in the same piston. I thought you needed to stick with triggers only or conditions only. Still a lot to learn. I’ll re-read this post again…

Thanks!


#5

Use the following CODE in RESTORE A PISTON USING BACKUP CODE.
Delete the lux value statement.

q0gnm


#6

Ah, I see the minor difference. This worked! Thanks again!