Cancel motion/light piston w/TCP set to never?


#1

Can I add an option to this piston below so that it will be cancelled if someone turns off the light at the switch?

I ask because I believe that the TCP setting on this piston will not allow it to be cancelled from the switch.

The section I was going to add to the piston (copied from another piston that was shared here - forgotten which thread I found it on!) is below.

on events from

  • switch 4
    do
  • Cancel all pending tasks


#2

Tested it - did not work as expected.

Is there any way to keep the functionality of this piston (which is flawless) but allow turning the light off at the switch to end it?


#3

It sounds like the motion sensor is the reason you need this cancellation policy, could you instead use logic like this?

if 
    (
        motion is active
        or
        motion was active in the last 3 minutes
    )
    and
    ... remaining conditions
then

I think that would avoid the condition becoming false under normal circumstances. Then the normal cancellation policy would allow you to cancel by toggling the switch.


#8

Would you mind clarifying the specific scenario that’s giving you trouble? Is it that the light turns on automatically, then in that 3 minute period someone turns it off and back on, expecting it to stay on but after 3 minutes it turns off?


#9

Sorry, the issue is this. I go into the room and the light comes on. As I leave the room I turn the light off at the switch. However because of the non-cancellation policy the piston turns it back on.


#10

Oh, that actually sounds like an issue with the conditions rather than the cancellation policy. Turning the switch off while motion is still active triggers the piston a second time and turns the switch back on. Maybe change the first condition to motion changes to active to ensure that the piston only runs when you first walk into the room? I’m not sure if that interferes with the normal behavior that’s working for you though…


#11

Yeah, I thought about that, but I think if it’s set to “changes to” then the piston won’t work as it does now.

I’ll give it a try and see what happens.