Manage Conditions

Is it possible to have two conditions?
The rule works perfect. All I want to do is when I go on Vacation give my dog sitters more lights on and a longer wait time. It says "unused" so I know it is not going to work.

So when I am home I want to turn this rule off. Is this possible? If so can you give me heads up what I need to do?

"Vacation - New" is a virtual switch. I have one for my Christmas lights and it works great.

Vacation - for Abby Light 4



Yes it is.

You have created the condition but you haven’t used it in the required expression. Add the condition in the required expression just like you did the first condition in your rule.

See example below. Once you use the managed condition you created, it will not longer say it is not unused any longer.

If this is a duplicate of another rule, (assumed that you want the shorter time when you are not on vacation), do not forget to put the opposite logic as a required expression on the other rule.

This rule -> Required: Vacation- New is on
Other rule-> Required: Vacation- New is off

Otherwise, you will have competing rules and this rule will look like it is not working. Lights will go off at the time stated in the shorter rule before you get to the ten minutes.

Another comment about your rule.

Your actions will only be executed when they become triggered by the slider contact being opened. So there is no need for your actions to check if the slider contact is open.

Ignoring that for a moment....

You rule is saying that

If the slider contacts are open
Turn on some lights
Wait 10 minutes
Turn off one of the lights

Then you are saying that

If the slider contact is not open (Else-If implies the previous IF was not true) Then check if it is open.

If the slider contact is open
Send a message to your phone.

You checked that the contact was opened before turning on the lights. No need to check it again before sending the message. That could have been included in the first section. Unless you have an intention I don't know about.

Do you want to send the message immediately when the contact is opened, or only if it remains open after the 10 minutes?

2 Likes

Thank You!

@Ricktronic is right.

As written in the OP, the conditional logic of the actions is kind of confusing, probably unnecessary, and may not achieve what the OP intended.

@Randy513 you should consider explaining, in more words than this:

what exactly you expect this rule to do.

ETA: otherwise everyone here is just kind of guessing at your intentions for the rule.

1 Like

It is a copy of the rule he was working on in this post (where he was given the same advice regarding the check for if the slider was open). This one just has a longer timeout for when he is on vacation. (Yes.... I am speculating)

2 Likes

This also makes it harder for anyone to help.

@Randy513 help us help you.

If you’re going to create a new thread, at least reference a prior thread you’ve created about the same or similar rule.

2 Likes

@Randy513
If I read your intentions from both rules correctly, I am thinking you want something that looks more like this in one rule (assuming you only want to turn off one of the two lights you turned on):

1 Like

tray_e

First off THANK YOU!! with your Great screenshot I was able to get it working perfectly!!!! The only thing that is still not working is the notifications - not a big deal at this point.

All are so tech savvy your kindness is appreciated.

Thanks again for the screenshot it was a great help for me.


One more thing if "notify Rands iPhone:..." is enabled the rule does not work.

What exactly doesn't work.?

The notification doesn't work, or the lights do not turn on at all when the slider contacts become open?

What do the rule logs show?

1 Like

The objective of the rule is this:
When the slider door contact goes into the open status it triggers:

When Virtual switch Vacation New is OFF:

Abby light turns on for 5 minutes and then turns off. Even if door contact is left open. And when the contact CLOSES NOT TO TURN to turn the light back on.

When Virtual switch Vacation New is ON: (I am on Vacation)

Abby light turns on for 10 minutes and turns off. Even if door contact is left open.

And when the contact CLOSES NOT TO TURN to turn the light back on.

Note: if I Notify Randys iPhone enabled none of the above rule did run. However I rebooted the hub and now it works. Speaking of just the lights everything worked great, only problem is when I close the door contact the light turns back on and stays on for the wait timer.

***HERE IS HOW I WOULD LIKE TO SEE IT WORK

So when I am on Vacation and the slider door opens at night the Abby light turns on for 10 minutes.

And when I am on Home and the slider door opens at night the only the Abby light turns on for 5 minutes.

And this is exactly what happened. The rule did just as it was programmed to do with the exception of when I close the it turned the light back on.

As far as the notifications go I wanted to be notified after 30 minutes with Vacation New On or Off. This is not a big deal, just thought it would be nice to have everything in one place.

=======STOP HERE==== below is extra
If possible – when Vacation New is ON I would like two lights to be on. Abby light and the lanai lights to be on for the 10 minute timer.

Home just the one Abby light.

I tried to make this as clear as possible.

Glad that it seems to mostly work. Hoping that looking through the example, you are picking up some of the logic on how/why it works. One of the recommendations I had made a while ago was, when asking for help, you state what you want to happen - step by step. The reason for that is that is how programming works. In order to get things to work, you have to think in the steps that a computer does. This means thinking of everything in a step by step "simon says" kind of way.

This possibly could be done in one rule. But, it would be more simple to do as its own rule.
Trigger: Slider reports open and stays that way for 30 minutes
Action: Send notification

It could be because multiple triggers are not prevented. I am betting that the slider reporting open for 3 seconds could happen multiple times during the 5 or 10 minute elapsed times in your rule. So, you are likely dealing with repeated instances of it reporting open (I failed to account for that in my original advice)

You can add:
-a required condition of Private Boolean equals True (So, required conditions will now be
"Time between Sunrise+20minutes and Sunset AND
Private Boolean = True")
-Insert as the first action to set private boolean to false (Before the "on Abby Light")
-Insert as the last action to set private boolean to true (After the last "End if")

When done, make sure the private boolean at the bottom of the rule says "true." It should be by default. But, with all the iterations that have been done to the rule, it doesn't hurt to check.

If it does not, just click on the "false" and it will jump to the actions page and you will see that "false" is blue. Clicking it again should change it to "true" and you can click done in actions, then done in the rule to update it.
1000006660

2 Likes

Excellent advice from Tray above!

When I'm creating a rule, I always consider how often that trigger event can happen and what are my options to box that in (as much as possible) to just what I need for this rule.

In particular, I'm concerned with the likelihood of that trigger firing again while the rule is running -- how can I best manage that (sometimes I may want the rule to re-trigger, and other times, I definitely do not).

Using a Private Boolean (or equivalent, such as a gatekeeping virtual switch) is a great option for ensuring a rule doesn't re-trigger while it's running.

1 Like

I am going write it now can one of you check when I am done?

Am I even on the right track?


Test Vacation Kitchen Slider 3

You are RIGHT! I don't have the mind for this.

Back in post #11, you had everything working perfectly, except for notifications, and the light turning on again when you close the contacts.

It was suggested by @tray_e, that you could prevent re-triggering the light by making use of a private boolean, as a defined expression.

In your latest screen capture you totally eliminated the defined expressions that you originally had, and entered everything as triggers, including the private boolean test.

Go back to what you had in post number 11 and add the test for the private boolean as an additional "Required Expression".

Okay, have not tested yet.


Test Vacation Kitchen Slider 9