Off command not working


#1

Hi, looking for some help with this piston - mainly the lower part when Location mode is Night.

RGB bulb 2 is LIFX bulb fitted in a lamp.
White bulb 1 is Fibaro Dimmer 2 module for the main ceiling light
RGB bulb 3 is LIFX LED strip around the TV

Everything works between the set times and location modes, apart from the RGB2 light.
When location mode is ‘Night’, It comes on with motion as expected, but won’t switch off again after the 30 second wait. The light should switch off after 30 seconds.

Should this work OK, or do I need to restructure the flow of the piston?

Thanks, Chris


#2

Move your else if into its own if.
IF
Motion active
AND
Light off

THEN
IF
Mode is A
WITH
Light
DO
Blah Blah

IF
Mode is A
WITH
Light
DO
Blah Blah
Something like this maybe.

EDIT. Also note the red ‘N’ against the WITH’s.
This is TCP set to never. You definitely need this in your second WITH.


#3

Thanks for the reply.
This TCP is new to me. I’ve done a little reading, but still unsure where to change the properties to ‘never’. I’ve noticed I can change it on the IF, THEN, WITH, ELSE tabs. Which ones actually need it?

I’ve written another piston, hope this is an improvement. (Note my placement of ‘N’!)


#4

You only need TCP set against the 2 ‘WITHs’ as these are the tasks you want to continue to execute if the piston state changes to false.
Below is a response I gave to someone else which explains, hopefully :wink: , how TCP works.

BTW, if you have TCP set to NEVER, and a wait set in a task that is counting down and the piston has turned false, if the piston should become true again, the tasks reset.
So in the piston below,
image
When motion becomes active and lux is below 7, the tasks will start (piston is true) and continue when the piston becomes false because of TCP being set to never. If it was set to default the wait would stop when motion became inactive and the light would never turn off, until the motion sensor was inactive for 90 seconds or illuminance goes greater the 7.

If set to never and motion should be detected again after, say, 60 seconds, the piston would become true again and the tasks would start afresh from the top.
So in this case if motion was continually being detected for 30 minutes, the light would never turn off.
Hope this example explains it a bit more on how TCP works.


#5

Just for completeness if you are using a dimmer you do not need the ‘Turn On’ in front of the ‘Set Level’.
If you use just the set level it will turn on at that level.
If you have turn on followed by set level, it will turn on to the last level it was set to and then change to your new set level.
You probably won’t notice it but it’s just another command that it doesn’t need.


#6

Thanks again. Certainly makes sense now. I’ll make those changes, and see what happens later.


#7

https://wiki.webcore.co/Task_Cancellation_Policy