"Cancel on truth change" option for Triggered Rule Action statement

Hi Bruce(@bravenel),

I have a question. Is there a technical problem to add "Cancel on truth change" option for Triggered Rule Action statement for the rule. For regular rules this option is available, but it's missing for triggered rule. Maybe I'm mistaken, but it seems to me that it can be added, because I can easily overcome this limitation by creating the rule with "Cancel on truth change" option and then simply run(evaluate) this rule from the Action statement of the Triggered Rule. If it can be added it will eliminate one extra rule per scenario. What is your opinion?

Not so much "technical" as logical. Cancel on truth change makes no sense in the context of a Triggered Rule. Unlike a Rule, a Triggered Rule is not listening for events for its conditions. It only listens for the trigger events. It doesn't do anything when the state of one of its conditions changes, only when it is triggered, at which time it examines the state of those conditions. So, a change of state wouldn't be detected for Cancel. This just goes to the basic definition of what a Triggered Rule is: conditions tested upon a triggering event.

If you could explain your use case that would help. If you are able to use a freestanding rule to deal with cancel, how are you preventing it from doing its thing at other times, other than the trigger events of the triggered rule?

Here is my use case for bedroom lighting:

Triggered Rule 1
Trigger: Contact Open
Rule: Motion inactive
If True Then Turn the Room Light On, and make, for example, Enter Room announcement
Else make, for example, Exit Room Announcement

Triggered Rule 2
Trigger: Contact Closed
Rule: Motion Inactive
If True Then Lights Off, Delay by 1 minutes Cancel

My goal is to postpone the Lights off until door is closed, so the light turn off in 1 minute after person leaves the room.

That doesn't really describe what you want to happen.

If there is motion in this room do you want the lights to turn on, and then turn off again when there is no motion? How does the door factor into that question? If the door closes and there is no motion, you want the lights to turn off one minute later. But if the door closes, and there is still motion do nothing? If so, then what to do when the motion stops?

One issue you should be aware of is the cycle time of a motion sensor. Depending on which sensor you have, this can vary from 15 seconds to 60 seconds. So, it would be very possible to leave the room and close the door before motion has gone inactive (15 seconds is a long time). So your second rule would be false, but you actually want the lights to turn off.

Similarly, if you open the door, the first rule runs right at that instant, possibly before the motion has activated -- even 50 milliseconds is enough -- so the first rule could be false when you enter the room, and give you the Exit Room Announcement.

So it would be best if you describe your use case in english, what you want to happen when you enter or leave the room, and how opening or closing the door is relevant.

Ok, I agree, probably there are holes in my implementation, but so far I didn't observe any wrong behavior.
Basically what I want to achieve is the Room Engaged scenario similar to Room Management application, where person enters the room and lights turn on. Then regardless of whether there was motion or not(reading book) do nothing. The light should go off only when person leaves the room or physically turn the switch off. Plus I'd like to make some announcements when person arrive or leave.

Edit: Even better if this scenarion can cover 2 people in the room. For example one person enters /leaves the room when another is inside.

And this is the tough one, how were you going to determine this?

I know it's tough, but I tried to implement it in my original algorithm described above, but Bruce found potential holes in it.

I have a use for this, When I leave for work and my spouse is home I want my spouse to receive a text. I currently have this set up on a triggered rule but sometimes when we leave the house together my spouse will receive a text.

That's always likely since you can't both leave at the same instant. You should use Rule 4.0, and introduce a delay before the test for Andi being home when you leave, instead of a delay on sending the message. It's too late by then.

Trigger:  Zach leaves
Actions:
   Delay Actions 00:01:00 
   IF (Andi present) Notify ....

You are too fast! I will read up about 4.0 now.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.