Difference between revisions of "Rule-5.0"

From Hubitat Documentation
Jump to: navigation, search
(Changes to formatting and removal of some depreciated RM 3.0 references)
(Formatting updates)
Line 1: Line 1:
<h1>Rule Machine<sup>®</sup> 4.0</h1>
+
<h1>Rule Machine<sup>®</sup> 4.0</h1>Rule-4.0 is the culmination of a journey in the transformation of the Rule Machine<sup>®</sup> app. All at once, it simplifies and adds power, resulting in a fully generalized automation engine. The prior top-level organization of Rule Machine has been replaced with an optimized interface. The changes described below, explain how prior rules were created versus how it is accomplished with Rule-4.0. The former structure of Rules, Triggers, Triggered Rules, Actions and Schedules are now replaced with the definition of what causes a rule to run, and the resulting action. The former Button Controller app is now incorporated into Rule Machine, but with increased power and flexibility. New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You simply define what causes the a rule to run, and then that you want it to do.
 
+
==='''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''===
Rule-4.0 is the culmination of a journey in the transformation of the Rule Machine<sup>®</sup> app. All at once, it simplifies and adds power, resulting in a fully generalized automation engine. The prior top-level organization of Rule Machine has been replaced with an optimized interface. The changes described below, explain how prior rules were created versus how it is accomplished with Rule-4.0. The former structure of Rules, Triggers, Triggered Rules, Actions and Schedules are now replaced with the definition of what causes a rule to run, and the resulting action. The former Button Controller app is now incorporated into Rule Machine, but with increased power and flexibility. New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You simply define what causes the a rule to run, and then that you want it to do.
 
 
 
=== '''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?''' ===
 
 
To explain the former Rule Machine 3.0 and earlier concepts of Rule, Trigger, Triggered Rule, Actions and Schedule versus how rule automation is now accomplished, as well as how Button Controller is now incorporated, we need to first address the primary differences.
 
To explain the former Rule Machine 3.0 and earlier concepts of Rule, Trigger, Triggered Rule, Actions and Schedule versus how rule automation is now accomplished, as well as how Button Controller is now incorporated, we need to first address the primary differences.
  
# What was a '''Trigger''' is now the basic format for all rules.
+
#What was a '''Trigger''' is now the basic format for all rules.
#* The user selects '''Trigger Events''' and define actions.
+
#*The user selects '''Trigger Events''' and define actions.
# Formerly, an '''Action''' always required a Trigger Event, but it is now possible to omit a Trigger Events and only define actions. However, such a rule '''must''' to be run by some other rule or from the Rule Machine API.
+
#Formerly, an '''Action''' always required a Trigger Event, but it is now possible to omit a Trigger Events and only define actions. However, such a rule '''must''' to be run by some other rule or from the Rule Machine API.
# The previous Schedule event, is now available as a new type of Trigger Event named '''Days of Week Schedule'''.
+
#The previous Schedule event, is now available as a new type of Trigger Event named '''Days of Week Schedule'''.
# The previous '''Button Controller''' app is fully incorporated as a new type of Trigger Event named '''Button Device'''. Once a Button Device is selected, the same user interface of the former Button Controller 3.0 is presented to define actions for any of the buttons available on the selected device. However, unlike the previous Button Controller app, these actions have full access to conditional logic and global variables.
+
#The previous '''Button Controller''' app is fully incorporated as a new type of Trigger Event named '''Button Device'''. Once a Button Device is selected, the same user interface of the former Button Controller 3.0 is presented to define actions for any of the buttons available on the selected device. However, unlike the previous Button Controller app, these actions have full access to conditional logic and global variables.
  
=== '''Change in logic for Rule-4.0''' rule ===
+
==='''Change in logic for Rule-4.0''' rule===
In any Rule, the rule itself can be thought of as an overarching '''IF-THEN-ELSE''', where if the condition was '''True''' for the '''IF''' part or the rule, then '''Actions for True''' are run, and if they are '''False''', then '''Actions for False''' are run. In '''Rule-4.0''', this same logic can now simply be done with the '''Conditional Actions''' of '''IF-THEN and ELSE''' in the '''Actions''' section of a rule. As described in the next section, '''IF-THEN''' now has the same full logical expression capability previously available, with the addition of '''AND, OR, XOR, NOT''' logical operators, and nested parenthetical sub-expressions.
+
In any Rule, the rule itself can be thought of as an overarching '''IF-THEN-ELSE''', where if the condition was '''True''' for the '''IF''' part or the rule, then '''Actions for True''' are run, and if they are '''False''', then '''Actions for False''' are run. In '''Rule-4.0''', this same logic can now simply be done with the '''Conditional Actions''' of '''IF-THEN and ELSE''' in the '''Actions''' section of a rule. As described in the next section, '''IF-THEN''' now has the same full logical expression capability previously available, with the addition of '''AND, OR, XOR, NOT''' logical operators, and nested parenthetical sub-expressions.
  
* '''Example:''' Using a Trigger Event such as a contact sensor '''Front Door *changed*''' to illustrate the difference, the previous Rule Machine version used this to interpret the '''Condition of Front Door *open*.''' The rule was evaluated whenever '''any''' event happened for the Front Door.  In Rule-4.0, this is explicit, whereas in previous versions the rule was '''Front Door *open*''', we now make that event the Condition of an '''IF-THEN''' action.  What were formerly '''Actions for True''', now become the Actions following '''IF-THEN''', and the former '''Actions for False''' become the actions following '''ELSE'''. Most Rules will now follow this basic format.
+
*'''Example:''' Using a Trigger Event such as a contact sensor '''Front Door *changed*''' to illustrate the difference, the previous Rule Machine version used this to interpret the '''Condition of Front Door *open*.''' The rule was evaluated whenever '''any''' event happened for the Front Door.  In Rule-4.0, this is explicit, whereas in previous versions the rule was '''Front Door *open*''', we now make that event the Condition of an '''IF-THEN''' action.  What were formerly '''Actions for True''', now become the Actions following '''IF-THEN''', and the former '''Actions for False''' become the actions following '''ELSE'''. Most Rules will now follow this basic format.
  
=== '''Former Rule Truth and Cancel on Truth Change''' ===
+
==='''Former Rule Truth and Cancel on Truth Change'''===
 
There are two subtle differences of Rule-3.0 that have now changed in Rule-4.0. The concept of a Rule Truth is gone in Rule 4.0 and is instead now explicit in the way you write the '''Actions''' for a rule. If you don't want the Actions of a Rule-4.0 rule to run unless there has been a change, which previously would have been the same as a change in Rule Truth of a 3.0 Rule, you can do that explicitly using a Private Boolean.
 
There are two subtle differences of Rule-3.0 that have now changed in Rule-4.0. The concept of a Rule Truth is gone in Rule 4.0 and is instead now explicit in the way you write the '''Actions''' for a rule. If you don't want the Actions of a Rule-4.0 rule to run unless there has been a change, which previously would have been the same as a change in Rule Truth of a 3.0 Rule, you can do that explicitly using a Private Boolean.
  
 
For example, If a motion sensor becomes active, a Private Boolean can be also set to '''False''', with a delay before returning to '''True'''. The can be built so the lights will not be turned on again until the full delay timer has run its course and the lights have been turned off.  When that happens, Private Boolean is set to '''True''', and the whole cycle can repeat.
 
For example, If a motion sensor becomes active, a Private Boolean can be also set to '''False''', with a delay before returning to '''True'''. The can be built so the lights will not be turned on again until the full delay timer has run its course and the lights have been turned off.  When that happens, Private Boolean is set to '''True''', and the whole cycle can repeat.
 
+
==='''What about Triggered Rules?'''===
=== '''What about Triggered Rules?''' ===
 
 
All "Rules" in Rule-4.0 are in effect '''Triggered Rules'''. They each have a '''Trigger Event''', and then '''Conditional Actions'''.  Instead of a rule with '''Actions for True''' and '''Actions for False''', they simply use conditional logic in the actions to create an equivalent '''IF-THEN-ELSE''' structure.
 
All "Rules" in Rule-4.0 are in effect '''Triggered Rules'''. They each have a '''Trigger Event''', and then '''Conditional Actions'''.  Instead of a rule with '''Actions for True''' and '''Actions for False''', they simply use conditional logic in the actions to create an equivalent '''IF-THEN-ELSE''' structure.
 
 
===Events===
 
===Events===
 
+
Each rule has one or more '''Trigger Events''' that when triggered, cause the rule's actions to run.<p>Events are created by the devices or conditions in your system. Each device creates events appropriate to the type of device. A '''Trigger Event''' listens for specific events and when a trigger receives a selected event, it causes the defined '''Actions''' to run.</p><p>Rule Machine allows the following events in a Hubitat Elevation<sup>®</sup> system to be acted upon.  Each event results in a single test and the supported events and states that can be tested are listed below. For each event that refers to a device, one or more devices can be selected, and then the device state required for the '''Condition''' to be met can be selected.  When multiple devices are selected, the Condition/Event may apply for '''ANY''' (default) or '''ALL''' of the devices.</p><pre>Acceleration:             active / inactive
Each rule has one or more '''Trigger Events''' that when triggered, cause the rule's actions to run.
 
 
 
<p>Events are created by the devices or conditions in your system. Each device creates events appropriate to the type of device. A '''Trigger Event''' listens for specific events and when a trigger receives a selected event, it causes the defined '''Actions''' to run.</p>
 
 
 
<p>Rule Machine allows the following events in a Hubitat Elevation<sup>®</sup> system to be acted upon.  Each event results in a single test and the supported events and states that can be tested are listed below. For each event that refers to a device, one or more devices can be selected, and then the device state required for the '''Condition''' to be met can be selected.  When multiple devices are selected, the Condition/Event may apply for '''ANY''' (default) or '''ALL''' of the devices.</p>
 
 
 
<pre>Acceleration:             active / inactive
 
 
Battery:     value
 
Battery:     value
 
Button:                    pressed / held / doubleTapped / released
 
Button:                    pressed / held / doubleTapped / released
Line 72: Line 60:
  
 
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset, or changed, increased, decreased</pre>
 
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset, or changed, increased, decreased</pre>
 
 
===Actions===
 
===Actions===
 
 
Actions are the portion of a rule that defines what the rule does when it is triggered to run.
 
Actions are the portion of a rule that defines what the rule does when it is triggered to run.
 
+
===='''Actions as ordered script'''====
==== '''Actions as ordered script''' ====
 
 
As you define actions, you are creating a script of actions to perform when the rule runs.  Instead of only being able to have a single action for turning on switches as in the former Rule Machine<sup>®</sup> versions, you can now have as many actions as you want for each '''Action''' type and they can be run in whatever order you want. There is no predefined order of execution for Rule Machine<sup>®</sup> actions, so you may arrange the order of actions any way you want. You can insert a new action anywhere in the list of actions, or at the end of the list.
 
As you define actions, you are creating a script of actions to perform when the rule runs.  Instead of only being able to have a single action for turning on switches as in the former Rule Machine<sup>®</sup> versions, you can now have as many actions as you want for each '''Action''' type and they can be run in whatever order you want. There is no predefined order of execution for Rule Machine<sup>®</sup> actions, so you may arrange the order of actions any way you want. You can insert a new action anywhere in the list of actions, or at the end of the list.
 
+
===='''Actions can be edited'''====
==== '''Actions can be edited''' ====
 
 
The Rule-4.0 user interface provides the ability to '''Edit''' or '''Delete''' any action you have defined, giving you complete control over your list of actions.
 
The Rule-4.0 user interface provides the ability to '''Edit''' or '''Delete''' any action you have defined, giving you complete control over your list of actions.
 +
[[File:RM 4 edit and delete actions.png|link=https://docs.hubitat.com/File:RM%204%20edit%20and%20delete%20actions.png|none|thumb|600x600px]]
  
'''Delay per action and Delay (Pause) all actions'''
+
==== '''Delay per action and Delay (Pause) all actions''' ====
 +
There were three types of delays first introduced starting with Rule-3.0
  
There are three types of delays included in Rule 3.0: 
+
# Each individual '''Action''' can have its own delay, which may also include a '''Cancel on Truth Change''' option.
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option.  
+
# All actions can be delayed, effectively pausing the action execution for a specified amount of time.
2. All actions can be delayed, effectively pausing the action execution for some amount of time.
+
# All actions can also be delayed for a period of time that is dependent on the current '''Mode''' (i.e. '''Delay Actions Per Mode''').
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).
 
 
 
These are further described below.
 
  
 
''Delay per action''
 
''Delay per action''
  
Each action you define can have an optional delay. These delays can be defined with hours, minutes, and seconds. Seconds can have decimal fractions, allowing millisecond resolution. In a Rule, delays can have the option to be cancelled in the event of a change of rule truth. It is important to realize that the delay assigned to an individual action affects only that action, and not subsequent actions. Any subsequent action is executed immediately after the delayed action starts its delay timer -- it doesn't wait for that delay timer to run. When that delay timer expires, the delayed action is executed (unless the delay was cancelled).
+
Each action you define can have an optional delay. These delays can be defined with hours, minutes, and seconds. Seconds can have decimal fractions, allowing millisecond resolution. In a rule, delays can have the option to be cancelled in the event of a change of rule truth. It is important to realize that the delay assigned to an individual action affects only that action, and not subsequent actions. Any subsequent action is executed immediately after the delayed action starts its delay timer, and does not wait for that delay timer to run. When the delay timer expires, the delayed action is executed (unless the delay was cancelled).
  
 
''Delay all actions''
 
''Delay all actions''
  
It is also possible to delay all actions (also with optional cancel). The script of actions runs sequentially when the rule runs, with each action happening in order. Actions with delays start their timer, which can vary for each action, and the next action in order then runs.  By using the Delay Actions action the entire script can be 'paused' by a delay. This feature can also be specified on a per mode basis, so that the time the script is paused varies according to the current mode.
+
It is also possible to delay all actions (also with optional cancel). The script of actions runs sequentially when the rule runs, with each action happening in order. Actions with delays start their timer, which can vary for each action, and '''<u>the next action in order</u>''' runs.  By using '''Delay Actions''', the entire script can be ''paused'' by a delay. This feature can also be specified on a per mode basis, so that the time the script is paused varies according to the current mode.
  
As a consequence of these new features, some of the actions in Rule 2.5 have not been included in Rule 3.0.  Specifically, those actions which incorporated a delay, or a delay with cancel, have not been included, since now every action can have such delays.
+
As a consequence of these new features, some of the actions from Rule 2.5 and earlier were not included in Rule-3.0 and Rule-4.0.  Specifically, those actions which incorporated a delay, or a delay with cancel, are no longer included, since in Rule-3.0 and Rule-4.0, every '''Action''' may incorporate a delay.
 +
===Rule-4.0 Conditional Actions and Logical Expressions===
 +
Starting with Rule-4.0, '''IF-THEN-ELSE-ENDIF''' conditional blocks can be nested. The user interface utilizes textual indentation to help guide you in keeping track of which '''IF-THEN-ELSE-ENDIF''' block you are currently adding actions to. The user is responsible for completing each level of nested '''IF-THEN''' blocks.
  
==Conditional Actions and Logical Expressions==
+
The condition of an '''IF-THEN''' or '''ELSE-IF''' Action can be a full logical expression built-up from individual conditions, and the logical operators '''AND''', '''OR''', '''XOR''', and '''NOT'''.  Parenthesized sub-expressions are also possible. This is the same user interface of the former rule portion found in Rule or Triggered Rule from Rule-3.0. An individual '''Condition''' can be created ''on the fly'' while defining a logical expression.  Every such '''Condition''' is kept in the list of available Conditions.  This list of available conditions is present in the '''Define Actions''' page. The user interface then allows Creating, Editing and Deleting conditions.  If a condition is edited, those changes will be reflected where it is used in an '''IF-THEN''' or '''ELSE-IF''' conditional action.
  
In Rule 4.0 IF-THEN-ELSE-ENDIF conditional blocks can be nested.  The UI uses textual indentation to help guide you in keeping track of which IF-THEN-ELSE-ENDIF block you are currently adding actions to.  It falls on you to complete each level of nested IF-THEN blocks.
+
This combination of nested '''IF-THEN''' blocks and full logical expression for each '''IF-THEN''' and '''ELSE-IF''', allows creativity for rules in Rule-4.0 that is limited only by your imagination. To help you with complex logic structures, new actions are available.
  
In Rule 4.0 the condition of an IF-THEN or ELSE-IF action can be a full logical expression built up from individual conditions, and logical operators AND, OR, XOR, and NOT.  Parenthesized sub-expressions are also possible.  This is the same user interface used to create the rule portion of a Rule or Triggered Rule for Rule 3.0.  An individual condition can be created 'on the fly' while defining a logical expression.  Every such condition is kept in the list of available conditions.  This list of available conditions is available on the Define Actions page. It can be opened, and presents the familiar user interface for creating, editing and deleting conditions.  If a condition is edited, those changes will be reflected where it is used in an IF-THEN or ELSE-IF conditional action.
+
# Exit Rule - With Exit Rule the execution of '''Actions''' for that rule will stop, irrespective of what order in the rule it exists.
 +
# Pending Delays are not cancelled, and current Repetitions are not stopped by Exit Rule, but these can be managed separately if needed with '''Stop Repeating Actions''', '''Stop Rule Actions''', and '''Cancel Delayed Actions''', where appropriate.
  
This combination of nested IF-THEN blocks and full logical expression for each IF-THEN and ELSE-IF allows creativity for rules in Rule 4.0 that is limited only by your imagination.  To help you with complex logic structures, one more new action is provided:  Exit Rule.  With Exit Rule the execution of actions for that rule stops, irrespective of where in the rule it is.  Pending delays are not cancelled, and current repetitions are not stopped. These can be managed separately if so desired with Stop Repeating Actions, Stop Rule Actions, and Cancel Delayed Actions, as appropriate.
+
==== '''Automatic Condition Creation''' ====
 +
When '''Event Triggers''' are defined, corresponding conditions are created for most types. Some conditions, like '''Button''', '''Certain Time''', etc, do not have a ''state'' and so have no corresponding condition. These created conditions are available in the '''Define Actions''' page for use in '''Conditional Actions''', are available for use in other Actions, and can be edited.
  
'''Automatic Condition Creation'''
+
==== '''IF-THEN-ELSE''' ====
 
+
You can introduce conditional execution of actions using the following method.
When Event Triggers are defined, corresponding conditions are created for most types. Some, like button, Certain Time, etc, do not have state and so have no corresponding condition. These created conditions are available in the Define Actions page for use in Conditional actions. These can be edited. For example, in the rule above where Motion Changed was the trigger event, there is an IF-THEN for Motion Active as the first action. Instead of having to create that by hand, it is automatically created. One needs to edit it to modify from using Changed to using Active.
 
 
 
Every condition that you create in a Conditional action is available for use in other actions, and can be edited.
 
 
 
'''IF-THEN-ELSE'''
 
 
 
You can introduce conditional execution of actions using:
 
 
  IF (condition) THEN  
 
  IF (condition) THEN  
 
       some actions...
 
       some actions...
Line 126: Line 106:
 
       some actions...
 
       some actions...
 
  END-IF   
 
  END-IF   
 
+
'''IF-THEN''' and '''ELSE-IF''' both accept a logical expression as described above and '''IF-THEN-ELSE''' may also be nested. If the expression on the '''IF''' portion is True, then those actions following '''IF''' and before any '''ELSE-IF''' or '''ELSE''' statements will be carried out. If the expression is False, then those actions are skipped, and the '''ELSE''' portion or '''ELSE-IF''' are carried out. In the case of '''ELSE-IF''', its expression will be tested, and the following Actions that follow it will either run or will not run, depending on the result of the evaluation. There can be as many '''ELSE-IF''' sections as you need, and the '''ELSE-IF''' and '''ELSE''' portions are both are optional.  '''END-IF''' is also optional, and if omitted means all remaining actions are part of the preceding '''IF-THEN''', '''ELSE-IF''' or '''ELSE'''. However, for good rule structure, just a sentence should have a period at the end, it is strongly recommended that you use END-IF to complete an '''IF-THEN-ELSE''' as a regular practice.
IF-THEN and ELSE-IF both accept a logical expression as described aboveIF-THEN-ELSE can be nested. If the expression on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run. If the expression is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run. In the case of ELSE-IF, its expression is tested, and the following actions run or not depending on the result. There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  END-IF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. It is strongly recommended that you use END-IF as a regular practice.
+
===Repeat Actions===
 
+
Portions of, or all of the script of an '''Action''' can be repeated periodically, but you must specify the time interval for the repetition. Be careful not to make this interval too short, as you can consume your hub CPU resources by repeating too quickly. You can select any number of iterations if desired, but some method to stop the repetition is required.  When a '''Repeat Actions''' is introduced to the script, any action before '''END-REP''' will be repeated. Only the Actions between '''Repeat Actions''' and '''END-REP''' will be repeated.  Actions following '''END-REP''' will run only once the repetition has stopped. There is an optional '''Stop for a Repeat Action''' choice and if selected, then '''Stop Repeating Actions''' will stop this repetition.  Using '''Stop Rule Actions''' from either the current rule or another rule, will stop '''<u>all Repeat Actions</u>''', irrespective of which Stop selection is used.
==Repeat Actions==
 
 
 
Portions, or all of, the script of actions can be repeated periodically.  You must specify the time interval for the repetition. Be careful not to make this interval too short, as you can consume your hub CPU by repeating too quickly. You can select a number of iterations if desired.  Otherwise, another method will be needed to stop the repetition.  When a Repeat Actions is introduced to the script, following actions up to END-REP will be repeated. Only the Actions between Repeat Actions and END-REP are repeated.  Actions after END-REP will run once the repetition stops. It is optional to select Stop for a Repeat Action.  If selected, then the Stop Repeating Actions action will stop this repetition.  The Stop Rule Actions action from either this or another rule will stop all Repeat Actions, irrespective of the Stop selection.
 
 
 
 
  Repeat Actions
 
  Repeat Actions
 
       some actions...
 
       some actions...
 
  END-REP
 
  END-REP
 +
A '''Repeat Actions''', like any action, can have a condition specified.  If the condition is False, the '''Repeat Actions''' block will not be executed. If the condition becomes False during repetition, the repetition will be stopped (with the exception of when '''Repeat N Times''' is selected). This provides three features well known to computer programmers.
  
A Repeat Actions, like any action, can have a condition specified.  If the condition is false, the Repeat Actions block of actions will not be executed.  If the condition becomes false during repetition, the repetition will be stopped (not in the case of Repeat a selected number of times).  This provides three features well known to computer programmers;  A while-loop, a for-loop and repeat-until loop.  The while-loop runs only if the condition is true, and stops if it is false. A for-loop runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; the condition is not retested during iteration. A repeat-until loop runs until a condition becomes true, running at least once.
+
# While-loop - The '''while-loop''' runs only if the condition is true, and stops if it is false.
 +
# For-loop - A '''for-loop''' runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; The condition is not retested during iteration.
 +
# Repeat-until loop - A repeat-until loop runs until a condition becomes true, running at least once.
  
''While loop - repeat while the condition is true:''
+
'''Examples:'''
 +
 
 +
''While loop - repeat while the condition is True:''
 
  IF (condition) Repeat Actions
 
  IF (condition) Repeat Actions
 
       some actions...
 
       some actions...
 
  END-REP
 
  END-REP
 
 
''For loop (repeat n times):''
 
''For loop (repeat n times):''
 
  Repeat Actions n times
 
  Repeat Actions n times
 
       some actions...
 
       some actions...
 
  END-REP
 
  END-REP
 
+
''Conditional For loop (repeat n times if condition is True):''
''Conditional For loop (repeat n times if condition is true):''
 
 
  IF (condition) Repeat Actions n times
 
  IF (condition) Repeat Actions n times
 
       some actions...
 
       some actions...
 
  END-REP
 
  END-REP
 
 
''Repeat-Until loop:''
 
''Repeat-Until loop:''
 
  Repeat Actions with Stop selected
 
  Repeat Actions with Stop selected
Line 159: Line 137:
 
     IF (condition) Stop Repeating Actions
 
     IF (condition) Stop Repeating Actions
 
  END-REP
 
  END-REP
 +
'''Repeat Actions''' cannot be nested.  '''END-REP''' is optional, and if omitted, all actions after '''Repeat Actions''' will be repeated.
  
Repeat Actions may not be nested.  END-REP is optional, and if omitted, all actions after Repeat Actions are repeated. Note the "END-REP" does not have anything to do with the when the Repeated Actions will stop repeating -- it merely marks the end of the list of actions to be repeated. If you use Repeat These Actions without N Times (for loop), and without a Condition (while loop), and without a Conditional Stop, and without Stop on Truth Change (for rules only), that means to repeat forever.  That is probably not what you want to have happen. In this case, some other rule would need to cause the repetition to stop.
+
* '''Note''': The '''END-REP''' does not have anything to do with the when a '''Repeated Action''' will stop repeating, it merely marks the end of the list of actions to be repeated. If you use '''Repeat These Actions''' without specifying '''N Times''' (for loop), and without a '''Condition''' (while loop), and also without a '''Conditional Stop''' or a '''Stop on Truth Change''' (for rules only), that means it should repeat <u>forever</u>, and that is probably not what you want to have happen. In that case, some other rule would need to cause the repetition to stop.
 
 
==Wait for Events and Wait for Condition==
 
 
 
Wait for Events pauses rule execution until some specified event occurs. Multiple events can be defined to cause the wait to end.  In effect, this introduces another trigger-like capability into the actions.  There is also an event type specifically for Wait for Events, Elapsed Time.  When the Elapsed Time expires, the wait will be over, irrespective of other events the wait may be waiting for. 
 
 
 
Wait for Condition is similar to Wait for Events, but instead a condition is evaluated.  If the condition is true, no wait occurs.  Otherwise, the rule execution is paused until the condition is met.
 
 
 
Wait for Events and Wait for Condition may be used in a Simple Conditional Action.  Both pending Wait for Events and Wait for Condition are cancelled each time a rule is triggered, and be cancelled by another rule with Stop Rule Actions, or by Cancel Wait action (which presumably would have been in a delayed action).
 
 
 
==Custom Actions==
 
 
 
In addition to Custom Commands as have been available in prior versions, Rule 3.0 introduces Custom Actions.  A Custom Action allows you to select a device, and send any of the commands that device supports along with parameters it may take.  While Custom Commands are pre-defined and available to all rules, a Custom Action is created within your actions and is specific to the rule where it is created.
 
 
 
==Global Variables==
 
 
 
Global Variables are now displayed on Rule Machine main page.  When creating one, it must be initialized.  Global variable values can also be changed in Rule Machine.  When a global variable is deleted, a warning is given if the variable is in use in a rule/trigger et al, and if deleted anyway, they are removed from the rule where they are in use.  This removal may leave such a rule with holes in it.  Conditions based on variables will be removed, which in turn may erase the rule definition.  Actions that set variables will be removed.  Variables used in comparisons will leave the comparison missing what is to be compared.  Actions with dimmers/bulbs set by variables will have missing settings.  Manage your global variables with some care to avoid problems.
 
 
 
''Global Variables Can Be Used for Level/Color''
 
 
 
Global variables can be used in actions that set dimmer or bulb levels, color temperature, or hue/saturation values.  To use a variable in this way, include it with %global-variable-name%.  In each case only a "Number" global variable is allowed, and it is not range checked
 
 
 
''Global Variables can be set by endpoint''
 
 
 
A string Global Variable can be set by an endpoint trigger.  This is an addition to the [Rule Machine API](https://community.hubitat.com/t/rule-machine-api/7104). 
 
 
 
''Global Variables can be used with parameters for Custom Actions''
 
  
A Global Variable can be used with parameters by using %global-variable-name%.
+
===Wait for Events and Wait for Condition===
 +
'''Wait for Events''' pauses rule execution until some specified event occurs. Multiple events can be defined to cause the wait to end. In effect, this introduces another trigger-like capability into the Actions. There is also an event type specifically for '''Wait for Events''' named '''Elapsed Time'''. When the '''Elapsed Time''' expires, the wait will be over, irrespective of other events it may be waiting for.
  
''Global Variables in messages''
+
'''Wait for Condition''' is similar to '''Wait for Events''', but instead a '''Condition''' is evaluated. If the condition is true, no wait occurs, otherwise the rule execution is paused until the condition is met. '''Wait for Events''' and '''Wait for Condition''' may both be used in a '''Simple Conditional Action'''.  Additionally, both pending '''Wait for Events''' and '''Wait for Condition''' will be cancelled each time a rule is triggered, and can be also cancelled by another rule with '''Stop Rule Actions''', or by a '''Cancel Wait''' action (which presumably would have been part of a Delayed Action).
 +
===Custom Actions===
 +
'''Custom Commands''' formerly available in Rule 3.0 are now replaced with '''Custom Actions'''.  A Custom Action allows you to select a device, and send any of the commands that device supports along with parameters it may take.  While the former Custom Commands need to be pre-defined and were available to all rules, a '''Custom Action''' is created within your actions and is specific to the rule where it is created.
 +
===Global Variables===
 +
'''Global Variables''' are now displayed on the Rule Machine main page. When creating a Global Variable, it must first be initialized. Global Variable values can also be changed in Rule Machine.
  
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.
+
* '''NOTE''': Manage your global variables with some care to avoid problems. When a Global Variable is deleted, a warning is given if the variable is in use, and if deleted anyway, they will be removed from the rule for which they were in use and this removal may leave a rule with missing portions.
 +
** '''Conditions''' based on variables will also be removed, which in turn may erase the rule definition.
 +
** '''Actions''' that set variables will be removed and Actions with dimmers/bulbs set by variables will have missing settings.
 +
** '''Global Variables''' used for comparisons will leave the comparison missing what is to be compared against.
  
==Run actions from UI==
+
==== Global Variables may be used for Level/Color ====
 +
Global Variables can be used in actions that set dimmer or bulb levels, color temperature, or hue/saturation values.  To use a variable in this way, include it with '''%global-variable-name%'''.  In each case only a '''Number''' Global Variable is allowed, and it is not range checked
  
When you first create a new rule, you must hit Done on the main page to install the rule.  If you reopen the rule, its actions can be run by hitting Run Actions buttonIf you change the Trigger Events in any way, you must either hit Done or Update Rule button. 
+
==== Global Variables can be set by endpoint ====
 +
A string Global Variable can be set by an endpoint triggerThis is an addition to the [https://community.hubitat.com/t/rule-machine-api/7104 Rule Machine API]
  
You can select which types of logging you want to see in Logs.  This is a very good way to determine exactly what a rule is doing.
+
==== ''Global Variables can be used with parameters for Custom Actions'' ====
 +
A Global Variable can be used with parameters by using '''%global-variable-name%'''.
  
==List of Actions==
+
==== Global Variables in messages ====
 +
To include the value of a Global Variable in a message string (or HTTP request URL or body), you would use '''%global-variable-name%'''.
 +
===Run Actions from the Rule-4.0 User Interface===
 +
When you first create a new rule, you are creating a child app of the parent Rule Machine app, and therefor you must select '''Done''' on the main page to install the Rule-4.0 rule.  If you re-open the rule, its actions can be run by hitting '''Run Actions''' button. If you change the '''Trigger Events''' in any way, you must either select '''Done''' or the '''Update Rule''' button.
  
 +
=== Rule Logging ===
 +
You can select which types of logging you want to see in [https://docs.hubitat.com/index.php?title=Logs Logs].  This is a very good way to determine exactly what a rule is doing.
 +
===List of Actions===
 
<pre>  Conditional Actions  
 
<pre>  Conditional Actions  
 
  IF (conditions) THEN
 
  IF (conditions) THEN
Line 289: Line 259:
 
  Wait for Condition
 
  Wait for Condition
 
  Cancel Wait
 
  Cancel Wait
  Exit Rule</pre>
+
  Exit Rule</pre><h1>Exit Rule</h1>

Revision as of 22:27, 14 March 2020

Rule Machine® 4.0

Rule-4.0 is the culmination of a journey in the transformation of the Rule Machine® app. All at once, it simplifies and adds power, resulting in a fully generalized automation engine. The prior top-level organization of Rule Machine has been replaced with an optimized interface. The changes described below, explain how prior rules were created versus how it is accomplished with Rule-4.0. The former structure of Rules, Triggers, Triggered Rules, Actions and Schedules are now replaced with the definition of what causes a rule to run, and the resulting action. The former Button Controller app is now incorporated into Rule Machine, but with increased power and flexibility. New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You simply define what causes the a rule to run, and then that you want it to do.

What Became of Rule, Trigger, Triggered Rule, Action and Schedule?

To explain the former Rule Machine 3.0 and earlier concepts of Rule, Trigger, Triggered Rule, Actions and Schedule versus how rule automation is now accomplished, as well as how Button Controller is now incorporated, we need to first address the primary differences.

  1. What was a Trigger is now the basic format for all rules.
    • The user selects Trigger Events and define actions.
  2. Formerly, an Action always required a Trigger Event, but it is now possible to omit a Trigger Events and only define actions. However, such a rule must to be run by some other rule or from the Rule Machine API.
  3. The previous Schedule event, is now available as a new type of Trigger Event named Days of Week Schedule.
  4. The previous Button Controller app is fully incorporated as a new type of Trigger Event named Button Device. Once a Button Device is selected, the same user interface of the former Button Controller 3.0 is presented to define actions for any of the buttons available on the selected device. However, unlike the previous Button Controller app, these actions have full access to conditional logic and global variables.

Change in logic for Rule-4.0 rule

In any Rule, the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the condition was True for the IF part or the rule, then Actions for True are run, and if they are False, then Actions for False are run. In Rule-4.0, this same logic can now simply be done with the Conditional Actions of IF-THEN and ELSE in the Actions section of a rule. As described in the next section, IF-THEN now has the same full logical expression capability previously available, with the addition of AND, OR, XOR, NOT logical operators, and nested parenthetical sub-expressions.

  • Example: Using a Trigger Event such as a contact sensor Front Door *changed* to illustrate the difference, the previous Rule Machine version used this to interpret the Condition of Front Door *open*. The rule was evaluated whenever any event happened for the Front Door. In Rule-4.0, this is explicit, whereas in previous versions the rule was Front Door *open*, we now make that event the Condition of an IF-THEN action. What were formerly Actions for True, now become the Actions following IF-THEN, and the former Actions for False become the actions following ELSE. Most Rules will now follow this basic format.

Former Rule Truth and Cancel on Truth Change

There are two subtle differences of Rule-3.0 that have now changed in Rule-4.0. The concept of a Rule Truth is gone in Rule 4.0 and is instead now explicit in the way you write the Actions for a rule. If you don't want the Actions of a Rule-4.0 rule to run unless there has been a change, which previously would have been the same as a change in Rule Truth of a 3.0 Rule, you can do that explicitly using a Private Boolean.

For example, If a motion sensor becomes active, a Private Boolean can be also set to False, with a delay before returning to True. The can be built so the lights will not be turned on again until the full delay timer has run its course and the lights have been turned off. When that happens, Private Boolean is set to True, and the whole cycle can repeat.

What about Triggered Rules?

All "Rules" in Rule-4.0 are in effect Triggered Rules. They each have a Trigger Event, and then Conditional Actions. Instead of a rule with Actions for True and Actions for False, they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.

Events

Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.

Events are created by the devices or conditions in your system. Each device creates events appropriate to the type of device. A Trigger Event listens for specific events and when a trigger receives a selected event, it causes the defined Actions to run.

Rule Machine allows the following events in a Hubitat Elevation® system to be acted upon. Each event results in a single test and the supported events and states that can be tested are listed below. For each event that refers to a device, one or more devices can be selected, and then the device state required for the Condition to be met can be selected. When multiple devices are selected, the Condition/Event may apply for ANY (default) or ALL of the devices.

Acceleration:	            active / inactive
Battery: 		    value
Button:                     pressed / held / doubleTapped / released
Button Device:              select actions for any buttons of a button device
Certain Time:               at a certain time, including sunrise / sunset with offset
Cloud End Point:            hitting URL fires
Contact:		    open / closed
Days of Week Schedule:      at certain time on certain days of the week
Dimmer level: 	            value
Door: 			    open, closed, opening, closing, unknown
Energy meter:	            value
Garage door: 	            open, closed, opening, closing, unknown
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  
                            smoke, water, rule, arming, armingHome, armingNight, cancel
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed
Humidity:		    value
Illuminance:	            value
Local End Point:            hitting URL fires
Lock:			    locked / unlocked
Mode:			    any of your hub's modes
Motion:			    active / inactive
Music player: 	            playing, paused, stopped
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly
Physical dimmer level:      value     
Physical switch:            on / off
Power meter:	            value
Power source:               mains / battery
Presence:		    present / not present or arrives / leaves
Private Boolean: 	    true / false
Rule truth: 		    true / false
Smoke detector:             clear, detected, tested
Switch:			    on / off
Temperature:		    value
Thermostat mode: 	    heat / cool / auto / off / emergency heat
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool
Variable:                   value
Water sensor: 		    dry / wet

Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset, or changed, increased, decreased

Actions

Actions are the portion of a rule that defines what the rule does when it is triggered to run.

Actions as ordered script

As you define actions, you are creating a script of actions to perform when the rule runs. Instead of only being able to have a single action for turning on switches as in the former Rule Machine® versions, you can now have as many actions as you want for each Action type and they can be run in whatever order you want. There is no predefined order of execution for Rule Machine® actions, so you may arrange the order of actions any way you want. You can insert a new action anywhere in the list of actions, or at the end of the list.

Actions can be edited

The Rule-4.0 user interface provides the ability to Edit or Delete any action you have defined, giving you complete control over your list of actions.

RM 4 edit and delete actions.png

Delay per action and Delay (Pause) all actions

There were three types of delays first introduced starting with Rule-3.0

  1. Each individual Action can have its own delay, which may also include a Cancel on Truth Change option.
  2. All actions can be delayed, effectively pausing the action execution for a specified amount of time.
  3. All actions can also be delayed for a period of time that is dependent on the current Mode (i.e. Delay Actions Per Mode).

Delay per action

Each action you define can have an optional delay. These delays can be defined with hours, minutes, and seconds. Seconds can have decimal fractions, allowing millisecond resolution. In a rule, delays can have the option to be cancelled in the event of a change of rule truth. It is important to realize that the delay assigned to an individual action affects only that action, and not subsequent actions. Any subsequent action is executed immediately after the delayed action starts its delay timer, and does not wait for that delay timer to run. When the delay timer expires, the delayed action is executed (unless the delay was cancelled).

Delay all actions

It is also possible to delay all actions (also with optional cancel). The script of actions runs sequentially when the rule runs, with each action happening in order. Actions with delays start their timer, which can vary for each action, and the next action in order runs. By using Delay Actions, the entire script can be paused by a delay. This feature can also be specified on a per mode basis, so that the time the script is paused varies according to the current mode.

As a consequence of these new features, some of the actions from Rule 2.5 and earlier were not included in Rule-3.0 and Rule-4.0. Specifically, those actions which incorporated a delay, or a delay with cancel, are no longer included, since in Rule-3.0 and Rule-4.0, every Action may incorporate a delay.

Rule-4.0 Conditional Actions and Logical Expressions

Starting with Rule-4.0, IF-THEN-ELSE-ENDIF conditional blocks can be nested. The user interface utilizes textual indentation to help guide you in keeping track of which IF-THEN-ELSE-ENDIF block you are currently adding actions to. The user is responsible for completing each level of nested IF-THEN blocks.

The condition of an IF-THEN or ELSE-IF Action can be a full logical expression built-up from individual conditions, and the logical operators AND, OR, XOR, and NOT. Parenthesized sub-expressions are also possible. This is the same user interface of the former rule portion found in Rule or Triggered Rule from Rule-3.0. An individual Condition can be created on the fly while defining a logical expression. Every such Condition is kept in the list of available Conditions. This list of available conditions is present in the Define Actions page. The user interface then allows Creating, Editing and Deleting conditions. If a condition is edited, those changes will be reflected where it is used in an IF-THEN or ELSE-IF conditional action.

This combination of nested IF-THEN blocks and full logical expression for each IF-THEN and ELSE-IF, allows creativity for rules in Rule-4.0 that is limited only by your imagination. To help you with complex logic structures, new actions are available.

  1. Exit Rule - With Exit Rule the execution of Actions for that rule will stop, irrespective of what order in the rule it exists.
  2. Pending Delays are not cancelled, and current Repetitions are not stopped by Exit Rule, but these can be managed separately if needed with Stop Repeating Actions, Stop Rule Actions, and Cancel Delayed Actions, where appropriate.

Automatic Condition Creation

When Event Triggers are defined, corresponding conditions are created for most types. Some conditions, like Button, Certain Time, etc, do not have a state and so have no corresponding condition. These created conditions are available in the Define Actions page for use in Conditional Actions, are available for use in other Actions, and can be edited.

IF-THEN-ELSE

You can introduce conditional execution of actions using the following method.

IF (condition) THEN 
     some actions...
ELSE-IF (condition) THEN 
     some actions...
ELSE 
     some actions...
END-IF  

IF-THEN and ELSE-IF both accept a logical expression as described above and IF-THEN-ELSE may also be nested. If the expression on the IF portion is True, then those actions following IF and before any ELSE-IF or ELSE statements will be carried out. If the expression is False, then those actions are skipped, and the ELSE portion or ELSE-IF are carried out. In the case of ELSE-IF, its expression will be tested, and the following Actions that follow it will either run or will not run, depending on the result of the evaluation. There can be as many ELSE-IF sections as you need, and the ELSE-IF and ELSE portions are both are optional. END-IF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. However, for good rule structure, just a sentence should have a period at the end, it is strongly recommended that you use END-IF to complete an IF-THEN-ELSE as a regular practice.

Repeat Actions

Portions of, or all of the script of an Action can be repeated periodically, but you must specify the time interval for the repetition. Be careful not to make this interval too short, as you can consume your hub CPU resources by repeating too quickly. You can select any number of iterations if desired, but some method to stop the repetition is required. When a Repeat Actions is introduced to the script, any action before END-REP will be repeated. Only the Actions between Repeat Actions and END-REP will be repeated. Actions following END-REP will run only once the repetition has stopped. There is an optional Stop for a Repeat Action choice and if selected, then Stop Repeating Actions will stop this repetition. Using Stop Rule Actions from either the current rule or another rule, will stop all Repeat Actions, irrespective of which Stop selection is used.

Repeat Actions
     some actions...
END-REP

A Repeat Actions, like any action, can have a condition specified. If the condition is False, the Repeat Actions block will not be executed. If the condition becomes False during repetition, the repetition will be stopped (with the exception of when Repeat N Times is selected). This provides three features well known to computer programmers.

  1. While-loop - The while-loop runs only if the condition is true, and stops if it is false.
  2. For-loop - A for-loop runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; The condition is not retested during iteration.
  3. Repeat-until loop - A repeat-until loop runs until a condition becomes true, running at least once.

Examples:

While loop - repeat while the condition is True:

IF (condition) Repeat Actions
     some actions...
END-REP

For loop (repeat n times):

Repeat Actions n times
     some actions...
END-REP

Conditional For loop (repeat n times if condition is True):

IF (condition) Repeat Actions n times
     some actions...
END-REP

Repeat-Until loop:

Repeat Actions with Stop selected
     some actions
    IF (condition) Stop Repeating Actions
END-REP

Repeat Actions cannot be nested. END-REP is optional, and if omitted, all actions after Repeat Actions will be repeated.

  • Note: The END-REP does not have anything to do with the when a Repeated Action will stop repeating, it merely marks the end of the list of actions to be repeated. If you use Repeat These Actions without specifying N Times (for loop), and without a Condition (while loop), and also without a Conditional Stop or a Stop on Truth Change (for rules only), that means it should repeat forever, and that is probably not what you want to have happen. In that case, some other rule would need to cause the repetition to stop.

Wait for Events and Wait for Condition

Wait for Events pauses rule execution until some specified event occurs. Multiple events can be defined to cause the wait to end. In effect, this introduces another trigger-like capability into the Actions. There is also an event type specifically for Wait for Events named Elapsed Time. When the Elapsed Time expires, the wait will be over, irrespective of other events it may be waiting for.

Wait for Condition is similar to Wait for Events, but instead a Condition is evaluated. If the condition is true, no wait occurs, otherwise the rule execution is paused until the condition is met. Wait for Events and Wait for Condition may both be used in a Simple Conditional Action. Additionally, both pending Wait for Events and Wait for Condition will be cancelled each time a rule is triggered, and can be also cancelled by another rule with Stop Rule Actions, or by a Cancel Wait action (which presumably would have been part of a Delayed Action).

Custom Actions

Custom Commands formerly available in Rule 3.0 are now replaced with Custom Actions. A Custom Action allows you to select a device, and send any of the commands that device supports along with parameters it may take. While the former Custom Commands need to be pre-defined and were available to all rules, a Custom Action is created within your actions and is specific to the rule where it is created.

Global Variables

Global Variables are now displayed on the Rule Machine main page. When creating a Global Variable, it must first be initialized. Global Variable values can also be changed in Rule Machine.

  • NOTE: Manage your global variables with some care to avoid problems. When a Global Variable is deleted, a warning is given if the variable is in use, and if deleted anyway, they will be removed from the rule for which they were in use and this removal may leave a rule with missing portions.
    • Conditions based on variables will also be removed, which in turn may erase the rule definition.
    • Actions that set variables will be removed and Actions with dimmers/bulbs set by variables will have missing settings.
    • Global Variables used for comparisons will leave the comparison missing what is to be compared against.

Global Variables may be used for Level/Color

Global Variables can be used in actions that set dimmer or bulb levels, color temperature, or hue/saturation values. To use a variable in this way, include it with %global-variable-name%. In each case only a Number Global Variable is allowed, and it is not range checked

Global Variables can be set by endpoint

A string Global Variable can be set by an endpoint trigger. This is an addition to the Rule Machine API

Global Variables can be used with parameters for Custom Actions

A Global Variable can be used with parameters by using %global-variable-name%.

Global Variables in messages

To include the value of a Global Variable in a message string (or HTTP request URL or body), you would use %global-variable-name%.

Run Actions from the Rule-4.0 User Interface

When you first create a new rule, you are creating a child app of the parent Rule Machine app, and therefor you must select Done on the main page to install the Rule-4.0 rule. If you re-open the rule, its actions can be run by hitting Run Actions button. If you change the Trigger Events in any way, you must either select Done or the Update Rule button.

Rule Logging

You can select which types of logging you want to see in Logs. This is a very good way to determine exactly what a rule is doing.

List of Actions

  Conditional Actions 
	  IF (conditions) THEN
	  ELSE-IF (conditions) THEN
	  ELSE
	  END-IF
	  Simple Conditional Action
  Control Switches, Push Buttons 
	  Turn switches on
	  Turn switches off
	  Toggle switches
	  Flash switches
	  Set switches per mode
	  Push a button
	  Push a button per mode
  Set Dimmers and Bulbs 
	  Set dimmer level
	  Toggle dimmer level
	  Adjust dimmer level
	  Set dimmer level per mode
	  Fade dimmer level over time
	  Start raising dimmer level
	  Start lowering dimmer level
	  Stop changing dimmer level
	  Set color and level
	  Toggle color and level
	  Set color and level per mode
	  Set color temperature and level
	  Toggle color temperature and level
	  Set color temperature and level per mode
  Activate Scenes, Adjust Shades or Fans 
	  Activate scenes
	  Activate scenes per mode
	  Open shades
	  Close shades
	  Set shade position
	  Set fan speed
	  Cycle fans
  Control HSM, Garage Doors, Locks or Valves 
	  Arm/Disarm Hubitat® Safety Monitor
	  Open garage door
	  Close garage door
	  Lock locks
	  Unlock locks
	  Open valves
	  Close valves
  Control Thermostats or Thermostat Scheduler 
	  Set thermostats
	  Set Thermostat Scheduler
  Send or Speak a Message, Send HTTP Request 
	  Send or Speak a Message
	  Send HTTP Get
	  Send HTTP Post
  Control Music Player, Sounds 
	  Control Music Player
	  Sound Tone
	  Sound Chime
	  Control Siren
  Set Mode or Global Variables, Run Custom Action 
	  Set Mode
	  Set Global Variable
	  Run Custom Action
  Set Private Boolean, Run/Stop/Pause Rules 
	  Set Private Booleans True
	  Set Private Booleans False
	  Run Rule Actions
	  Stop Rule Actions
	  Pause Rules
	  Resume Rules
  Capture/Restore, Device Refresh or Polling 
	  Capture Devices
	  Restore Devices
	  Refresh devices
	  Poll devices
	  Start Z-Wave poll on switches
	  Stop Z-Wave poll on switches
	  Start Z-Wave poll on dimmers
	  Stop Z-Wave poll on dimmers
  Delay or Repeat Actions, Wait 
	  Delay Actions
	  Delay Actions Per Mode
	  Cancel Delayed Actions
	  Repeat Actions
          End Repetition
	  Stop Repeating Actions
	  Wait for Events
	  Wait for Condition
	  Cancel Wait
	  Exit Rule

Exit Rule