Rule Machine - Get peer assistance here with setting up rules

Put the virtual switch in the Delayed Off list for False, as another switch to turn off. That way, when the lights turn off after 5 minutes, the motion rules will become enabled again.

1 Like

I think you may also want to put turning off the virtual switch in with your True delayed off. It all depends on when you want the motion rules to become enabled. You could even use separate timing for that, it’s up to you. Just bear in mind that when you turn on the virtual switch, that disables the motion rules. When you turn the virtual switch off, that re-enables the motion rules. This assumes you’ve made the virtual switch the disable switch for the motion rules.

Yea I added it to the true delayed off and also added the virtual switch to the disable rule for both of the motion rules. That is indeed how I want it all to turn. I do not want the motion rules to run when the Door rule is currently running. After 5 minutes of the door closing or after 15 min of the door not closing and the lights turning off is when I then want the motion rules to become active again. I believe what you have told me to do has solved it but I will try it tonight to make sure.

1 Like

I seem to be haveing troubles with my disable rule setting. For some reason it will not disable. I created a virtual switch and made a rule for bathroom Override on and off. My lights turn on with motion and off with no motion pending perfectly. My Override also turns on before my 3 min runs out and turns off once I step out of the shower. It seems that even though the override turns on the lights still turn off after my last motion event. Here’s how I have it setup. Thx for any input.

Are you using the latest version of Rule Machine? Two days ago the following was indicated in the Rule Machine thread.

Small bug fix update: Version 1.2.3
Release notes:
bug in disable rule identified and fixed

Also, it looks like you created a scenario where Bathroom overide can receive both an on and off command. For the override on command you indicated that it could occur if just the bathroom fan is on by using “or”. For off, you also indicated bathroom fan on but it requires multisensor activity. Thus when the condition for off is met, the condition for on will also be met.

Yes I did that update when it was released. I also see there’s another update but havnt done it yet. I see what your saying about having the fan for on and off but the override does turn on and off when it’s supposed to. Also when my lights turn off the disable rule override is still “on”.

I just made a test rule and a new virtual switch. Rule is turn on when motion active, set dimmer, turn off pending 1 min and disable with switch on. This time I’m manually turning the disable rule switch on and off. So I walk in, lights turn on, walk out and manually turn on my override. I should also mention that my multisensor is set for a 10 sec pir reset, so my motion tile stays lit for 10 sec then motion clears. I then manually turned on my override before this 10 sec (rule is true) and it works, lights stay on past 1 min.

Next I tried to override manually after the 10 sec (rule is false now) and the lights turn off after 1 min. Just wondering if this is the expected result and disable rule only works when the rule is true?

@bravenel
I’m trying to create a new rule and I keep getting this error

Edit:
I removed the rule and tried clicking done after each step. The error occurs after I add the “and” and any condition in the define rule section. It doesn’t matter the order of the choices our what I chose, it sends to be the"and".

Does that make sense?

Edit #2:
I get the error after choosing the first item in the define section. Nothing to do with “and”.

Evidently 1.2.6 is broken. Try rolling back to 1.2.5. You can do that in Github, and grab a copy of 1.2.5 to put into your IDE. Please let me know if that fixes it.

I have no idea how to do that…

To find the history for a specific app:

Go to GitHub for the app in question
Click ‘History’ on the right hand side, From here you can see
previous versions. Click the one you want, in this case click ‘Update
Rule.groovy’ from Nov. 27th.

Click ‘View’ on the right hand side to view the previous code.

https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy

I just tried 1.2.5 and Im experiencing the same results. The override will only work if turned on while motion is still active. Once applied after motion stops, the rule will use the pending time and shut off the lights. Thx

What do you mean by “override”?

Sorry meant to say the disable rule when switch is on.

I understand the difference between Rule Machine and Trigger Happy. The question I have is what is the downside of putting triggered only events in Rule Machine? I would prefer to have a single repository for these types of actions. If there is no conditional logic doesn’t Rule Machine just trigger the TRUE action?

1 Like

Guys, I just have a simple question.

I have a rule with the switch to disable rule when ON activated, and using the X switch. Then I have the following

  • Contact is open --> Rule is True --> Turn on X Switch
  • Contact is closed --> Rule is false --> Delay Turn Off X Switch
  • Contact is open (before delay) --> Rule is ??

I want to understand, whether Rule Machine, will know that the X Switch ON status is due to a prior Rule Machine true statement, or that Rule Machine will consider that ON status as it was bases to override such rule

Thanks

The way you currently have it the light will turn off after the delay regardless of what else happens with the contact. If you would like the timer to reset you need to use turn on/off with delay pending cancellation.

Thanks.
It actually worked fine, until I added the Switch to disable when ON (which is the same I turn on/off). When adding, the rule never turned off the light.

I will review the code, but apparently when launching the delay, and if during such period another event fires, the app believes it has already been on and does not evaluate them (no new logging appears in the IDE).

OK, as @bravenel originally used the Rule Machine for, I am trying to set up a holiday light show using an outdoor led strip I have set up. What I would like to do is us a virtual switch “Holiday Lights” to turn on a loop of red and green flashing or fading lights. When I originally tried @bravenel method, the loop would go continuously because I believe his Loop switch was designed to do so. What I think I need to do, is use the Holiday Lights switch as the master on/off to turn on a Loop switch to run the actual function. Do I need two rules to do that? Also, is there a way to set the lights to flash and or fade or some combination of both? The only thing I have used so far was Bruce’s 1 min delay on/off red to green but if there is other ways to set up a cool show, I am willing to try it.

Thanks in advance!

I’d like to turn on the fireplace once all my great room motion sensors trip, if it’s between 6:30 and 9:00am, and if it’s cooler than 69 degrees. My fireplace switch will only run for 60 minutes before turning itself off, so I don’t need to worry about that. However, if the rule triggers at 6:30am, and the switch turns itself off at 7:30, the rule immediately fires again. My desire is to only have it fire once per day.

One way I thought of doing this would be to create a virtual switch that I set to off every day at 1am. I can have the rule turn this switch on when it turns on the fireplace, and add a condition to the rule that says to only fire if the virtual switch is off. Is that the best way to go about these kinds of rules?

If so, what do you do to try and keep down on the clutter from all of these virtual switches?

Thanks,

Justin

I’ve created rooms to organize everything.

I made a room called “misc stuff” and put all of the awkward stuff in there.

I try not to use the “things” tab unless I have to.

I do the same thing in the Alexa app.

1 Like