Rule Machine Version 1.7 Released

Rule Machine Version 1.7.0 released

This update is primarily to add thermostat operating state functionality and to fix bugs related to thermostats. It is now possible to use thermostat operating state as a trigger or condition, in addition to thermostat mode.

Certain bugs were identified in the previous versions with respect to thermostat modes and fan operation. These have been fixed.

Due to limitations of my setup, I am not able to fully test these features. Feedback is greatly appreciated, and I shall respond to any bugs reported promptly.

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

15 Likes

Yup, thermostat mode detection is now working. :ok_hand:

1 Like

Great job Bruce! Love Rule Machine and its made my recent purchase of a smartthings hub worth it! You should be working for them and they need to implement rule machine by default. Keep up the great work!

2 Likes

This is my first shot at upgrading Rule Machine, and I donā€™t want to mess up all the rules Iā€™ve put in place. When upgrading RM do I simply replace the code and republish? Does the code for the child ā€˜Ruleā€™ also need upgraded/republished? If the upgrade process is already documented somewhere and I missed it can you link me to it?

Thanks, Rule Machine definitely rocks!

You should get the latest source from Github for both Rule Machine and Rule. Yes, simply overwrite your source now in the IDE. Your existing rules should be fine after the update.

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.

1 Like

Rule Machine Version 1.7.1 Released

This new release allows for button devices with up to 20 buttons, 4 is the default. I need someone to test this with a ZWN-SC7.

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

1 Like

Rule Machine Version 1.7.2 Released

Up to my old tricks a bit with some new features for Rule Machine.

Iā€™ve been using my own custom lighting app for a long time, called Motion Lighting. The key features of this are motion controlled lighting with dimmer levels for each mode. Iā€™d like to replace this with Rule Machine, but I needed these new features:

New Actions

Set dimmer levels per mode. This action allows you to specify dimmer levels for a group of dimmers, with a different level for each mode. You can select which modes these levels apply to. By combining this with a motion based rule, your lights will come on to these different levels.

Run ruleā€™s actions. This allows you to cause the Actions for True of another Rule to be run, without regard to the Conditions/Rule of that other Rule. This is useful if you need a Rule (as opposed to a triggered rule), but youā€™d like to have additional triggers or rules that can cause its actions.

Action Only Rule. It is now possible to have a Rule that only has Actions; it would have no Triggers and no Conditions. Such a Rule can be run by other rules using the new Run Rule Actions feature.

Update Instructions

For this update, you must update both Rule Machine and Rule:

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.

Example

Here is an example of using dimmers per mode:

6 Likes

Thanks for working with me on getting the first batch of issues resolved so quickly!

I will let you know if I discover anything else.

Awesome the dimmer levels per mode!

LJ

1 Like

Awesome Bruce. I can reduce my rules by 2 per motion area now. I was building a rule for every mode that was triggered by motion. It was starting to get hard to keep track of the listā€¦

This is awesome! Thermostat state was exactly what I have been waiting for.

Iā€™m using this Nest Device type - https://github.com/desertblade/device-type.nest/blob/master/nest.devicetype.groovy

I have a rule set up to turn on a ceiling fan when the thermostat state is heating or cooling, but it seems that the only way the thermostat state gets updated is when I actually open the nest device in the app or when I press refresh within the nest device on the app.

I assume that this is because the device type doesnt automatically push the current state of the thermostat to ST? Is there a way to have the Nest device status / state automatically refresh with ST? Or is it just a limitation of this Nest device type.

Version 1.7.3 Released

This version fixes a bug that prevented ZWN-SC7 button controller from working correctly. This button controller now works with Rule Machine!

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

Iā€™m not familiar with Nest. If it doesnā€™t throw events for thermostat operating state when it begins heating, thatā€™s a problem. In fact, that would mean that you canā€™t use thermostat operating state as a Trigger. But, you may be able to use it as a Condition. You could determine that by giving yourself a Rule that you trigger somehow, that uses Thermostat operating state heating as a condition. If that works, then youā€™d know that Rule Machine can query to find out the operating state. Conjure up a testā€¦

Did some experimenting the nest seems to only throw events and update its operating state when you physically press the refresh button within the Nest Device in the app. I confirmed this with live logging. It executed poll when I pressed refresh.

The only time I was able to get the rule to execute was with the following condition:

(Note before the rule executed, I had to press refresh in the nest device screen on the app in order to update the operating state.)

There was an oddity when I was testing though. I added a physical switch as a trigger and the thermostat operating state evaluated to true but the rule still didnā€™t execute, iā€™m not sure why.

I did explore the expert features and Nest has ā€œpollā€ ability which is what I need to update the thermostat operating status. Is there some kind of rule that I can create to run that poll command run every 10 minutes?

Version 1.7.4 released

This update rearranges the UI a bit. There is a new first page, where you decide what you want to setup. There are three choices:

  • Define a Trigger
  • Define a Rule
  • Define just Actions

Your existing Rules will show up as one of these, depending on what you created.

I want users to distinguish between a Trigger (even one with Conditions and a Rule) and a Rule, which has no Triggers at all. These are fundamentally different. Hopefully, this will help maintain that distinction as you think through your automations.

If you have an existing Rule that you want to change into a Trigger or just actions, my suggestion would be to remove it and start over.

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

Can Rule Machine do something like:

  1. Motion detection.
  2. Set colour/dim level of a specific bulb.
  3. Motion stops.
  4. Return bulb back to its previous state.

Yes it can. It would look like this. Assume color is blue @ 50% to start.

Conditions: motion active
Rule: motion active
Action for true: set color white @100%
Action for false: set color blue @50%

Of course I donā€™t know what light or controller you are using so you will have to decide what the actual actions are but that should be easy to set through your available options.

HaHa, no it canā€™t. Rule Machine lacks context. So there is no way to capture ā€˜previous stateā€™ as itā€™s implemented. @twack wrote an app a long time ago that captures the state of all of the devices it controls whenever itā€™s triggered, and then could restore them later. Iā€™ll have to think about that, if it would be possible to capture state and then have restoring it available in an action. Sort of a cool idea!

3 Likes

This is one of the biggest features missing from Smart Lighting and for me, would drastically reduce the amount of Smart Lighting child apps I need.

With Rule Machine, it would literally RULE ALL SMARTAPPS. Seriously being able to return anything to its previous state would be so incredibly powerful and help reduce complexity of rules at the same time.

One of the reasons Iā€™m hanging on to Smart Lighting instead of switching to rule machine is because I am mostly in the local domain so thereā€™s very little automation for me that depends on the cloud but to me, if you had the ability to return to a previous state, it would be more useful than local control to me.

1 Like