Rule Machine Version 1.7 Released

Thank you Bruce, that worked on a specific time no problem, I will move it to Sunset -20 and check it again tomorrow

Thanks a ton
Rick

According to @mishakim & @bravenel

[quote=“mishakim, post:284, topic:37355, full:true”]
…If I understand correctly, that remote and others like it is a Controller. It will connect to SmartThings as a Secondary Controller, but will just copy over the z-wave network and assume independent control of things on it, but will not report to the SmartThings hub about what it’s doing. SmartThings doesn’t know that it has buttons or that they’ve been pressed, it will simply see Z-wave devices turning on and off and not know why. So the only way to use it with Rule Machine would be to pair the buttons to physical Z-wave devices, and have Rule Machine react to those devices being activated.[/quote]

[quote=“bravenel, post:286, topic:37355, full:true”]
This is correct. …[/quote]


More details (in a different thread if need be) please about how you did this…what kind of sensor? did you have to get gadgety and cut it open or anything like that?, etc.

Hello Bruce,

I’m trying to understand the restrictions. Let’s say that I have a simple contact trigger, some conditions and a restriction of time 3PM to 6PM. Am I right to think that the condition will be evaluated at 3PM and 6PM even if the trigger doesn’t fire?

Thanks!

No. Restrictions simply disable the entire rule. So a restriction of 3 to 6 just means it can only run during that period (or on these days, or these modes). Restrictions do not cause the rule to be evaluated when they come and go.

A Condition of between two times is different. That does cause an evaluation at the start and end times selected. Of course if some other condition triggered an evaluation during that period, the test of the time condition would yield true.

A “Time of day” condition sets up two scheduled jobs, at the beginning and end. Those jobs evaluate the rule. For example, suppose you have a rule to send you a notification if the garage door is open after 6 pm. With a condition of 6 pm to sunrise, for example, that will be evaluated AT 6 PM! If the door is open then, you will get a notification.

Contrast that with a restriction of 6 pm to sunrise. If the garage door is open at 6 pm, the rule will not be evaluated and you will not receive a notification. You would get the notification the next time it was opened after 6 pm.

Bruce, huge thanks. I didn’t understand the restrictions, that’s why I wasn’t using them. It will be a lot easier now!

LJ

@craig and @keltymd thanks for the suggestion! The contact sensor is easier to do instead of removing the whole bath! :slight_smile:

For a few days, I will keep searching of a way to trigger a virtual switch from an physical press on a dimmer to disable a rule for a few minutes. That would be useful in some rooms of the house. Maybe there is a special device handler somewhere.

LJ

Bruce,
I just want to clarify this for myself.
A rule with a condition of 6 pm-9 pm, the rule will evaluate at 6 & 9 pm. But during that time, between 6&9, the rule will also be evaluated with every truth change of the rule.

Is this correct?

No. The rule is evaluated whenever there is an event for one of its conditions. Not otherwise.

Once it evaluates, if there is a truth change it does the appropriate actions.

Ok, so, between 6&9 if the rule goes True 3 times, then the rule has only been evaluated once, but will perform the actions for true 3 times?

Is this basically the same thing as setting a restriction from between 2100 & 1800?

Dude, that’s backwards. If it goes true 3 times when it’s true, it does nothing. The next time it will do something is when it goes false. Then it can go false about 50 times, and nothing will happen. Then, it goes true, and something happens.

But, if it goes 53 times, which is a prime number, the ST platform will crash.

5 Likes

Ok, I worded that wrong… If it goes through 3 full true/false cycles it will perform its true/false actions that many times… or how ever many.

I’m just trying to wrap my mind around the terminology “evaluated” & “truth change”.

I see evaluated as this - the rule is checked at the beginning of the time for truth/false. It is then monitored for any further true/false changes until the final evaluation at the end of the time period.

Is this correct?

This may be blind men with an elephant, but…

The rule is evaluated whenever an event occurs based upon its conditions. If it has a Time of Day condition, that means there will be a scheduled evaluation at both start and stop times, plus, if any other evaluations occur they will check that time period. If there are other conditions, say a door opening, that may also cause an evaluation. It could be that with two conditions, the door opening might be ignored if not during the time period. Nevertheless, the rule will be evaluated every time the door opens or closes.

Rule Machine is basically stupid. If anything happens that touch one of the conditions of a rule, it checks the rule (am I true? am I false?). It may be true, but that doesn’t matter unless it was false previously. The rule becomes true, or the rule becomes false. All of the other evaluations do nothing.

With something like motion controlled lighting, there are lots of evaluations and rule truth changes that amount to nothing, because the lights in question are already on. Those rule truth changes have to do with cancelling the timer when motion goes active again after having gone inactive.

Actually, this makes sense. The rule is evaluated every time something happens. It just only does something when that evaluation results in a change of status.

Thanks :sunny:

2 Likes

Is there a way to set private boolean after a delay?

You’d have to do it in actions that have Delay These Actions…

Rule Machine Version 1.7.13 Released

This release also entails a new version of Rule Machine parent app (1.7.5).

This release improves the Custom Commands feature in Expert Features. I intend to write up a post today to explain Custom Commands in more detail. It is no longer necessary that a device to be tested for commands have capability.actuator. Instead, now you can select the capability of the device to be tested, and then select from devices that have that capability.

Suppose you have a thermostat with many more commands than the basics already supported by Rule Machine. When you test it for Custom Commands, it will show you all of those commands, and you can save the ones you want to use, and then use them in a rule, trigger or actions.

Another cool use is with virtual presence and virtual contact sensors (or simulated presence, simulated contact). By testing one of these you would expose its command, e.g., open and close for the simulated contact sensor. These commands can be saved, and then used in a rule action. This could be very handy for managing SHM, and introducing delays.

Rule Machine github: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule-machine.src/rule-machine.groovy. Save and Publish for me.

Rule github: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy. Save and Publish for me.

4 Likes

Is there a way to delay certain actions, but not others, within the same rule?

Only to a very limited extent. Delay These Actions delays everything in the actions, so that’s not too useful. Turn on/off after a delay, Turn on/off after a delay pending cancellation, and Evaluate a rule after a delay all allow some actions to happen right away, while those others are delayed.

To have more refined control of delays, you would need to use Actions with Delay These Actions, and run those actions from a rule. A single rule could run several of those, each with a different delay built into the Actions.

I don’t think that’s correct. If I understand correctly, that remote and others like it is a Controller. It will connect to SmartThings as a Secondary Controller, but will just copy over the z-wave network and assume independent control of things on it, but will not report to the SmartThings hub about what it’s doing. SmartThings doesn’t know that it has buttons or that they’ve been pressed, it will simply see Z-wave devices turning on and off and not know why. So the only way to use it with Rule Machine would be to pair the buttons to physical Z-wave devices, and have Rule Machine react to those devices being activated.

2 Likes

Just noticed the rule counter. I don’t know how long it’s been there, but I’ve always thought I have a LOT less rules than I actually have. Talking about reality check :slight_smile:

1 Like