When Company Come Over

When Company Come Over on the July 4th I want to turn all rules off that have something to do with my Master bath Overhead light.

Bottom line when "Company" virtual switch is ON.

I put the information into Chat GPT and wanted to know if you agree. A LOT of information here so if you can not get back I understand.

Actions for Company Mode – Pause Motion Rules + clear :scissors:
IF (Company Coming Over(on) is on(T) [TRUE]) THEN
:scissors:
Pause Rules: Master Bath Overhead - Timer by motion, Turn Master Overhead Light on at Night Time, Weekend - Afternoon Master Bath Motion activates,, WEEKEND - Master Light turns OFF, turn off Master Bath Light and Master Overhead Light - RULE 1767, WEEKEND - Master Light Turns ON Master Bath and Master Overhead Light
:scissors:
ELSE
:scissors:
Resume Rules: Master Bath Overhead - Timer by motion, Turn Master Overhead Light on at Night Time, Weekend - Afternoon Master Bath Motion activates,, WEEKEND - Master Light turns OFF, turn off Master Bath Light and Master Overhead Light - RULE 1767, WEEKEND - Master Light Turns ON Master Bath and Master Overhead Light
:scissors:
END-IF

some said it was better to copy and past so you have it both ways. GOOD LUCK :grinning_face:

Another option would be to make Company Coming Over switch being off as a required expression in each rule.

A bit more work, but if you ever add additional rules you want to disable you don’t have to remember to come back to this rule to add it.

That's what I've tended to do for these types of situations, for the same reasoning. There's an argument for both approaches, of course, subjective decision. :slight_smile:

For example, my Vacation rules that have required expression for a "Vacation" virtual switch to be turned on:

Vacation switch can be turned on manually, but will also turn on automatically if both my wife and I are away from home overnight.

That would be my recommendation as well.

Thanks - if do it to one would you mind looking at it? Have not done it in a while.

Okay if one of you can please take one last look at this before July 4th. I know I should of not waited until the last minute.

UPDATE COMPANY COMING OVER

I thought you goal was to disable the rule if the company coming over was on?

The required expression you have will run if any of the required expressions are true. You have them ORed together.

I messed up than. You are right when Company is ON its to disable all the other rules

I thought the way I had the expression is when Company was ON –> rule was paused.

Is that not the way I have it??

Well that is what your original rule with the pause rules showed.

With a required expression the rule will only trigger if the required expression is true.

The required expression in your latest screenshot has the private Boolean True OR company coming over is on. So, if either of those things are true the rule will trigger.

It should be, if I understand what you mean want, private Boolean True AND company coming over is off.

This is the way !!!

I was in a hurry and did not share a very important rule with guys. Rule 1768

So if I am looking at this right this rule should determine what is paused.

If my bathroom motion - Rule #2016 “Master Bath Presence Sensor R2”

Weekend - Afternoon Master Bath R2 Presence Sensor - Rule 1776

1776 does not have “Cancel pending actions when Required Expression become false”

What rule is written correct? 1776 or 2016

Goal: when Company Mode – Pause Motion Rules 1768 is ON it pauses:

Actions for Company Mode – Pause Motion Rules + clear :scissors:
IF (Company Coming Over(on) is on(T) [TRUE]) THEN
:scissors:
Pause Rules: Master Bath Overhead - Timer by motion, Master Bath Presence Sensor R2 - for Master Bath Lights, Turn Master Overhead Light on at Night Time, Weekend - Afternoon Master Bath R2 Presence Sensor, WEEKEND - Master Light turns OFF, turn off Master Bath Light and Master Overhead Light - RULE 1767, WEEKEND - Master Light Turns ON Master Bath and Master Overhead Light
:scissors:
ELSE
:scissors:
Resume Rules: Master Bath Overhead - Timer by motion, Master Bath Presence Sensor R2 - for Master Bath Lights, Turn Master Overhead Light on at Night Time, Weekend - Afternoon Master Bath R2 Presence Sensor, WEEKEND - Master Light turns OFF, turn off Master Bath Light and Master Overhead Light - RULE 1767, WEEKEND - Master Light Turns ON Master Bath and Master Overhead Light

This rule only runs when the Company Coming Over turns on, so the ELSE statement will never be executed. The trigger should be Company Coming over changes, or two separate triggers, one when it comes on and one when it goes off.

The required expression is mis formed. You need to edit it and remove the extra OR. This happens to me quite often when editing required expressions. Its a bug in the editor, might not cause any issue but I would get rid of it. Is there supposed to be a third ORed expression?

*****okay I got it figured out! I can walk through the bathroom motion and the lights stay on they do not time out after I leave! Thank you for your help

Randy, You failed to follow up on this advice.

Your rule to pause and resume the other rules is badly written.

The rule will only trigger if "Company Coming Over" turns on, but then you have a defined expression to check if "Company Coming Over" is on, before the rule will begin executing the actions. The required expression is redundant.

Your first action is to check if the "Company Coming Over" is on, but it has to be on, because that is the condition that triggered the rule. So the IF statement is not required.

Then your actions check if "Company Coming Over" is off, and if it is, it will resume all the other rules. But that will never happen because this rule only runs (triggers) when "Company Coming Over" is on. So the ELSE is useless.

You can either follow the advice of @terminal3, or to create one rule to pause the other rules, and a 2nd rule to resume the other rules.

This is how the rule was working and with Company Coming Over it passed the motion. I removed the expression. With Company Coming Over ON, And I tested it for over 40 minutes and it kept the motion bypassed.

This what I had but than I deleted the screenshot because I thought it was wrong. Is this right? Do I still the it written like below? With “Changed”. I am going to test it right now. It is 7:14 pm I will drop the log down at the bottom.

No, you should not use your trigger as part your required expression.

A required expression must be true in order for a rule to trigger. As written, Monday through Friday the Company Coming Over switch has no effect on the rule, because you ORed the two expressions. So as long as it is Monday through Friday it doesn't matter what the Company Coming over switch is set to. On Saturday and Sunday the rule will trigger if the Company Coming over switch is on. Since it's not Monday through Friday that part of the expression is false, so it will only trigger if the Switch is on. I don't believe that is what you want.

If you want this rule to only run on Monday through Friday while Company Coming over is off, do the following:

Change the required expression to AND not OR, and Company Coming Over needs to be off not on.

Required expression:
Day Monday .. Friday AND
Company Coming Over is off
{Rule can only be triggered when it's Monday through Friday AND if the switch is off.}

Also remove Company Coming Over as a trigger, the presence sensor should be your only trigger.

Expression is removed for now.

Update -

I think this is what you want but I do not understand “OFF” for Company Coming Over. However as long as it works.

“So as long as it is Monday through Friday it doesn't matter what the Company Coming over switch is set to. On Saturday and Sunday the rule will trigger if the Company Coming over switch is on.”

· Master Bath Light

· Master Overhead Light

These should never go OFF when Company switch is active (On or Off) I always had it set to ON to bypass rules.

It is about 7:44 pm

You seem to be jumping back and forth between different rules, this latest rule you posted is not the one I said needed changes. You should re-read my last post and look at the rule I was talking about. I put your screenshot in my post so you would know which one I was referring to.

This rule does need the switch as its trigger and does not need a required expression.