<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.hubitat.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bravenel</id>
	<title>Hubitat Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.hubitat.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bravenel"/>
	<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Special:Contributions/Bravenel"/>
	<updated>2026-04-30T06:52:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Driver_Capability_List&amp;diff=5239</id>
		<title>Driver Capability List</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Driver_Capability_List&amp;diff=5239"/>
		<updated>2021-10-10T20:49:32Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: /* WindowBlind */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Top}}&lt;br /&gt;
Capabilities that can be used in drivers&lt;br /&gt;
&lt;br /&gt;
== AccelerationSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.accelerationSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;AccelerationSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;acceleration&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;inactive&amp;quot;, &amp;quot;active&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Actuator ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.actuator&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Actuator&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== AirQuality ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.airQuality&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;AirQuality&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;airQualityIndex&amp;lt;/code&amp;gt;''' - NUMBER, range:0..500&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Alarm ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.alarm&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Alarm&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;alarm&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;strobe&amp;quot;, &amp;quot;off&amp;quot;, &amp;quot;both&amp;quot;, &amp;quot;siren&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;both()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;siren()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;strobe()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== AudioNotification ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.audioNotification&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;AudioNotification&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playText(text, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Text to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTextAndRestore(text, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Text to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTextAndResume(text, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Text to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTrack(trackuri, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTrackAndRestore(trackuri, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTrackAndResume(trackuri, volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to play&lt;br /&gt;
::''volumelevel'' optional (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
&lt;br /&gt;
== AudioVolume ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.audioVolume&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;AudioVolume&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unmuted&amp;quot;, &amp;quot;muted&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volume&amp;lt;/code&amp;gt;''' - NUMBER, unit:%&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setVolume(volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''volumelevel'' required (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;unmute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeDown()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeUp()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Battery ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.battery&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Battery&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;battery&amp;lt;/code&amp;gt;''' - NUMBER, unit:% &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Beacon ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.beacon&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Beacon&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;presence&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;not present&amp;quot;, &amp;quot;present&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Bulb ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.bulb&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Bulb&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Button (Deprecated) ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.button&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Button&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;button&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;holdableButton&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;true&amp;quot;, &amp;quot;false&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;numberOfButtons&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== CarbonDioxideMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.carbonDioxideMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;CarbonDioxideMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;carbonDioxide&amp;lt;/code&amp;gt;''' - NUMBER, unit:ppm &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== CarbonMonoxideDetector ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.carbonMonoxideDetector&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;CarbonMonoxideDetector &amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;carbonMonoxide&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;clear&amp;quot;, &amp;quot;tested&amp;quot;, &amp;quot;detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ChangeLevel ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.changeLevel&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ChangeLevel&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;startLevelChange(direction)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''direction'' required (ENUM) - Direction for level change request&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stopLevelChange()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Chime ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.chime&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Chime&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;soundEffects&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;soundName&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;playing&amp;quot;, &amp;quot;stopped&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playSound(soundnumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''soundnumber'' required (NUMBER) - Sound number to play&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ColorControl ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.colorControl&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ColorControl&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;RGB&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;colorName&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;hue&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;saturation&amp;lt;/code&amp;gt;''' - NUMBER, unit:% &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setColor(colormap)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''colormap'' required (COLOR_MAP) - Color map settings [hue*:(0 to 100), saturation*:(0 to 100), level:(0 to 100)]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setHue(hue)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''hue'' required (NUMBER) - Color Hue (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setSaturation(saturation)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''saturation'' required (NUMBER) - Color Saturation (0 to 100)&lt;br /&gt;
&lt;br /&gt;
== ColorMode ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.colorMode&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ColorMode&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;colorMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;CT&amp;quot;, &amp;quot;RGB&amp;quot;, &amp;quot;EFFECTS&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ColorTemperature ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.colorTemperature&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ColorTemperature&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;colorName&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;colorTemperature&amp;lt;/code&amp;gt;''' - NUMBER, unit:°K &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setColorTemperature(colortemperature, level, transitionTime)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''colortemperature'' required (NUMBER) - Color temperature in degrees Kelvin&lt;br /&gt;
::''level'' optional (NUMBER) - level to set&lt;br /&gt;
::''transitionTime'' optional (NUMBER) - transition time to use in seconds&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.configuration&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Configuration&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;configure()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Consumable ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.consumable&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Consumable&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;consumableStatus&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;missing&amp;quot;, &amp;quot;order&amp;quot;, &amp;quot;maintenance_required&amp;quot;, &amp;quot;good&amp;quot;, &amp;quot;replace&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setConsumableStatus(STRING)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
&lt;br /&gt;
== ContactSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.contactSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ContactSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;contact&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;closed&amp;quot;, &amp;quot;open&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== CurrentMeter ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.currentMeter&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;CurrentMeter&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;amperage&amp;lt;/code&amp;gt;''' - NUMBER, unit:A&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== DoorControl ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.doorControl&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;DoorControl&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;door&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unknown&amp;quot;, &amp;quot;closed&amp;quot;, &amp;quot;open&amp;quot;, &amp;quot;closing&amp;quot;, &amp;quot;opening&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;close()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;open()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== DoubleTapableButton ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.doubleTapableButton&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;DoubleTapableButton&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;doubleTapped&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;doubleTap(buttonNumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''buttonNumber'' required (NUMBER)&lt;br /&gt;
&lt;br /&gt;
== EnergyMeter ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.energyMeter&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;EnergyMeter&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;energy&amp;lt;/code&amp;gt;''' - NUMBER, unit:kWh &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== EstimatedTimeOfArrival ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.estimatedTimeOfArrival&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;EstimatedTimeOfArrival&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;eta&amp;lt;/code&amp;gt;''' - DATE &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== FanControl ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.fanControl&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;FanControl&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;low&amp;quot;,&amp;quot;medium-low&amp;quot;,&amp;quot;medium&amp;quot;,&amp;quot;medium-high&amp;quot;,&amp;quot;high&amp;quot;,&amp;quot;on&amp;quot;,&amp;quot;off&amp;quot;,&amp;quot;auto&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;supportedFanSpeeds&amp;lt;/code&amp;gt;''' - JSON_OBJECT&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setSpeed(fanspeed)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''fanspeed'' required (ENUM) - Fan speed to set&lt;br /&gt;
:'''&amp;lt;code&amp;gt;cycleSpeed()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== FilterStatus ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.filterStatus&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;FilterStatus&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;filterStatus&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;normal&amp;quot;, &amp;quot;replace&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Flash ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.flash&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Flash&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;flash(rateToFlash)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''rateToFlash'' optional (NUMBER) Rate to flash in ms&lt;br /&gt;
&lt;br /&gt;
== GarageDoorControl ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.garageDoorControl&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;GarageDoorControl&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;door&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unknown&amp;quot;, &amp;quot;open&amp;quot;, &amp;quot;closing&amp;quot;, &amp;quot;closed&amp;quot;, &amp;quot;opening&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;close()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;open()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== GasDetector ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.gasDetector&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;GasDetector&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;naturalGas&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;clear&amp;quot;, &amp;quot;tested&amp;quot;, &amp;quot;detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== HealthCheck ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.healthCheck&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;HealthCheck&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;checkInterval&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;ping()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== HoldableButton ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.holdableButton&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;HoldableButton&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;held&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;hold(buttonNumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''buttonNumber'' required (NUMBER)&lt;br /&gt;
&lt;br /&gt;
== IlluminanceMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.illuminanceMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;IlluminanceMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;illuminance&amp;lt;/code&amp;gt;''' - NUMBER, unit:lx &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ImageCapture ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.imageCapture&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ImageCapture&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;image&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;take()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Indicator ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.indicator&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Indicator&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;indicatorStatus&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;never&amp;quot;, &amp;quot;when on&amp;quot;, &amp;quot;when off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;indicatorNever()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;indicatorWhenOff()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;indicatorWhenOn()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Initialize ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.initialize&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Initialize&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;initialize()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== LevelPreset ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.levelPreset&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;LevelPreset&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;levelPreset&amp;lt;/code&amp;gt;''' - NUMBER, unit:%, range:1..100&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;presetLevel(level)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''level'' required (NUMBER) - Level to preset (1 to 100)&lt;br /&gt;
&lt;br /&gt;
== Light ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.light&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Light&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== LightEffects ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.lightEffects&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;LightEffects&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;effectName&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;lightEffects&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setEffect(effectnumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''effectnumber'' required (NUMBER) - Effect number to enable&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setNextEffect()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setPreviousEffect()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== LiquidFlowRate ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.liquidFlowRate&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;LiquidFlowRate&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;rate&amp;lt;/code&amp;gt;''' - NUMBER, unit:LPM || GPM&lt;br /&gt;
&lt;br /&gt;
== LocationMode ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.locationMode&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;LocationMode&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mode&amp;lt;/code&amp;gt;''' - DYNAMIC_ENUM &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Lock ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.lock&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Lock&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;lock&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;locked&amp;quot;, &amp;quot;unlocked with timeout&amp;quot;, &amp;quot;unlocked&amp;quot;, &amp;quot;unknown&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;lock()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;unlock()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== LockCodes ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.lockCodes&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;LockCodes&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;codeChanged&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;added&amp;quot;, &amp;quot;changed&amp;quot;, &amp;quot;deleted&amp;quot;, &amp;quot;failed&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;codeLength&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;lockCodes&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;maxCodes&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;deleteCode(codeposition)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''codeposition'' required (NUMBER) - Code position number to delete&lt;br /&gt;
:'''&amp;lt;code&amp;gt;getCodes()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCode(codeposition, pincode, name)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''codeposition'' required (NUMBER) - Code position number&lt;br /&gt;
::''pincode'' required (STRING) - Numeric PIN code&lt;br /&gt;
::''name'' optional (STRING) - Name for this lock code&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCodeLength(pincodelength)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''pincodelength'' required (NUMBER) - Maximum pin code lentgh for this lock&lt;br /&gt;
&lt;br /&gt;
== MediaController ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.mediaController&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;MediaController&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;activities&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;currentActivity&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;getAllActivities()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;getCurrentActivity()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;startActivity(activityname)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''activityname'' required (STRING) - Name of media activity to start&lt;br /&gt;
&lt;br /&gt;
== MediaInputSource ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.mediaInputSource&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;MediaInputSource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;supportedInputs&amp;lt;/code&amp;gt;''' - JSON_OBJECT&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mediaInputSource&amp;lt;/code&amp;gt;''' - STRING&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setInputSource(inputName)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''inputName'' required (STRING) - Input to select&lt;br /&gt;
&lt;br /&gt;
== MediaTransport ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.mediaTransport&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;MediaTransport&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;transportStatus&amp;lt;/code&amp;gt;''' - ENUM - [&amp;quot;playing&amp;quot;, &amp;quot;paused&amp;quot;, &amp;quot;stopped&amp;quot;] &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pause()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Momentary ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.momentary&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Momentary&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;push()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== MotionSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.motionSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;MotionSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;motion&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;inactive&amp;quot;, &amp;quot;active&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== MusicPlayer ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.musicPlayer&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;MusicPlayer&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unmuted&amp;quot;, &amp;quot;muted&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;trackData&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;trackDescription&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;nextTrack()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pause()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;play()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playText(text)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Text to play&lt;br /&gt;
:'''&amp;lt;code&amp;gt;playTrack(trackuri)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to play&lt;br /&gt;
:'''&amp;lt;code&amp;gt;previousTrack()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;restoreTrack(trackuri)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to restore&lt;br /&gt;
:'''&amp;lt;code&amp;gt;resumeTrack(trackuri)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to play&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setLevel(volumelevel)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''volumelevel'' required (NUMBER) - Volume level (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setTrack(trackuri)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''trackuri'' required (STRING) - URI/URL of track to set&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;unmute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Notification ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.notification&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Notification&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;deviceNotification(text)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Notification text&lt;br /&gt;
&lt;br /&gt;
== Outlet ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.outlet&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Outlet&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Polling ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.polling&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Polling&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;poll()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== PowerMeter ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.powerMeter&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;PowerMeter&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;power&amp;lt;/code&amp;gt;''' - NUMBER, unit:W &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== PowerSource ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.powerSource&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;PowerSource&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;powerSource&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;battery&amp;quot;, &amp;quot;dc&amp;quot;, &amp;quot;mains&amp;quot;, &amp;quot;unknown&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== PresenceSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.presenceSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;PresenceSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;presence&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;present&amp;quot;, &amp;quot;not present&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== PressureMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.pressureMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;PressureMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pressure&amp;lt;/code&amp;gt;''' - NUMBER, unit: Pa || psi&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== PushableButton ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.pushableButton&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;PushableButton&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;numberOfButtons&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;pushed&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;push(buttonNumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''buttonNumber'' required (NUMBER)&lt;br /&gt;
&lt;br /&gt;
== Refresh ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.refresh&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Refresh&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;refresh()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== RelativeHumidityMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.relativeHumidityMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;RelativeHumidityMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;humidity&amp;lt;/code&amp;gt;''' - NUMBER, unit:%rh &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== RelaySwitch ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.relaySwitch&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;RelaySwitch&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ReleasableButton ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.releasableButton&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ReleasableButton&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;released&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;release(buttonNumber)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''buttonNumber'' required (NUMBER)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SamsungTV ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.samsungTV&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SamsungTV&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;messageButton&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;muted&amp;quot;, &amp;quot;unknown&amp;quot;, &amp;quot;unmuted&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pictureMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unknown&amp;quot;, &amp;quot;standard&amp;quot;, &amp;quot;movie&amp;quot;, &amp;quot;dynamic&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;soundMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;speech&amp;quot;, &amp;quot;movie&amp;quot;, &amp;quot;unknown&amp;quot;, &amp;quot;standard&amp;quot;, &amp;quot;music&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volume&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setPictureMode(ENUM)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''ENUM''  (ENUM) - ENUM&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setSoundMode(ENUM)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''ENUM''  (ENUM) - ENUM&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setVolume(NUMBER)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''NUMBER''  (NUMBER) - NUMBER&lt;br /&gt;
:'''&amp;lt;code&amp;gt;showMessage(STRING, STRING, STRING, STRING)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
:'''&amp;lt;code&amp;gt;unmute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeDown()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeUp()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SecurityKeypad ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.securityKeypad&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SecurityKeypad&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;codeChanged&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;added&amp;quot;, &amp;quot;changed&amp;quot;, &amp;quot;deleted&amp;quot;, &amp;quot;failed&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;codeLength&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;lockCodes&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;maxCodes&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;securityKeypad&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;disarmed&amp;quot;, &amp;quot;armed home&amp;quot;, &amp;quot;armed away&amp;quot;, &amp;quot;unknown&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;armAway()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;armHome()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;deleteCode(codeposition)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''codeposition'' required (NUMBER) - Code position number to delete&lt;br /&gt;
:'''&amp;lt;code&amp;gt;disarm()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;getCodes()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCode(codeposition, pincode, name)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''codeposition'' required (NUMBER) - Code position number&lt;br /&gt;
::''pincode'' required (STRING) - Numeric PIN code&lt;br /&gt;
::''name'' optional (STRING) - Name for this lock code&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCodeLength(pincodelength)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''pincodelength'' required (NUMBER) - Maximum pin code lentgh for this keypad&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setEntryDelay(entrancedelay)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''entrancedelay'' required (NUMBER) - Entrance delay in seconds&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setExitDelay(exitdelay)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''exitdelay'' required (NUMBER) - Exit delay in seconds&lt;br /&gt;
&lt;br /&gt;
== Sensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.sensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Sensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ShockSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.shockSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ShockSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;shock&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;clear&amp;quot;, &amp;quot;detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SignalStrength ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.signalStrength&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SignalStrength&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;lqi&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;rssi&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SleepSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.sleepSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SleepSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;sleeping&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;not sleeping&amp;quot;, &amp;quot;sleeping&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SmokeDetector ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.smokeDetector&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SmokeDetector&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;smoke&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;clear&amp;quot;, &amp;quot;tested&amp;quot;, &amp;quot;detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SoundPressureLevel ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.soundPressureLevel&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SoundPressureLevel&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;soundPressureLevel&amp;lt;/code&amp;gt;''' - NUMBER, unit:dB &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SoundSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.soundSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SoundSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;sound&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;detected&amp;quot;, &amp;quot;not detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SpeechRecognition ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.speechRecognition&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SpeechRecognition&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;phraseSpoken&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SpeechSynthesis ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.speechSynthesis&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SpeechSynthesis&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;speak(text, volume, voice)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''text'' required (STRING) - Text to speak&lt;br /&gt;
::''volume'' optional (NUMBER)&lt;br /&gt;
::''voice'' optional (STRING) - AWS Polly voice name&lt;br /&gt;
&lt;br /&gt;
== StepSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.stepSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;StepSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;goal&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;steps&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Switch ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.switch&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Switch&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== SwitchLevel ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.switchLevel&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;SwitchLevel&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;''' - NUMBER, unit:% &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setLevel(level, duration)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''level'' required (NUMBER) - Level to set (0 to 100)&lt;br /&gt;
::''duration'' optional (NUMBER) - Transition duration in seconds&lt;br /&gt;
&lt;br /&gt;
== TV ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.tv&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TV&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;channel&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
:'''&amp;lt;code&amp;gt;movieMode&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;picture&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;power&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;sound&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;volume&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;channelDown()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;channelUp()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeDown()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;volumeUp()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== TamperAlert ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.tamperAlert&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TamperAlert&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;tamper&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;clear&amp;quot;, &amp;quot;detected&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Telnet ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.telnet&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Telnet&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;networkStatus&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;online&amp;quot;, &amp;quot;offline&amp;quot;]&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;sendMsg(message)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''message'' required (STRING) - Text message to send&lt;br /&gt;
&lt;br /&gt;
== TemperatureMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.temperatureMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TemperatureMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== TestCapability ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.testCapability&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TestCapability&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Thermostat ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostat&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Thermostat&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;coolingSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
:'''&amp;lt;code&amp;gt;heatingSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
:'''&amp;lt;code&amp;gt;schedule&amp;lt;/code&amp;gt;''' - JSON_OBJECT '''(Deprecated)'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;supportedThermostatFanModes&amp;lt;/code&amp;gt;''' - JSON_OBJECT&lt;br /&gt;
:'''&amp;lt;code&amp;gt;supportedThermostatModes&amp;lt;/code&amp;gt;''' - JSON_OBJECT&lt;br /&gt;
:'''&amp;lt;code&amp;gt;temperature&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatFanMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;circulate&amp;quot;, &amp;quot;auto&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;auto&amp;quot;, &amp;quot;off&amp;quot;, &amp;quot;heat&amp;quot;, &amp;quot;emergency heat&amp;quot;, &amp;quot;cool&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatOperatingState&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;heating&amp;quot;, &amp;quot;pending cool&amp;quot;, &amp;quot;pending heat&amp;quot;, &amp;quot;vent economizer&amp;quot;, &amp;quot;idle&amp;quot;, &amp;quot;cooling&amp;quot;, &amp;quot;fan only&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;auto()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;cool()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;emergencyHeat()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanAuto()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanCirculate()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanOn()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;heat()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCoolingSetpoint(temperature)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''temperature'' required (NUMBER) - Cooling setpoint in degrees&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setHeatingSetpoint(temperature)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''temperature'' required (NUMBER) - Heating setpoint in degrees&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setSchedule(JSON_OBJECT)&amp;lt;/code&amp;gt;'''  '''(Deprecated)'''&lt;br /&gt;
::''JSON_OBJECT''  (JSON_OBJECT) - JSON_OBJECT  '''(Deprecated)'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setThermostatFanMode(fanmode)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''fanmode'' required (ENUM) - Fan mode to set&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setThermostatMode(thermostatmode)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''thermostatmode'' required (ENUM) - Thermostat mode to set&lt;br /&gt;
&lt;br /&gt;
== ThermostatCoolingSetpoint ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatCoolingSetpoint&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatCoolingSetpoint&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;coolingSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setCoolingSetpoint(temperature)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''temperature'' required (NUMBER) - Cooling setpoint in degrees&lt;br /&gt;
&lt;br /&gt;
== ThermostatFanMode ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatFanMode&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatFanMode&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatFanMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;auto&amp;quot;, &amp;quot;circulate&amp;quot;, &amp;quot;on&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanAuto()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanCirculate()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;fanOn()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setThermostatFanMode(fanmode)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''fanmode'' required (ENUM) - Fan mode to set&lt;br /&gt;
&lt;br /&gt;
== ThermostatHeatingSetpoint ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatHeatingSetpoint&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatHeatingSetpoint&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;heatingSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setHeatingSetpoint(temperature)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''temperature'' required (NUMBER) - Heating setpoint in degrees&lt;br /&gt;
&lt;br /&gt;
== ThermostatMode ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatMode&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatMode&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatMode&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;heat&amp;quot;, &amp;quot;cool&amp;quot;, &amp;quot;emergency heat&amp;quot;, &amp;quot;auto&amp;quot;, &amp;quot;off&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;auto()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;cool()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;emergencyHeat()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;heat()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setThermostatMode(thermostatmode)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''thermostatmode'' required (ENUM) - Thermostat mode to set&lt;br /&gt;
&lt;br /&gt;
== ThermostatOperatingState ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatOperatingState&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatOperatingState&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatOperatingState&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;vent economizer&amp;quot;, &amp;quot;pending cool&amp;quot;, &amp;quot;cooling&amp;quot;, &amp;quot;heating&amp;quot;, &amp;quot;pending heat&amp;quot;, &amp;quot;fan only&amp;quot;, &amp;quot;idle&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ThermostatSchedule ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatSchedule&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatSchedule&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;schedule&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setSchedule(JSON_OBJECT)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''JSON_OBJECT''  (JSON_OBJECT) - JSON_OBJECT&lt;br /&gt;
&lt;br /&gt;
== ThermostatSetpoint ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.thermostatSetpoint&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThermostatSetpoint&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;thermostatSetpoint&amp;lt;/code&amp;gt;''' - NUMBER, unit:°F || °C  &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ThreeAxis ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.threeAxis&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ThreeAxis&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;threeAxis&amp;lt;/code&amp;gt;''' - VECTOR3 &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== TimedSession ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.timedSession&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TimedSession&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;sessionStatus&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;stopped&amp;quot;, &amp;quot;canceled&amp;quot;, &amp;quot;running&amp;quot;, &amp;quot;paused&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;timeRemaining&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;cancel()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pause()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setTimeRemaining(NUMBER)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''NUMBER''  (NUMBER) - NUMBER&lt;br /&gt;
:'''&amp;lt;code&amp;gt;start()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stop()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Tone ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.tone&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Tone&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;beep()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== TouchSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.touchSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;TouchSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;touch&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;touched&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== UltravioletIndex ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.ultravioletIndex&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;UltravioletIndex&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;ultravioletIndex&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Valve ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.valve&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Valve&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;valve&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;open&amp;quot;, &amp;quot;closed&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;close()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;open()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== Variable ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.variable&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;Variable&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;variable&amp;lt;/code&amp;gt;''' - STRING&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setVariable(valueToSet)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''valueToSet'' required (STRING)&lt;br /&gt;
&lt;br /&gt;
== VideoCamera ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.videoCapture&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;VideoCamera&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;camera&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;on&amp;quot;, &amp;quot;off&amp;quot;, &amp;quot;restarting&amp;quot;, &amp;quot;unavailable&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;unmuted&amp;quot;, &amp;quot;muted&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;settings&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
:'''&amp;lt;code&amp;gt;statusMessage&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;flip()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;mute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;off()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;on()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;unmute()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== VideoCapture ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.videoCapture&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;VideoCapture&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;clip&amp;lt;/code&amp;gt;''' - JSON_OBJECT &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;capture(DATE, DATE, DATE)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''DATE''  (DATE) - DATE&lt;br /&gt;
::''DATE''  (DATE) - DATE&lt;br /&gt;
::''DATE''  (DATE) - DATE&lt;br /&gt;
&lt;br /&gt;
== VoltageMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.voltageMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;VoltageMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;voltage&amp;lt;/code&amp;gt;''' - NUMBER, unit:V&lt;br /&gt;
:'''&amp;lt;code&amp;gt;frequency&amp;lt;/code&amp;gt;''' - NUMBER, unit:Hz &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== WaterSensor ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.waterSensor&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;WaterSensor&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;water&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;wet&amp;quot;, &amp;quot;dry&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== WindowBlind ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.windowBlind&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;WindowBlind&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt;''' - NUMBER, unit:%&lt;br /&gt;
:'''&amp;lt;code&amp;gt;windowBlind&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;opening&amp;quot;, &amp;quot;partially open&amp;quot;, &amp;quot;closed&amp;quot;, &amp;quot;open&amp;quot;, &amp;quot;closing&amp;quot;, &amp;quot;unknown&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;tilt&amp;lt;/code&amp;gt;''' - NUMBER, unit:%&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;close()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;open()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setPosition(position)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''position'' required (NUMBER) - Shade position (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;startPositionChange(direction)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''direction'' required (ENUM) - Direction for position change request [&amp;quot;open&amp;quot;, &amp;quot;close&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stopPositionChange()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setTiltLevel(tilt)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''tilt'' required (NUMBER) - Tilt percent (0 to 100)&lt;br /&gt;
&lt;br /&gt;
== WindowShade ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.windowShade&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;WindowShade&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt;''' - NUMBER, unit:% &lt;br /&gt;
:'''&amp;lt;code&amp;gt;windowShade&amp;lt;/code&amp;gt;''' - ENUM [&amp;quot;opening&amp;quot;, &amp;quot;partially open&amp;quot;, &amp;quot;closed&amp;quot;, &amp;quot;open&amp;quot;, &amp;quot;closing&amp;quot;, &amp;quot;unknown&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;close()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;open()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;setPosition(position)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''position'' required (NUMBER) - Shade position (0 to 100)&lt;br /&gt;
:'''&amp;lt;code&amp;gt;startPositionChange(direction)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''direction'' required (ENUM) - Direction for position change request [&amp;quot;open&amp;quot;, &amp;quot;close&amp;quot;]&lt;br /&gt;
:'''&amp;lt;code&amp;gt;stopPositionChange()&amp;lt;/code&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
== ZwMultichannel ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.zwMultichannel&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;ZwMultichannel&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;epEvent&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
:'''&amp;lt;code&amp;gt;epInfo&amp;lt;/code&amp;gt;''' - STRING &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;enableEpEvents(STRING)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
:'''&amp;lt;code&amp;gt;epCmd(NUMBER, STRING)&amp;lt;/code&amp;gt;'''&lt;br /&gt;
::''NUMBER''  (NUMBER) - NUMBER&lt;br /&gt;
::''STRING''  (STRING) - STRING&lt;br /&gt;
&lt;br /&gt;
== pHMeasurement ==&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Device Selector&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability.pHMeasurement&amp;lt;/code&amp;gt;&lt;br /&gt;
'''&amp;lt;big&amp;gt;Driver Definition&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:&amp;lt;code&amp;gt;capability &amp;quot;pHMeasurement&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Attributes&amp;lt;/big&amp;gt;'''&lt;br /&gt;
:'''&amp;lt;code&amp;gt;pH&amp;lt;/code&amp;gt;''' - NUMBER &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;big&amp;gt;Commands&amp;lt;/big&amp;gt;'''&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Attribute_Object&amp;diff=3899</id>
		<title>Attribute Object</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Attribute_Object&amp;diff=3899"/>
		<updated>2021-03-16T18:27:27Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: /* Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Properties==&lt;br /&gt;
&lt;br /&gt;
:: id - Long: the unique id of this attribute.&lt;br /&gt;
:: version - Long: the database version of this attribute.&lt;br /&gt;
:: dataType - String: The type of data that is stored in this attribute, possible values are (ENUM, STRING, DYNAMIC_ENUM, JSON_OBJECT, NUMBER, DATE, VECTOR3).&lt;br /&gt;
:: name - String: the name of this attribute.&lt;br /&gt;
:: possibleValues - List&amp;lt;String&amp;gt;: a list of possible values for this attribute if dataType is ENUM.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
===&amp;lt;code&amp;gt;getValues&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
:;Signature&lt;br /&gt;
:: &amp;lt;code&amp;gt;List&amp;lt;String&amp;gt; getValues()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:;Parameters&lt;br /&gt;
:: none&lt;br /&gt;
&lt;br /&gt;
:;Returns&lt;br /&gt;
:: List&amp;lt;String&amp;gt; - the list of possible values for the attribute.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=3488</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=3488"/>
		<updated>2021-01-02T20:33:36Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 4.0&amp;lt;/h1&amp;gt;Rule-4.0 is the culmination of a journey in the transformation of the Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&lt;br /&gt;
===What Became of Rule, Trigger, Triggered Rule, Action and Schedule?===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#What was a '''Trigger''' is now the basic format for all rules.&lt;br /&gt;
#*The user selects '''Trigger Events''' and define actions.&lt;br /&gt;
#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.&lt;br /&gt;
#The previous Schedule event, is now available as a new type of Trigger Event named '''Days of Week Schedule'''.&lt;br /&gt;
#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.&lt;br /&gt;
&lt;br /&gt;
===Change in logic for Rule-4.0 rule===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
*'''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.&lt;br /&gt;
&lt;br /&gt;
===Former Rule Truth and Cancel on Truth Change===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
===What about Triggered Rules?===&lt;br /&gt;
All &amp;quot;Rules&amp;quot; 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.&lt;br /&gt;
===Events===&lt;br /&gt;
Each rule has one or more '''Trigger Events''' that when triggered, cause the rule's actions to run.&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Actions===&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
====Actions as ordered script====&lt;br /&gt;
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&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&lt;br /&gt;
====Actions can be edited====&lt;br /&gt;
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.&lt;br /&gt;
[[File:RM 4 edit and delete actions.png|link=https://docs.hubitat.com/File:RM%204%20edit%20and%20delete%20actions.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Delay per action and Delay (Pause) all actions====&lt;br /&gt;
There were three types of delays first introduced starting with Rule-3.0&lt;br /&gt;
&lt;br /&gt;
#Each individual '''Action''' can have its own delay, which may also include a '''Cancel on Truth Change''' option.&lt;br /&gt;
#All actions can be delayed, effectively pausing the action execution for a specified amount of time.&lt;br /&gt;
#All actions can also be delayed for a period of time that is dependent on the current '''Mode''' (i.e. '''Delay Actions Per Mode''').&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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 '''&amp;lt;u&amp;gt;the next action in order&amp;lt;/u&amp;gt;''' 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
===Rule-4.0 Conditional Actions and Logical Expressions===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#Exit Rule - With Exit Rule the execution of '''Actions''' for that rule will stop, irrespective of what order in the rule it exists.&lt;br /&gt;
#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''', '''Cancel Rule Timers''', and '''Cancel Delayed Actions''', where appropriate.&lt;br /&gt;
&lt;br /&gt;
====Automatic Condition Creation====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
====IF-THEN-ELSE====&lt;br /&gt;
You can introduce conditional execution of actions using the following method.&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
'''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.&lt;br /&gt;
===Repeat Actions===&lt;br /&gt;
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 '''Cancel Rule Timers''' from either the current rule or another rule, will stop '''&amp;lt;u&amp;gt;all Repeat Actions&amp;lt;/u&amp;gt;''', irrespective of which Stop selection is used.&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#While-loop - The '''while-loop''' runs only if the condition is true, and stops if it is false.&lt;br /&gt;
#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.&lt;br /&gt;
#Repeat-until loop - A repeat-until loop runs until a condition becomes true, running at least once.&lt;br /&gt;
&lt;br /&gt;
'''Examples:'''&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is True:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''Conditional For loop (repeat n times if condition is True):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions with Stop selected&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 END-REP&lt;br /&gt;
'''Repeat Actions''' cannot be nested.  '''END-REP''' is optional, and if omitted, all actions after '''Repeat Actions''' will be repeated.&lt;br /&gt;
&lt;br /&gt;
*'''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 &amp;lt;u&amp;gt;forever&amp;lt;/u&amp;gt;, 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.&lt;br /&gt;
&lt;br /&gt;
===Wait for Events and Wait for Condition===&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
'''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).&lt;br /&gt;
===Custom Actions===&lt;br /&gt;
'''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.&lt;br /&gt;
===Global Variables===&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
*'''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.&lt;br /&gt;
**'''Conditions''' based on variables will also be removed, which in turn may erase the rule definition.&lt;br /&gt;
**'''Actions''' that set variables will be removed and Actions with dimmers/bulbs set by variables will have missing settings.&lt;br /&gt;
**'''Global Variables''' used for comparisons will leave the comparison missing what is to be compared against.&lt;br /&gt;
&lt;br /&gt;
====Global Variables may be used for Level/Color====&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
====Global Variables can be set by endpoint====&lt;br /&gt;
A string Global Variable can be set by an endpoint trigger.  This is an addition to the [https://community.hubitat.com/t/rule-machine-api/7104 Rule Machine API]&lt;br /&gt;
&lt;br /&gt;
====Global Variables can be used with parameters for Custom Actions====&lt;br /&gt;
A Global Variable can be used with parameters by using '''%global-variable-name%'''.&lt;br /&gt;
&lt;br /&gt;
====Global Variables in messages====&lt;br /&gt;
To include the value of a Global Variable in a message string (or HTTP request URL or body), you would use '''%global-variable-name%'''.&lt;br /&gt;
===Run Actions from the Rule-4.0 User Interface===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Rule Logging===&lt;br /&gt;
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.&lt;br /&gt;
===List of Actions===&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
	  Change color temperature over time&lt;br /&gt;
	  Stop changing color temperature&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send, Speak, or Log a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Log a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Volume, Sounds&lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Set Volume&lt;br /&gt;
	  Mute&lt;br /&gt;
	  Unmute&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Cancel/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Cancel Rule Timers&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          END-REP&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Export, Import or Clone of Rule Machine Rules===&lt;br /&gt;
Select this option to allow export of your Rule Machine rules for import to another hub, or to clone an existing rule as a base from which to start a new rule.&lt;br /&gt;
[[File:Export Import and Clone RM rule v2.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Export a Rule====&lt;br /&gt;
&lt;br /&gt;
#Select a single or multiple rules for '''Export'''. You may export multiple rules to a single file, and still have the option to select which rules to later '''Import'''.[[File:Export Selected RM rules v2.png|none|thumb|600x600px]]&lt;br /&gt;
#Press the '''Download''' button to save the file to your local drive in the designated file download location for your browser. Typically this will be your '''Downloads''' folder.[[File:Export RM rule v2.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Restore or Import a Rule====&lt;br /&gt;
You may choose to '''Restore''' a rule instead of using the '''Import''' option. This is most appropriate for instances where you want to bring a Rule Machine rule into your hub database, but you do not want to change the name or the devices used in the rule. If you instead choose to '''Import''', the process will pause to allow the rule to be renamed, and the devices used in the rule to be substituted with other devices installed on your hub before completing the import process.&lt;br /&gt;
&lt;br /&gt;
'''Restore'''&lt;br /&gt;
&lt;br /&gt;
#To '''Restore''', select the saved file you previously exported, then press the '''Restore''' button.[[File:Restore RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
'''Import'''&lt;br /&gt;
&lt;br /&gt;
#To '''Import''', select the saved file you previously exported and press the '''Import...''' button.[[File:Import RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
#Select the rules for import.[[File:Selected RM rule for import.png|none|thumb|600x600px]]&lt;br /&gt;
#You will be prompted to replace the name and devices used in the rule if you need to.[[File:Rename and change RM devices before import.png|none|thumb|600x600px]]&lt;br /&gt;
#*'''NOTE:''' If you '''Import''' a rule to another hub without selecting replacement devices, any existing devices with those same names will be used in the imported rule. If the devices do not exist, virtual devices with those same names will automatically be created. This is very helpful when you need to replace devices of an imported rule, but do not yet have the devices available that will replace them.&lt;br /&gt;
#When ready to import, press the '''Import ['''rule name''']''' button.[[File:Rule Machine Import.png|none|thumb|600x600px]]&lt;br /&gt;
#You will receive a confirmation that the rule you selected has been imported.[[File:RM Import confirmation.png|none|thumb|600x600px]]&lt;br /&gt;
#If you changed the name, it will appear with the new name in your list of Rule Machine child apps.[[File:Show imported Rule Machine rules.png|none|thumb|600x600px]]&lt;br /&gt;
#*'''&amp;lt;span style=&amp;quot;color: red;;&amp;quot;&amp;gt;IMPORTANT!&amp;lt;/span&amp;gt;''' - If you import rules that contain a Private Boolean, it must be manually adjusted after importing the rule. In the following example, you will see that an imported rule will not keep the correct setting for Private Boolean after import, and therefore must be manually corrected.[[File:Cloning or imported rules containing PB.png|none|thumb|600x600px]][[File:Imported rule with PB not pointing anywhere.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Clone a Rule====&lt;br /&gt;
&lt;br /&gt;
#To '''Clone''' a rule, select the rule from the list of available Rule Machine rules on your hub and press the '''Clone''' button.[[File:Select Rule Machine rule for clone.png|none|thumb|600x600px]][[File:Initiate Rule Machine cloning.png|none|thumb|600x600px]]&lt;br /&gt;
#You will be prompted to replace the name and devices used in the rule if you need to.[[File:Rename and change RM devices before clone.png|none|thumb|600x600px]]&lt;br /&gt;
#When ready to proceed, press the '''Clone ['''rule name''']''' button.[[File:Clone Rule Machine rule.png|none|thumb|600x600px]]&lt;br /&gt;
#You will receive a confirmation that the rule you selected has been cloned.[[File:RM rule clone confirmation.png|none|thumb|600x600px]]&lt;br /&gt;
#If you changed the name, it will appear with the new name in your list of Rule Machine child apps. If you did not change the name, the rule will be imported under the same name, but it will have the word '''clone''' added to the end.[[File:Show cloned RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
#*&amp;lt;span style=&amp;quot;color: red;;&amp;quot;&amp;gt;'''IMPORTANT!'''&amp;lt;/span&amp;gt; If you '''Clone''' rules that contain a Private Boolean, it must be manually corrected after cloning the rule. In the following example, you will see that a cloned rule will not keep the correct setting for Private Boolean after import, and therefore must be manually corrected.[[File:Cloning or imported rules containing PB.png|none|thumb|600x600px]] [[File:Cloned rule with incorrect PB setting.png|none|thumb|600x600px]]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=3487</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=3487"/>
		<updated>2021-01-02T19:07:11Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 4.0&amp;lt;/h1&amp;gt;Rule-4.0 is the culmination of a journey in the transformation of the Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&lt;br /&gt;
===What Became of Rule, Trigger, Triggered Rule, Action and Schedule?===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#What was a '''Trigger''' is now the basic format for all rules.&lt;br /&gt;
#*The user selects '''Trigger Events''' and define actions.&lt;br /&gt;
#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.&lt;br /&gt;
#The previous Schedule event, is now available as a new type of Trigger Event named '''Days of Week Schedule'''.&lt;br /&gt;
#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.&lt;br /&gt;
&lt;br /&gt;
===Change in logic for Rule-4.0 rule===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
*'''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.&lt;br /&gt;
&lt;br /&gt;
===Former Rule Truth and Cancel on Truth Change===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
===What about Triggered Rules?===&lt;br /&gt;
All &amp;quot;Rules&amp;quot; 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.&lt;br /&gt;
===Events===&lt;br /&gt;
Each rule has one or more '''Trigger Events''' that when triggered, cause the rule's actions to run.&amp;lt;p&amp;gt;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.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Actions===&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
====Actions as ordered script====&lt;br /&gt;
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&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; 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.&lt;br /&gt;
====Actions can be edited====&lt;br /&gt;
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.&lt;br /&gt;
[[File:RM 4 edit and delete actions.png|link=https://docs.hubitat.com/File:RM%204%20edit%20and%20delete%20actions.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Delay per action and Delay (Pause) all actions====&lt;br /&gt;
There were three types of delays first introduced starting with Rule-3.0&lt;br /&gt;
&lt;br /&gt;
#Each individual '''Action''' can have its own delay, which may also include a '''Cancel on Truth Change''' option.&lt;br /&gt;
#All actions can be delayed, effectively pausing the action execution for a specified amount of time.&lt;br /&gt;
#All actions can also be delayed for a period of time that is dependent on the current '''Mode''' (i.e. '''Delay Actions Per Mode''').&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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 '''&amp;lt;u&amp;gt;the next action in order&amp;lt;/u&amp;gt;''' 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
===Rule-4.0 Conditional Actions and Logical Expressions===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#Exit Rule - With Exit Rule the execution of '''Actions''' for that rule will stop, irrespective of what order in the rule it exists.&lt;br /&gt;
#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''', '''Cancel Rule Timers''', and '''Cancel Delayed Actions''', where appropriate.&lt;br /&gt;
&lt;br /&gt;
====Automatic Condition Creation====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
====IF-THEN-ELSE====&lt;br /&gt;
You can introduce conditional execution of actions using the following method.&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
'''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.&lt;br /&gt;
===Repeat Actions===&lt;br /&gt;
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 '''&amp;lt;u&amp;gt;all Repeat Actions&amp;lt;/u&amp;gt;''', irrespective of which Stop selection is used.&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
#While-loop - The '''while-loop''' runs only if the condition is true, and stops if it is false.&lt;br /&gt;
#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.&lt;br /&gt;
#Repeat-until loop - A repeat-until loop runs until a condition becomes true, running at least once.&lt;br /&gt;
&lt;br /&gt;
'''Examples:'''&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is True:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''Conditional For loop (repeat n times if condition is True):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions with Stop selected&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 END-REP&lt;br /&gt;
'''Repeat Actions''' cannot be nested.  '''END-REP''' is optional, and if omitted, all actions after '''Repeat Actions''' will be repeated.&lt;br /&gt;
&lt;br /&gt;
*'''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 &amp;lt;u&amp;gt;forever&amp;lt;/u&amp;gt;, 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.&lt;br /&gt;
&lt;br /&gt;
===Wait for Events and Wait for Condition===&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
'''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).&lt;br /&gt;
===Custom Actions===&lt;br /&gt;
'''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.&lt;br /&gt;
===Global Variables===&lt;br /&gt;
'''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.&lt;br /&gt;
&lt;br /&gt;
*'''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.&lt;br /&gt;
**'''Conditions''' based on variables will also be removed, which in turn may erase the rule definition.&lt;br /&gt;
**'''Actions''' that set variables will be removed and Actions with dimmers/bulbs set by variables will have missing settings.&lt;br /&gt;
**'''Global Variables''' used for comparisons will leave the comparison missing what is to be compared against.&lt;br /&gt;
&lt;br /&gt;
====Global Variables may be used for Level/Color====&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
====Global Variables can be set by endpoint====&lt;br /&gt;
A string Global Variable can be set by an endpoint trigger.  This is an addition to the [https://community.hubitat.com/t/rule-machine-api/7104 Rule Machine API]&lt;br /&gt;
&lt;br /&gt;
====Global Variables can be used with parameters for Custom Actions====&lt;br /&gt;
A Global Variable can be used with parameters by using '''%global-variable-name%'''.&lt;br /&gt;
&lt;br /&gt;
====Global Variables in messages====&lt;br /&gt;
To include the value of a Global Variable in a message string (or HTTP request URL or body), you would use '''%global-variable-name%'''.&lt;br /&gt;
===Run Actions from the Rule-4.0 User Interface===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Rule Logging===&lt;br /&gt;
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.&lt;br /&gt;
===List of Actions===&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
	  Change color temperature over time&lt;br /&gt;
	  Stop changing color temperature&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send, Speak, or Log a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Log a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Volume, Sounds&lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Set Volume&lt;br /&gt;
	  Mute&lt;br /&gt;
	  Unmute&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Cancel/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Cancel Rule Timers&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          END-REP&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Export, Import or Clone of Rule Machine Rules===&lt;br /&gt;
Select this option to allow export of your Rule Machine rules for import to another hub, or to clone an existing rule as a base from which to start a new rule.&lt;br /&gt;
[[File:Export Import and Clone RM rule v2.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Export a Rule====&lt;br /&gt;
&lt;br /&gt;
#Select a single or multiple rules for '''Export'''. You may export multiple rules to a single file, and still have the option to select which rules to later '''Import'''.[[File:Export Selected RM rules v2.png|none|thumb|600x600px]]&lt;br /&gt;
#Press the '''Download''' button to save the file to your local drive in the designated file download location for your browser. Typically this will be your '''Downloads''' folder.[[File:Export RM rule v2.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Restore or Import a Rule====&lt;br /&gt;
You may choose to '''Restore''' a rule instead of using the '''Import''' option. This is most appropriate for instances where you want to bring a Rule Machine rule into your hub database, but you do not want to change the name or the devices used in the rule. If you instead choose to '''Import''', the process will pause to allow the rule to be renamed, and the devices used in the rule to be substituted with other devices installed on your hub before completing the import process.&lt;br /&gt;
&lt;br /&gt;
'''Restore'''&lt;br /&gt;
&lt;br /&gt;
#To '''Restore''', select the saved file you previously exported, then press the '''Restore''' button.[[File:Restore RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
'''Import'''&lt;br /&gt;
&lt;br /&gt;
#To '''Import''', select the saved file you previously exported and press the '''Import...''' button.[[File:Import RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
#Select the rules for import.[[File:Selected RM rule for import.png|none|thumb|600x600px]]&lt;br /&gt;
#You will be prompted to replace the name and devices used in the rule if you need to.[[File:Rename and change RM devices before import.png|none|thumb|600x600px]]&lt;br /&gt;
#*'''NOTE:''' If you '''Import''' a rule to another hub without selecting replacement devices, any existing devices with those same names will be used in the imported rule. If the devices do not exist, virtual devices with those same names will automatically be created. This is very helpful when you need to replace devices of an imported rule, but do not yet have the devices available that will replace them.&lt;br /&gt;
#When ready to import, press the '''Import ['''rule name''']''' button.[[File:Rule Machine Import.png|none|thumb|600x600px]]&lt;br /&gt;
#You will receive a confirmation that the rule you selected has been imported.[[File:RM Import confirmation.png|none|thumb|600x600px]]&lt;br /&gt;
#If you changed the name, it will appear with the new name in your list of Rule Machine child apps.[[File:Show imported Rule Machine rules.png|none|thumb|600x600px]]&lt;br /&gt;
#*'''&amp;lt;span style=&amp;quot;color: red;;&amp;quot;&amp;gt;IMPORTANT!&amp;lt;/span&amp;gt;''' - If you import rules that contain a Private Boolean, it must be manually adjusted after importing the rule. In the following example, you will see that an imported rule will not keep the correct setting for Private Boolean after import, and therefore must be manually corrected.[[File:Cloning or imported rules containing PB.png|none|thumb|600x600px]][[File:Imported rule with PB not pointing anywhere.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
====Clone a Rule====&lt;br /&gt;
&lt;br /&gt;
#To '''Clone''' a rule, select the rule from the list of available Rule Machine rules on your hub and press the '''Clone''' button.[[File:Select Rule Machine rule for clone.png|none|thumb|600x600px]][[File:Initiate Rule Machine cloning.png|none|thumb|600x600px]]&lt;br /&gt;
#You will be prompted to replace the name and devices used in the rule if you need to.[[File:Rename and change RM devices before clone.png|none|thumb|600x600px]]&lt;br /&gt;
#When ready to proceed, press the '''Clone ['''rule name''']''' button.[[File:Clone Rule Machine rule.png|none|thumb|600x600px]]&lt;br /&gt;
#You will receive a confirmation that the rule you selected has been cloned.[[File:RM rule clone confirmation.png|none|thumb|600x600px]]&lt;br /&gt;
#If you changed the name, it will appear with the new name in your list of Rule Machine child apps. If you did not change the name, the rule will be imported under the same name, but it will have the word '''clone''' added to the end.[[File:Show cloned RM rule.png|none|thumb|600x600px]]&lt;br /&gt;
#*&amp;lt;span style=&amp;quot;color: red;;&amp;quot;&amp;gt;'''IMPORTANT!'''&amp;lt;/span&amp;gt; If you '''Clone''' rules that contain a Private Boolean, it must be manually corrected after cloning the rule. In the following example, you will see that a cloned rule will not keep the correct setting for Private Boolean after import, and therefore must be manually corrected.[[File:Cloning or imported rules containing PB.png|none|thumb|600x600px]] [[File:Cloned rule with incorrect PB setting.png|none|thumb|600x600px]]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=List_of_Compatible_Devices&amp;diff=2450</id>
		<title>List of Compatible Devices</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=List_of_Compatible_Devices&amp;diff=2450"/>
		<updated>2020-01-23T17:40:47Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The table below lists devices compatible with Hubitat Elevation™. You can sort the list by Brand Name, Protocol or Device Type to help you quickly find the device you are looking for. This list will be updated over time. &lt;br /&gt;
&lt;br /&gt;
Devices listed here are confirmed to have worked with Hubitat, but this does not mean the device will be guaranteed to work with Hubitat.  Support cannot assist you with pairing devices with the hub. Building a proper mesh network with repeaters is required to make most Zigbee and Z-Wave devices work with Hubitat. &lt;br /&gt;
&lt;br /&gt;
Zigbee and Z-Wave devices require the correct drivers to connect and work properly with the hub. LAN and Cloud devices connect using the specific integration app listed and may require an additional bridge device to communicate.&lt;br /&gt;
&lt;br /&gt;
While this list includes devices known by Hubitat to work, there are countless other devices users have running on their hubs. Visit our [https://community.hubitat.com/t/compatible-devices-wiki/465 Community Devices Page] to see other devices users have running on their hubs. Some of these devices use custom drivers, for which support comes from the custom driver author, not from Hubitat. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Brand (click link for reset/join instructions)&lt;br /&gt;
!Device&lt;br /&gt;
!Product Number&lt;br /&gt;
!Device type&lt;br /&gt;
!Protocol&lt;br /&gt;
!Driver Name&lt;br /&gt;
!Integration App&lt;br /&gt;
!Additional Required Hardware&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#ADT                                 |ADT]]||Zigbee Water Sensor|| ||Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]||ERIA Motion Sensor|| ||Motion Sensor||Zigbee||ERIA Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]||ERIA Dimmer Switch|| ||Button Controller||Zigbee||ERIA Dimmer Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]||ERIA Contact Sensor|| ||Contact Sensor||Zigbee||ERIA Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Siren 6||ZW164-A||Siren||Z-Wave||Aeotec Siren 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Doorbell 6||ZW162-A||Doorbell||Z-Wave||Aeotec Doorbell 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Nano Switch||ZW116||Switch||Z-Wave||Aeotec Nano Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Nano Switch||ZW139||Switch||Z-Wave||Aeotec Nano Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||WallMote Quad||ZW130||Button Controller||Z-Wave||Aeon WallMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Contact Sensor||DSB04100||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Door/Window Sensor Gen 2|| ||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Doorbell||ZW056||Doorbell||Z-Wave||Aeon Labs Doorbell|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Dry Contact Sensor||ZW097-A||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Micro Switch G2||DSC26103||Switch||Z-Wave||Aeon Micro Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Home Energy Meter|| ||Energy Meter||Z-Wave||Aeon Home Energy Meter|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||LED Bulb 6 Multi-Color|| ||Bulb||Z-Wave||Aeotec LED Bulb 6 Multi-Color|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Micro Illuminator G2||DSC27103||Dimmer||Z-Wave||Aeon Micro Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Micro Motor Controllers|| ||Motor Controller||Z-Wave||Aeon Motor Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Minimote||DSA03202||Button Controller||Z-Wave||Aeon Minimote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Motor Controller|| ||Motor Controller||Z-Wave||Aeon Motor Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||MultiSensor 5|| ||Motion Sensor||Z-Wave||Aeon MultiSensor 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||MultiSensor 6||ZW100-A||Motion Sensor||Z-Wave||Aeon MultiSensor 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||NanoMote One||ZWA003-A||Button Controller||Z-Wave||Aeotec NanoMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||NanoMote Quad||ZWA004-A||Button Controller||Z-Wave||Aeotec NanoMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Recessed Door Sensor||DS854-ZWUS||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Recessed Door Sensor Gen 5||ZW089||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Siren||ZW080||Siren||Z-Wave||Aeon Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Smart Switch 6||ZW096AU||Outlet||Z-Wave||Aeotec Smart Switch 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Smart Switch 6||ZW096-A02||Outlet||Z-Wave||Aeotec Smart Switch 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Smart Switch 6||ZW110-B09||Outlet||Z-Wave||Aeotec Smart Switch 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Smart Switch 6||ZW096-A02||Outlet||Z-Wave||Aeotec Smart Switch 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Aeotec .28Aeon Labs.29|Aeotec*]]||Smart Switch 6||ZW110-B09||Outlet||Z-Wave||Aeotec Smart Switch 6|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||TriSensor||ZWA005-A||Motion Sensor||Z-Wave||Aeotec TriSensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||WallMote||ZW129-A||Button Controller||Z-Wave||Aeon WallMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Door Window Sensor 6|| ||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Door Window Sensor 7||ZWA008-A||Contact Sensor||Z-Wave||Aeotec Door/Window Sensor 7|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Range Extender 6|| ||Repeater||Z-Wave||Generic Z-Wave Repeater|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||LED Bulb 5||ZW098-A52||Bulb||Z-Wave||Aeon LED Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||LED Bulb 6 Multi-White|| ||Bulb||Z-Wave||Aeotec LED Bulb 6 Multi-White|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Range Extender||DSD37-ZWUS||Repeater||Z-Wave||Generic Z-Wave Repeater|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Garage Door Controller Gen 5|| ||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]||Nano Dimmer||ZW111||Dimmer||Z-Wave||Aeotec Nano Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Amazon Echo Skill|Amazon]]||Echo|| ||Voice Assistant||Cloud|| ||Amazon Echo Skill||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Alfred|Alfred]]||Z-Wave Lock|| ||Lock||Z-Wave|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#August                              |August]]||August Pro Lock|| ||Lock||Z-Wave||August Pro Z-Wave Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]||360 Ceiling Sensor||IX32||Motion Sensor||Z-Wave||BeSense Motion Sensor Zwave Plus|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]||Door/Window Sensor||IM20||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]||PIR Wall Sensor||IX30||Motion Sensor||Z-Wave||BeSense Motion Sensor Zwave Plus|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#BOSCH|Bosch]]||PIR Motion Detector||ISW-ZPR1-WP13||Motion Sensor||Zigbee||Bosch Motion Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#BOSCH|Bosch]]||TriTech Motion Detector||ISW-ZDL1-WP11G||Motion Sensor||Zigbee||Bosch Motion Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Contact Sensor|| ||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Micro Door Sensor|| ||Contact Sensor||Zigbee||SmartSense Multi Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Motion Sensor|| ||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Outlet Plug-in|| ||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Smart Outlet||4200-C||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]||Perl Thermostat|| ||Thermostat||Zigbee||Generic Zigbee Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#CREE                                |Cree]]||Connected A-19 Bulb|| ||Bulb||Zigbee||Generic Zigbee Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Denon||Audio Video Receivers|| ||AVR||LAN||Denon AVR|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Door Sensor||DMWD1||Contact Sensor||Z-Wave||Dome Door Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Door/Window Sensor Pro||DMDP1||Contact Sensor||Z-Wave||Dome Door/Window Sensor Pro|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Leak Sensor||DMWS1||Water Sensor||Z-Wave||Dome Leak Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Motion Sensor||DMMS1||Motion Sensor||Z-Wave||Dome Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Mouser||DMMZ1||Mouse Trap||Z-Wave||Dome Mouser|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||On/Off Plug||DMOF1||Outlet||Z-Wave||Dome On Off Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Siren||DMS01||Siren||Z-Wave||Dome Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Water Shutoff||DMWV1||Valve||Z-Wave||Dome Water Shut-Off|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]||Dome Range Extender||DMEX1||Repeater||Z-Wave||Dome Range Extender|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dragon Tech                         |Dragontech]]||Outlet|| ||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Eaton .28Cooper Wiring Devices.29   |Eaton]]||Dimmer||RF9540||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Ecobee Integration|Ecobee]]|| || ||Thermostat||Cloud|| ||Ecobee Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Contact Sensor||DWZWAVE2.5-ECO||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Garage Door Tilt Sensor||TILT-ZWAVE2||Tilt Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Motion Sensor||PIRZWAVE2.5||Motion Sensor||Z-Wave||Generic Z-Wave Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Siren||SC-ZWAVE5||Siren||Z-Wave||Ecolink Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Smoke/CO Audio Detector||FF-ZWAVE5||Smoke/CO Detector||Z-Wave||Ecolink Smoke/CO Audio Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Tilt Sensor||TILTZWAVE2.5||Tilt Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Wireless Double Rocker Switch||DDLS2-ZWAVE5||Switch||Z-Wave||Ecolink Wireless Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Wireless Rocker Switch||DLS-ZWAVE5||Switch||Z-Wave||Ecolink Wireless Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Wireless Toggle Switch||TLS-ZWAVE5||Switch||Z-Wave||Ecolink Wireless Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Flood/Freeze Sensor||FLF-ZWAVE5||Water Sensor||Z-Wave||Generic Z-Wave Water Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]||Wireless Double Toggle Switch||DTLS2-ZWAVE5||Switch||Z-Wave||Ecolink Wireless Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Enerwave                            |Enerwave]]||Duplex Outlet|| ||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Enerwave                            |Enerwave]]||Motion Sensor|| ||Motion Sensor||Z-Wave||Generic Z-Wave Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Eva Logik||Smart Plug||ZW36||Outlet||Z-Wave||Eva Logik Smart Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Eva Logik||Smart Plug||ZW37||Outlet||Z-Wave||Eva Logik Smart Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]||Contact Sensor||HSM02||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]||Flood Detector||ST812||Water Sensor||Z-Wave||Generic Z-Wave Water Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]||Motion Sensor||HSP02||Motion Sensor||Z-Wave||Generic Z-Wave Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]||Smoke Detector||SF813||Smoke Detector||Z-Wave||Generic Z-Wave Smoke Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]||Temperature/Humidity Sensor||ST814||Temperature Sensor||Z-Wave||Generic Z-Wave Temperature/Humidity Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Evolve                              |Evolve]]||Relay||LFM-20||Relay||Z-Wave||Generic Z-Wave Relay|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Button||FGPB-101||Button Controller||Z-Wave||Generic Z-Wave Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Door/Window Sensor 2||FGDW-002||Contact Sensor||Z-Wave||Fibaro Door/Window Sensor 2|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Flood Sensor||FGFS-101||Water Sensor||Z-Wave||Fibaro Flood Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Flood Sensor ZW5||FGFS-101 ZW5||Water Sensor||Z-Wave||Fibaro Flood Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||KeyFob||FGKF-601 ZW5||Button Controller||Z-Wave||Generic Z-Wave Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Motion Sensor ZW5||FGMS-001||Motion Sensor||Z-Wave||Fibaro Motion Sensor ZW5|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Fibaro RGBW Controller||FGRGBW-101||RGBW Controller||Z-Wave||Fibaro RGBW Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Single Switch 2||FGS-213||Switch||Z-Wave||Fibaro Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Wall Plug||FGWPB-111||Outlet||Z-Wave||Fibaro Wall Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Wall Plug||FGWPB-121||Outlet||Z-Wave||Fibaro Wall Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]||Fibaro Dimmer 2||FGD-212||Dimmer||Z-Wave||Fibaro Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#First Alert                         |First Alert]]||Smoke &amp;amp; CO Alarm||ZCOMBO||Smoke/CO Detector||Z-Wave||Generic Z-Wave Smoke/CO Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#FortrezZ|FortrezZ]]||MIMO2+||MIMO2+||Relay||Z-Wave||Fortrezz MIMO2+|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#FortrezZ|FortrezZ]]||MIMOlite||MIMOlite||Relay||Z-Wave||Fortrezz MIMOlite|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Link Bulb|| ||Bulb||Zigbee||Generic Zigbee Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Link Daylight Bulb|| ||Bulb||Zigbee||Generic Zigbee Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Link Soft White Bulb|| ||Bulb||Zigbee||Generic Zigbee Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Fan Control||14287/ZW4002||Fan Controller||Z-Wave||GE Smart Fan Control|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Switch||14291||Switch||Z-Wave||Generic Z-Wave Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Dimmer||14294||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Motion Switch||26931||Switch||Z-Wave||Jasco Z-Wave Motion Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Motion Dimmer||26993||Dimmer||Z-Wave||Jasco Z-Wave Motion Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||GE Smart Door Sensor||32563ZW6301||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Switch||45856||Switch||Zigbee||GE Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]||Smart Dimmer||45857||Dimmer||Zigbee||GE Zigbee Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]||Garage Door Controller|| ||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]||Glass Break Detector|| ||Glass Break Detector||Z-Wave||Generic Glass Break Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]||Z-Wave Thermostat||GC-TBZ48||Thermostat||Z-Wave||GoControl Z-Wave Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Google Home|Google]]||Google Home Assistant|| ||Voice Assistant||Cloud|| ||Google Home Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Google||Chromecast|| ||Media Renderer||LAN|| ||Chromecast Integration (beta)||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Graber                              |Graber]]||Z-Wave+ Roller Blinds|| ||Shade Controller||Z-Wave||Generic Z-Wave Shade|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Halo Labs                           |Halo Labs]]||Halo+ Smoke Alarm|| ||Smoke/CO Detector||Zigbee||Halo Smoke Alarm|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hampton Bay                         |Hampton Bay]]||Fan Controller||MR101Z||Fan Controller||Zigbee|| || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]||Four-Key Scene Controller||HKZW-SCN04||Button Controller||Z-Wave||Aeotec NanoMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]||One-Key Scene Controller||HKZW-SCN01||Button Controller||Z-Wave||Aeotec NanoMote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]||RGBW LED Bulb||HKZW-RGB01||Bulb||Z-Wave||Hank RGBW LED Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#HomePro                             |HomePro]]||Outlet||ZRP110||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||HomeSeer Indicator Light Sensor||HS-FS100-L+||Light Sensor||Z-Wave||HomeSeer Flex Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||HomeSeer Perimeter Water Sensor||HS-FS100-W+||Water Sensor||Z-Wave||HomeSeer Flex Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||Wall Dimmer||HS-WD200+||Dimmer||Z-Wave||HomeSeer WD-200 Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||Wall Switch||HS-WS200+||Switch||Z-Wave||Generic Z-Wave CentralScene Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||ZWave Plus Door/Window Sensor||HS-DS100+||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]||Water Sensor||HS-LS100+||Water Sensor||Z-Wave||HomeSeer Leak Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[IFTTT Integration|IFTTT]]|| || || ||Cloud|| ||IFTTT Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]||TRÅDFRI Bulb E26||1000lm Warm White||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]||TRÅDFRI Outlet|| ||Outlet||Zigbee||Ikea TRADFRI Control Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]||TRÅDFRI Signal Repeater|| ||Repeater||Zigbee||Ikea TRADFRI Signal Repeater|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]||Outlet|| ||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]||Switch|| ||Switch||Z-Wave||Generic Z-Wave Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]||Switch Module|| ||Switch||Z-Wave||Generic Z-Wave Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]||Switch Module|| ||Switch||Z-Wave||Generic Z-Wave Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Button||BTN900||Button Controller||Zigbee||Iris V1 Button|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Care Pendant||PDT900||Button Controller||Zigbee||Iris V1 Care Pendant|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Door/Window Sensor||DWS800||Contact Sensor||Zigbee||Iris V1 Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Keyfob||KEY903||Presence Sensor||Zigbee||Iris V1 Key Fob|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Motion Sensor||MOT800||Motion Sensor||Zigbee||Iris V1 Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)||V1 Smart Plug||SPG800||Outlet||Zigbee||Iris V1 Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Button||3460-L||Button Controller||Zigbee||Iris Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Door/Window Sensor||3320-L||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||Garage Door Opener||GD-00Z-1||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Keypad||3405-L||Keypad||Zigbee||Iris V2 Keypad|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V3 Keypad||iL02_1||Keypad||Zigbee||Iris V3 Keypad|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Motion Sensor||3326-L||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V3 Motion Sensor||iL07_1||Motion Sensor||Zigbee||Generic Zigbee Motion/Humidity Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Outlet||3210-L||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||V2 Smart Fob||3450-L||Button Controller||Zigbee||Iris 4 Button Fob|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||Smart Plug Z-Wave Repeater||3210-L||Repeater||Z-Wave||Generic Z-Wave Repeater|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]||Smart Water Sensor||3315-L||Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#KEEN Home                           |KEEN Home]]||Smart Vent|| ||Vent||Zigbee||Keen Home Smart Vent|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |keyWe||Lock|| ||Lock||Z-Wave||keyWe Z-Wave Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||10-Button Deadbolt|| ||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||10-Button Touch Deadbolt|| ||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||5-Button Deadbolt|| ||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||5-Button Lever|| ||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||910/912 Lock|| ||Lock||Z-Wave||Generic Z-Wave Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]||Smartcode Lock|| ||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leak Intelligence                   |Leak Intelligence]]||Leak Gopher Valve|| ||Valve||Z-Wave||Generic Z-Wave Valve|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Fan Controller|| ||Fan Controller||Z-Wave||Leviton Fan Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Plug-in Appliance Module||DZPA1||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Plug-in Dimmer Module||VRMX1||Outlet||Z-Wave||Generic Z-Wave Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Smart Dimmer||DZ6HD-1BZ||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Smart Dimmer||DZMX1||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Scene controller||VRCS4||Button Controller||Z-Wave||Leviton VRCS4|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Switch||DZ15S||Switch||Z-Wave||Generic Z-Wave Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Dimmer||VRI06-1LZ||Dimmer||Z-Wave||Generic Z-Wave Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Dimmer||VRI10-1LZ||Dimmer||Z-Wave||Generic Z-Wave Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Switch||DZS15-1LZ||Switch||Z-Wave||Generic Z-Wave Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]||Switch||VRS15-1LZ||Switch||Z-Wave||Generic Z-Wave Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Life360 Connector|Life360]]||Life360 App|| ||Presence Sensor||Cloud|| ||Life360 Connector||Compatible Smart Phone&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]||Contact Sensor||WADWAZ-1||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]||Motion Sensor||WAPIRZ-1||Motion Sensor||Z-Wave||Generic Z-Wave Motion/Temperature Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]||Siren||WA105DBZ-1||Siren||Z-Wave||Linear/Vision Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Caséta Dimmers and Switches|| ||Dimmer||LAN||Lutron Dimmer, Lutron Switch||Lutron Integration||Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Caséta SmartBridge Pro|| ||Bridge||LAN||Lutron Keypad||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Pico Remotes|| ||Button Controller||LAN||Lutron Pico, Lutron Fast Pico||Lutron Integration||Caséta SmartBridge Pro or Radio RA2&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Dimmers and Switches|| ||Dimmer||LAN||Lutron Dimmer, Lutron Switch||Lutron Integration||RadioRA2 Select or RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Keypads|| ||Keypad||LAN||Lutron Keypad||Lutron Integration||RadioRA2 Select or RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Main Repeater|| ||Repeater||LAN||Lutron Keypad||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Motion Sensors|| ||Motion Sensor||LAN||Lutron Motion Sensor||Lutron Integration||RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Select|| ||Bridge||LAN||Lutron Keypad||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 VCRX Garage Controller|| ||Garage Controller||LAN||Lutron Keypad||Lutron Integration||RadioRA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Serena Shades|| ||Shade Control||LAN||Lutron Shade||Lutron Integration||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Sivoia QS Triathlon Shades|| ||Shade Control||LAN||Lutron Shade||Lutron Integration||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||RadioRA2 Thermostat|| ||Thermostat||LAN||Lutron Thermostat||Lutron Integration||RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]||Lutron Fan Control|| ||Fan Controller||LAN||Lutron Fan Control||Lutron Integration||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron|Lutron]]||Aurora Controller||Z3-1BRL||Button Controller||Zigbee||Lutron Aurora Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lux                                 |Lux]]||Zigbee Thermostat||KONOz||Thermostat||Zigbee||LUX Zigbee Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Marantz||Audio Video Receivers|| ||AVR||LAN||Denon AVR|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#MCO Home                            |MCOHome]]||Dimmer Switch|| ||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Contact Sensor|| ||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Outlet|| ||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Plugin Dimmer|| ||Dimmer||Z-Wave||Generic Z-Wave Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plugin On/Off||11995||Outlet||Z-Wave||Generic Z-Wave Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plus PIR Motion Detector With Temperature Sensor||15271||Motion Sensor||Z-Wave||Generic Z-Wave Motion/Temperature Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plus PIR Multi Sensor||15902||Motion Sensor||Z-Wave||Zooz 4-in-1 Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plus Recessed Door/Window Sensor||15268||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plus Smart Plug and Repeater with 2 USB ports||27481||Outlet||Z-Wave||Zooz Power Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]||Z-Wave Plus Door/Window Sensor||15270||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#NanoLeaf|NanoLeaf]]||Aurora Light Panels|| ||Bulb||LAN||Nanoleaf Aurora|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#NanoLeaf|NanoLeaf]]||Canvas Light Panels|| ||Bulb||LAN||Nanoleaf Aurora|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEEO||NEEO Remote|| ||AVR Remote||LAN||NEEO Remote|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Door/Window Sensor||NAS-DS02ZU||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Door/Window Sensor||NAS-DS01ZE||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Motion Sensor||NAS-PD01ZU-T||Motion Sensor||Z-Wave||Neo Coolcam Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Power Plug||NAS-WR02Z*||Outlet||Z-Wave||Neo Coolcam Power Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Remote Control 1||NAS-RC03ZU||Button Controller||Z-Wave||Neo Coolcam Remote Control|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]||NEO Coolcam Remote Control 4||NAS-RC03ZU||Button Controller||Z-Wave||Neo Coolcam Remote Control|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEO||Neo Coolcam Light Switch 1||NAS-SC02ZU-1||Switch||Z-Wave||Neo Coolcam Light Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEO||Neo Coolcam Light Switch 2||NAS-SC02ZU-2||Switch||Z-Wave||Neo Coolcam Light Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NodOn                               |NodOn]]||Octan Remote||CRC-3US-1||Button Controller||Z-Wave||Generic Z-Wave Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NodOn                               |NodOn]]||Soft Remote||CRC-3US-6||Button Controller||Z-Wave||Generic Z-Wave Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Nue||1 Gang Light Switch||HGZB-41||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Nue||2 Gang Light Switch||HGZB-42||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Nue||3 Gang Light Switch||HGZB-43||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Nue||4 Gang Light Switch||HGZB-44||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Nue||Nue Zigbee Dimmer||HGZB-4D||Dimmer||Zigbee||Nue Zigbee Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]||Curtain Motion Sensor||NCZ-3045-HA||Motion Sensor||Zigbee||NYCE Motion Sensor Series|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]||Celing Motion Censor||NCZ-3043-HA||Motion Sensor||Zigbee||NYCE Motion Sensor Series|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]||Motion Sensor||NCZ-3041-HA||Motion Sensor||Zigbee||NYCE Motion Sensor Series|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]||Garage Door (Tilt) Sensor||NCZ-3014-HA||Contact Sensor||Zigbee||NYCE Iris Tilt Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]||Door/Window Sensor||NCZ-3011-HA||Contact Sensor||Zigbee||NYCE Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Onkyo||Audio Video Receivers|| ||AVR||LAN||Onkyo AVR|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orbit                               |Orbit]]||Smart Hose Faucet Timer||27087||Irrigation Controller||Zigbee||Orbit Hose Water Timer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orbit                               |Orbit]]||12-Station Sprinkler Controller||27396||Irrigation Controller||Zigbee||Orbit 12-Station Sprinkler Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orvibo                              |Orvibo]]||Motion Sensor||SN11||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Lightify Flex RGBW|| ||Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Smart+ Classic E27 Multicolor|| ||Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Lightify LED Classic B40 Tunable White 60W|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Lightify LED Flood BR30 Tunable White|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Lightify LED Recessed Kit RT 5/6 Tunable|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Lightify LED Tunable White 60W|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#OSRAM|Osram]]||Smart Outdoor Plug|| ||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ||Contact Sensor||3300||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ||Moisture Sensor||3315||Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ||Motion Sensor||3305||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Dimmer Switch||73698&lt;br /&gt;
|Button Controller||Zigbee||Philips Dimmer Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Ambiance White|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Bloom Lights|| ||Bulb||Zigbee||Generic Zigbee RGB Light||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Bridge|| ||Bridge||LAN|| ||Hue Bridge Integrator||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Living Colors Lights|| ||Bulb||Zigbee||Generic Zigbee RGB Light||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Lux|| ||Bulb||Zigbee||Generic Zigbee RGBW Light||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Motion Sensor||473389||Motion Sensor||Zigbee||Hue Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Outdoor Motion Sensor||541730||Motion Sensor||Zigbee||Hue Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||Strip Lights|| ||Bulb||Zigbee||Generic Zigbee RGB Light||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||White and Color Ambiance LightStrip|| ||Bulb||Zigbee||Generic Zigbee RGBW Light||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Philips Hue|Philips Hue]]||White Ambiance|| ||Bulb||Zigbee||Generic Zigbee CT Bulb (dev)||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Pioneer||Audio Video Receivers|| ||AVR||LAN||Pioneer AVR|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Pushover]]||Pushover|| ||Notification||Cloud||Pushover driver|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Relay|| ||Relay||Z-Wave||Generic Z-Wave Relay|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush 2 Relay||ZMNHBD3||Relay||Z-Wave||Qubino 2 Relay Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush 1D Relay||ZMNHND3||Relay||Z-Wave||Qubino 1D Relay Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush Shutter DC||ZMNHOD3||Relay||Z-Wave||Qubino Shutter Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush Shutter||ZMNHCD3||Relay||Z-Wave||Qubino Shutter Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush ON/OFF Thermostat||ZMNHID3||Thermostat||Z-Wave||Qubino Thermostat Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush 1 Relay||ZMNHAD3||Relay||Z-Wave||Qubino 1 Relay Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Qubino|Qubino]]||Flush Dimmer||ZMNHDD3||Dimmer||Z-Wave||Qubino Dimmer Module|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Quotra|Quotra]]||Quotra Wireless Smart Dimmer|| ||Dimmer||Zigbee||Generic Zigbee Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Rachio|| || ||Irrigation Controller||Cloud|| ||Rachio Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]||CT100 Thermostat||CT100||Thermostat||Z-Wave||Generic Z-Wave Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]||CT101 Thermostat||CT101||Thermostat||Z-Wave||Radio Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]||Thermostat Z-Wave USNAP Module|| ||Thermostat||Z-Wave||Generic Z-Wave Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Remotec|Remotec]]||ZFM-80 relay||ZFM-80||Relay||Z-Wave||Remotec ZFM-80|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Remotec|Remotec]]||ZRC-90 Button Controller||ZRC-90||Button Controller||Z-Wave||Remotec ZRC-90|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#RGBgenie|RGBgenie]]||Single Color Controller Panel||ZB-3026||Button Controller||Zigbee||RGBgenie Controller ZB-3026|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#RGBgenie|RGBgenie]]||3 Zone Color Touch Panel||ZB-5027||Button Controller||Zigbee||RGBgenie Controller ZB-3027|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#RGBgenie|RGBgenie]]||Color Remote||ZB-5028||Button Controller||Zigbee||RGBgenie Controller ZB-5028|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#RGBgenie|RGBgenie]]||Single Color Wall Mounted Remote Controller||ZB-5121||Button Controller||Zigbee||RGBgenie Controller ZB-512x|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |RGBgenie||Color Micro Remote with single scene recall||ZB-5122||Button Controller||Zigbee||RGBgenie Controller ZB-5122|| ||&lt;br /&gt;
|-																   &lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Salus|Salus]]||Smart Plug||SP600||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Samsung SmartThings|Samsung SmartThings]]&lt;br /&gt;
|Outlet (2017 Model)&lt;br /&gt;
|F-OUT-US-2&lt;br /&gt;
|Outlet&lt;br /&gt;
|Zigbee&lt;br /&gt;
|Generic Zigbee Outlet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Samsung SmartThings|Samsung SmartThings]]||Button V5||IM6001-BTP&lt;br /&gt;
|Button Controller||Zigbee||Samsung Zigbee Button|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Samsung SmartThings|Samsung SmartThings]]||Motion Sensor V5||IM6001-MTP&lt;br /&gt;
|Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Samsung SmartThings|Samsung SmartThings]]||Water Leak Sensor V5||IM6001-WLP&lt;br /&gt;
|Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Samsung SmartThings|Samsung SmartThings]]||Multi Sensor V5||IM6001-MPP&lt;br /&gt;
|Contact Sensor||Zigbee||SmartThings Multipurpose Sensor V5|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Samsung SmartThings||Samsung Zigbee Outlet||IM6001-OTP01&lt;br /&gt;
|Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Element Classic Bulb||E11-G13||Bulb||Zigbee||Sengled Element Classic|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Element Classic Bulb||E11-G14||Bulb||Zigbee||Sengled Element Classic|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Element Multicolor Bulb||E11-N1EA||Bulb||Zigbee||Sengled Element Color Plus|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled||Multicolor Light Strip||E1G-G8E||Bulb||Zigbee||Sengled Element Color Plus|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Element Plus Bulb||Z01-A19NAE26||Bulb||Zigbee||Sengled Element Plus|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Sengled Element Classic with motion||E13-N11||Bulb||Zigbee||Sengled Element Classic with motion|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sengled|Sengled]]||Smart Window and Door Sensor||E1D-G73||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled||Smart Plug||E1C-NB6||Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sensative|Sensative]]||Strips Guard|| ||Contact Sensor||Z-Wave||Generic Z-Wave Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sensative|Sensative]]||Strips Drips|| ||Water Sensor||Z-Wave||Strips Multi-Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sensative|Sensative]]||Strips Comfort|| ||Temperature Sensor||Z-Wave||Strips Multi-Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |sharptools.io|| || ||Dashboard||Cloud|| ||SharpTools||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart thermostat for electric heating||TH1124ZB||Thermostat||Zigbee||Sinope TH1124ZB (4KW) Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart thermostat for electric heating||TH1123ZB||Thermostat||Zigbee||Sinope TH1124ZB (4KW) Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Low Voltage Thermostat||TH1400ZB||Thermostat||Zigbee||Sinope TH1400ZB Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Floor Heating Thermostat||TH1300ZB||Thermostat||Zigbee||Sinope TH1300ZB Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Electrical Load Controller||RM3250ZB||Switch||Zigbee||Sinope load controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Water Leak Detector||WL4200||Water Sensor||Zigbee||Sinope Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Water Leak Detector with Sensor||WL4200S||Water Sensor||Zigbee||Sinope Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Smart Water Valve||VA4200WZ||Valve||Zigbee||Sinope water valve|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sinope|Sinope]]||Dimmer||DM2500ZB||Dimmer||Zigbee||Sinope Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Contact Sensor||3300-S||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||SmartSense Multi Sensor||STSS-MULT-001||Contact Sensor||Zigbee||SmartSense Multi V1|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Multi Sensor (2015 model)&lt;br /&gt;
|F-SS-MULT-001&lt;br /&gt;
|Contact Sensor||Zigbee||SmartSense Multi Sensor V4|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#SmartThings|SmartThings]]&lt;br /&gt;
|Multi Sensor (2016 model)&lt;br /&gt;
|F-MLT-US-2&lt;br /&gt;
|Contact Sensor&lt;br /&gt;
|Zigbee&lt;br /&gt;
|SmartSense Multi Sensor V4&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Multi Sensor V4||STS-MLT-250||Contact Sensor||Zigbee||SmartSense Multi Sensor V4|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Humidity Sensor||3310-S||Humidity Sensor||Zigbee||SmartThings Humidity Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||SmartSense Moisture Sensor|| ||Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Water Leak Sensor v4 (2015)|| ||Water Sensor||Zigbee||Generic Zigbee Moisture Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||SmartSense Motion Sensor|| ||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Motion Sensor V2|| ||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Motion Sensor V3|| ||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Motion Sensor V4|| ||Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Presence Sensor V2|| ||Presence Sensor||Zigbee||SmartThings Presence Sensor V2|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#SmartThings|SmartThings]]||Presence Sensor V4|| ||Presence Sensor||Zigbee||SmartThings Presence Sensor V4|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Somfy||2 Button Controller|| ||Button Controller||Z-Wave||Somfy 2 Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sonos||Speakers|| ||Speaker||LAN|| ||Sonos Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sunricher|Sunricher]]||Dimmer Module||ZG9101SAC-HP||Dimmer||Zigbee||Generic Zigbee Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ 4 Button Switch||74099&lt;br /&gt;
|Button Controller||Zigbee||Lightify Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Contact Sensor||74388&lt;br /&gt;
|Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Dimmer||73743&lt;br /&gt;
|Button Controller||Zigbee||Sylvania Dimmer Switch Button Controller|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Motion Sensor||72923&lt;br /&gt;
|Motion Sensor||Zigbee||Generic Zigbee Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Outlet||72922&lt;br /&gt;
|Outlet||Zigbee||Generic Zigbee Outlet|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ A19 RGBW|| ||Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ BR30 RGBW||74988&lt;br /&gt;
|Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Flex RGBW||74521&lt;br /&gt;
|Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ Outdoor RGBW Flex||73685&lt;br /&gt;
|Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ RT5/6 RGBW|| ||Bulb||Zigbee||Generic Zigbee RGBW Light|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Sylvania|Sylvania]]||Smart+ A19 Dimmable|| ||Bulb||Zigbee||Generic Zigbee Bulb|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Telguard|Telguard]]||Garage Door Control Switch||GDC1||Switch||Z-Wave||Generic Z-Wave Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Telldus|Telldus]]||Outlet Switch||TZWP-100&lt;br /&gt;
|Outlet||Z-Wave||Generic Z-Wave Smart Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Third Reality|Third Reality]]||Reality Switch|| ||Switch||Zigbee||Generic Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#TKB|TKB]]||TKB Dimmer Socket||TZ67E||Dimmer||Z-Wave||Generic Z-Wave Smart Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Utilitech                           |Utilitech]]||Siren|| ||Siren||Z-Wave||Linear/Vision Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Vision|Vision]]||Siren||zm1601US-3||Siren||Z-Wave||Linear/Vision Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Vision|Vision]]||Siren||zm1601US-5||Siren||Z-Wave||Linear/Vision Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Vision|Vision]]||Vision Shock Sensor||ZS5101||Acceleration Sensor||Z-Wave||Generic Z-Wave Acceleration Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Visonic|Visonic]]||Window Door Sensor||MCT-340 E||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Visonic|Visonic]]||Window Door Sensor||MCT-340 SMA||Contact Sensor||Zigbee||Generic Zigbee Contact Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#WaterCop|WaterCop]]||Shutoff Valve||192390.02||Valve||Z-Wave||Generic Z-Wave Valve|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Weather Underground||Weather Underground|| ||Notification||Cloud||WeatherUnderground|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Wireless|Wireless]]||Smoke Detector||ZWN-SD||Smoke Detector||Z-Wave||Generic Z-Wave Smoke Detector|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Xfinity|Xfinity]]||Xfinity 3400-X Keypad||3400||Keypad||Zigbee||Centralitle Keypad|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Push Button Lever Lock||YRD210||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Assure Keypad Deadbolt||YRD216||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Lever Lock||YRL236||Lock||Zigbee|| Yale Lock |Generic Zigbee Lock&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Lever Lock||YRL256||Lock||Zigbee||Generic Zigbee Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Conexis L1||Conexis L1||Lock||Z-Wave||Yale Conexis L1 Z-Wave Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yale|Yale]]||Assure Connected||YRD226||Lock||Z-Wave||Generic Z-Wave Lock|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Yale|Yale]]&lt;br /&gt;
|Yale Assure Lock SL&lt;br /&gt;
|YRD256&lt;br /&gt;
|Lock&lt;br /&gt;
|Z-Wave&lt;br /&gt;
|Generic Z-Wave Lock&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Mono Bulb|| ||Bulb||LAN||Yeelight Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Smart LED Bulb (CT)|| ||Bulb||LAN||Yeelight CT Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Smart LED Bulb (Color and CT)|| ||Bulb||LAN||Yeelight RGBW Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Smart LED Bulb (Color)|| ||Bulb||LAN||Yeelight RGB Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Bedside Lamp|| ||Bulb||LAN||Yeelight RGB Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Color 6|| ||Bulb||LAN||Yeelight RGB Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Yeelight|Yeelight]]||Ceiling 4|| ||Bulb||LAN||Yeelight RGB Bulb||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zemismart||2 Gang Switch||ZM-02-DK||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zemismart||Zigbee Switch||ZM-01-DK||Switch||Zigbee||Nue Zigbee Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zen|Zen]]||Thermostat|| ||Thermostat||Zigbee||Zen Thermostat|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zipato|Zipato]]||Siren||PH-PSE02||Siren||Z-Wave||Zipato Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#ZLINK|ZLINK]]||ZL-WD-100 Dimmer|| ||Dimmer||Z-Wave||Generic Z-Wave CentralScene Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#ZLINK|ZLINK]]||ZL-WS-100 Switch|| ||Switch||Z-Wave||Generic Z-Wave CentralScene Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Smart Plug||ZEN06||Outlet||Z-Wave||Zooz Power Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Power Switch||ZEN15||Switch||Z-Wave||Zooz Power Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Power Strip||ZEN20||Power Strip||Z-Wave||Zooz Power Strip|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Power Strip VER 2.0||ZEN20||Power Strip||Z-Wave||Zooz Power Strip|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Smart Switch||ZEN21||Switch||Z-Wave||Zooz Central Scene Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Dimmer Switch||ZEN22||Dimmer||Z-Wave||Zooz Central Scene Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz On/Off Toggle||ZEN23||Switch||Z-Wave||Zooz Central Scene Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz Dimmer Toggle||ZEN24||Dimmer||Z-Wave||Zooz Central Scene Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz Double plug||ZEN25||Outlet||Z-Wave||Zooz Double Plug|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz S2 On/Off Switch||ZEN26||Switch||Z-Wave||Zooz Central Scene Switch|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz S2 Dimmer||ZEN27||Dimmer||Z-Wave||Zooz Central Scene Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Motion Sensor||ZSE02||Motion Sensor||Z-Wave||Generic Z-Wave Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Motion and Light Mini Sensor||ZSE09||Motion Sensor||Z-Wave||Dome Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Motion Sensor ZSE18||ZSE18||Motion Sensor||Z-Wave||Zooz Motion Sensor ZSE18|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Zooz S2 Multisiren||ZSE19||Siren||Z-Wave||Zooz S2 Multisiren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Outdoor Motion Sensor||ZSE29||Motion Sensor||Z-Wave||Generic Z-Wave Motion Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Water Sensor||ZSE30||Water Sensor||Z-Wave||Dome Leak Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Smart Chime||ZSE33||Doorbell||Z-Wave||Dome Siren|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||4-in-1 Sensor||ZSE40||Motion Sensor||Z-Wave||Zooz 4-in-1 Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#Zooz|Zooz]]||Water Valve||ZAC03&lt;br /&gt;
|Valve||Z-Wave||Generic Z-Wave Valve|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#ZWP|ZWP]]||Dimmer||WD-100||Dimmer||Z-Wave||Generic Z-Wave CentralScene Dimmer|| ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |[[Join and Reset Instructions#ZWP|ZWP]]||Switch||WS-100||Switch||Z-Wave||Generic Z-Wave CentralScene Switch|| ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Note: Aeotec was formerly known as Aeon Labs.&lt;br /&gt;
&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Hubitat_Elevation_Documentation&amp;diff=2444</id>
		<title>Hubitat Elevation Documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Hubitat_Elevation_Documentation&amp;diff=2444"/>
		<updated>2020-01-18T19:12:19Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==[[Getting Started]]==&lt;br /&gt;
&lt;br /&gt;
#[[Registration and setup]]&lt;br /&gt;
#[[Discovering your Devices]]&lt;br /&gt;
#[[Automating your Devices]]&lt;br /&gt;
#[[Care and Maintenance]]&lt;br /&gt;
#[[How to Collect Information for Support|Support]]&lt;br /&gt;
&lt;br /&gt;
==Hubitat Web Interface Guide==&lt;br /&gt;
&lt;br /&gt;
'''Main Menu'''&lt;br /&gt;
&lt;br /&gt;
*[[Home]]&lt;br /&gt;
*[[Location and Modes]]&lt;br /&gt;
*[[Devices]]&lt;br /&gt;
**[[Device Discovery]]&lt;br /&gt;
**[[Device Detail]]&lt;br /&gt;
**[[Device Events]]&lt;br /&gt;
*[[Apps]] &lt;br /&gt;
**[[App Status]]&lt;br /&gt;
**[[App Events]]&lt;br /&gt;
*[[Settings]]&lt;br /&gt;
**[[Hub Details]]&lt;br /&gt;
**[[Hub Login Security]]&lt;br /&gt;
**[[Location and Modes]]&lt;br /&gt;
**[[Z-Wave Details]]&lt;br /&gt;
**[[Zigbee Details]]&lt;br /&gt;
***[[Zigbee Logs]]&lt;br /&gt;
**[[Check For Updates]]&lt;br /&gt;
**[[Backup and Restore]]&lt;br /&gt;
**[[Discover Zigbee and Z-Wave Devices]]&lt;br /&gt;
&lt;br /&gt;
'''Advanced Features'''&lt;br /&gt;
&lt;br /&gt;
*[[Apps Code]]&lt;br /&gt;
*[[Drivers Code]]&lt;br /&gt;
*[[System Events]]&lt;br /&gt;
**[[Hub Events]]&lt;br /&gt;
**[[Location Events]]&lt;br /&gt;
*[[Logs]]&lt;br /&gt;
**[[Past Logs]]&lt;br /&gt;
*[[Soft Reset]]&lt;br /&gt;
&lt;br /&gt;
==App Documentation==&lt;br /&gt;
&lt;br /&gt;
*[[Amazon Echo App]]&lt;br /&gt;
*[[Amazon Echo Skill]]&lt;br /&gt;
*[[Ecobee Integration]]&lt;br /&gt;
*[[Google Home]]&lt;br /&gt;
*[[Groups and Scenes]]&lt;br /&gt;
*[[Hub Link]]&lt;br /&gt;
*[[Hubitat® Dashboard|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Dashboard]]&lt;br /&gt;
*[[Hubitat® Safety Monitor|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Safety Monitor]]&lt;br /&gt;
*[[Hubitat® Simple Lighting|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Simple Lighting]]&lt;br /&gt;
*[[Hue Bridge Integration]]&lt;br /&gt;
*[[IFTTT Integration]]&lt;br /&gt;
*[[Life360 Connector]]&lt;br /&gt;
*[[Link to Hub]]&lt;br /&gt;
*[[Lock Code Manager]]&lt;br /&gt;
*[[Lutron Integrator]]&lt;br /&gt;
*[[Maker API]]&lt;br /&gt;
*[[Mode Lighting]]&lt;br /&gt;
*[[Mode Manager]]&lt;br /&gt;
*[[Motion Lighting Apps]]&lt;br /&gt;
*[[Notifications]]&lt;br /&gt;
*[[Rachio Integration]]&lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
*[[Rule-3.0]]&lt;br /&gt;
*[[Rule-4.0]]&lt;br /&gt;
*[[Send Hub Events]]&lt;br /&gt;
*[[SharpTools]]&lt;br /&gt;
*[[Sonos Integration]]&lt;br /&gt;
*[[Zone Motion Controllers]]&lt;br /&gt;
*[[Z-Wave Poller]]&lt;br /&gt;
&lt;br /&gt;
==Device Documentation==&lt;br /&gt;
&lt;br /&gt;
*[[Orbit Hose Water Timer]]&lt;br /&gt;
&lt;br /&gt;
*[[Pushover]]&lt;br /&gt;
&lt;br /&gt;
*[[SecurityKeypads]]&lt;br /&gt;
&lt;br /&gt;
*[[Twilio Notification]]&lt;br /&gt;
&lt;br /&gt;
==Compatible Devices==&lt;br /&gt;
&lt;br /&gt;
[[List of Compatible Devices]]&lt;br /&gt;
&lt;br /&gt;
[[Join and Reset Instructions]]&lt;br /&gt;
&lt;br /&gt;
==How to Guides==&lt;br /&gt;
&lt;br /&gt;
	[[Hub Placement Tips]]&lt;br /&gt;
&lt;br /&gt;
[[How to collect information for support]]&lt;br /&gt;
&lt;br /&gt;
[[How to Build a Solid Zigbee Mesh]]&lt;br /&gt;
&lt;br /&gt;
[[How to Build a Solid Z-Wave Mesh]]&lt;br /&gt;
&lt;br /&gt;
[[How to Remove a Device]]&lt;br /&gt;
&lt;br /&gt;
[[How to update your hub]]&lt;br /&gt;
&lt;br /&gt;
[[How to backup your hub]]&lt;br /&gt;
&lt;br /&gt;
[[How to change your location]]&lt;br /&gt;
&lt;br /&gt;
[[How to add/change a mode]]&lt;br /&gt;
&lt;br /&gt;
[[How to Install Custom Apps]]&lt;br /&gt;
&lt;br /&gt;
[[How to Install Custom Drivers]]&lt;br /&gt;
&lt;br /&gt;
[[How to add password protection]]&lt;br /&gt;
&lt;br /&gt;
[[How to Manage Lock Codes]]&lt;br /&gt;
&lt;br /&gt;
[[How to change accounts linked to your hub]]&lt;br /&gt;
&lt;br /&gt;
==Developer Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Developer Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Driver Capability List]]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Lutron_Integrator&amp;diff=2321</id>
		<title>Lutron Integrator</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Lutron_Integrator&amp;diff=2321"/>
		<updated>2019-09-19T16:32:45Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to connect your Lutron devices to your Hubitat Elevation™ network you will need a Lutron Smart Bridge Pro, RA2 Select Main Repeater or RA2 Main Repeater. Follow the manufacturer’s instruction to connect your devices to the Smart Bridge Pro, RA2 Select or RA2 Main Repeater, then follow these steps to connect your Smart Bridge Pro, RA2 Select or RA2 Main Repeater to your Hubitat Elevation™ Hub:&lt;br /&gt;
===Installing the Lutron Integrator===&lt;br /&gt;
&lt;br /&gt;
#From the Hubitat Web Interface select '''Apps'''[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose Lutron Integrator from the list of Hubitat Elevation™ Built-In Apps[[File:Install Lutron Integrator app.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Gathering required information===&lt;br /&gt;
You will be required to enter information from your Lutron Smart Bridge Pro during the creation of a new Caséta integration. All the necessary information can be found in the Lutron app.&lt;br /&gt;
&lt;br /&gt;
#Open the Lutron app on your mobile device and tap the gear icon at the top left to open ''Settings.''[[File:Lutron app open settings.png|none|thumb|515x515px]]&lt;br /&gt;
#Tap '''Advanced''' to access the ''Advanced Settings''[[File:Lutron app Advanced settings.png|none|thumb]]&lt;br /&gt;
#Tap Integration[[File:Lutron app Integration settings.png|none|thumb]]&lt;br /&gt;
#Ensure that '''Telnet Support''' is enabled.[[File:Lutron - Enable Telnet Support.png|none|thumb]]Hubitat Elevation™ uses the speed and reliability of the telnet feature found only on the Lutron Caséta Smart Bridge Pro, Lutron RA2 Select Main Repeater and RA2 Main Repeater. This elevates your Lutron devices with an integration potential that would not otherwise be possible. Therefore '''Telnet Support''' must be enable to use Lutron devices with your Hubitat Elevation™ hub. The standard Lutron Caséta Smart Bridge (non-Pro) is not supported since integrations with that bridge are cloud only.&lt;br /&gt;
#Tap '''Network Settings''' and write down the IP address of your Lutron Smart Bridge Pro, then tap '''&amp;lt; Integration''' at the top left to navigate back.[[File:Lutron Smart Bridge Pro IP setup.png|none|thumb]]&lt;br /&gt;
#Tap Send Integration Report.[[File:Lutron - Send Integration Report.png|none|thumb]][[File:Lutron Integration Report.png|none|thumb]]This is where you will find the names and Lutron Integration ID numbers for each of your attached Lutron devices. Selecting this option will create a draft email on your mobile device which you can email to yourself. If you only have a few devices, you can simply make note of their device names and Lutron Integration ID numbers, and then close the draft email without sending.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
===Create a New Caséta/RA2 Integration===&lt;br /&gt;
&lt;br /&gt;
#Open the Lutron Integrator app.&lt;br /&gt;
#Select '''Create New Caseta/RA2 Integration'''[[File:Lutron - New Caseta Integration.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Lutron integration and enter the  IP address of your Lutron Smart Bridge Pro.[[File:Lutron Integrator Smart Bridge Pro settings.png|none|thumb|600x600px]]&lt;br /&gt;
#Next you will need to select all of the Lutron devices you want to connect with your Hubitat Elevation™. If you only have a handful of devices, it is easiest to just choose the '''Select Lutron Devices''' button.&lt;br /&gt;
##Name your device&lt;br /&gt;
##Select the type of device[[File:Lutron Integration devices types.png|none|thumb|600x600px]]&lt;br /&gt;
##Enter the Lutron integration ID&lt;br /&gt;
##Repeat for every device you want to add[[File:Lutron devices setup.png|none|thumb|600x600px]]&lt;br /&gt;
#If you have dozens of devices, it may be quicker to toggle on ''Use configuration list instead of interactive setup''. Here you will enter your devices in a list with each device on its own line in this format: '''devicecode,id,name'''.[[File:Lutron Integrator configuration list.png|none|thumb|600x600px]]'''NOTE:''' If you have already setup your Lutron Integrator app using either the interactive device entry method, when you select '''Use configuration list instead of interactive setup''', the Lutron Integrator app will automatically convert from the previous setup to the new configuration list. Once this has been done, you may not go back to the interactive.&lt;br /&gt;
#When you are finished adding devices, press '''Done.'''&lt;br /&gt;
&lt;br /&gt;
You will now be able to use your connected Lutron devices in Button Controller, Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, Simple Lighting and other apps. When you add new Lutron devices, you will need to first add them to the Lutron Smart Bridge Pro via the Lutron app, then return to the Lutron Integrator app to connect the devices to your Hubitat Elevation™ hub.&lt;br /&gt;
&lt;br /&gt;
===Note for RadioRA2 Users===&lt;br /&gt;
&lt;br /&gt;
If using Essentials / Inclusive software version 12.2.1 or later, you must set the telnet credentials for the main repeater to be:&lt;br /&gt;
    Username:  lutron&lt;br /&gt;
    Password:  integration&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Motion_Lighting_Apps&amp;diff=2272</id>
		<title>Motion Lighting Apps</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Motion_Lighting_Apps&amp;diff=2272"/>
		<updated>2019-08-12T17:01:51Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Motion Lighting Apps offer a quick way to automate your lighting to be triggered by motion sensors or modes. The setup for Motion Lighting and Mode Lighting apps are slightly different. Here's how to start: &lt;br /&gt;
&lt;br /&gt;
==='''Installing the Motion Lighting apps'''===&lt;br /&gt;
&lt;br /&gt;
#From the Hubitat Web Interface select '''Apps'''[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose Motion Lighting Apps from the list of Hubitat Elevation™ Built-In Apps[[File:Install Motion Lighting Apps.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
==='''Creating a Motion Lighting App'''===&lt;br /&gt;
&lt;br /&gt;
#Open the Motion Lighting Apps in your Hubitat Web Interface&lt;br /&gt;
#Select '''Create New Motion Lighting App...'''[[File:Create new motion lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Motion Lighting rule and press '''Continue'''[[File:Naming Motion lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Select '''Motion Sensors''' to choose which motion sensors should trigger your lights. Check all that apply and press '''Update'''.[[File:Motion Lighting select motion sensors.png|none|thumb|600x600px]]&lt;br /&gt;
#Select the '''Lights to turn On''' when motion is detected[[File:Motion lighting - selecting lights.png|none|thumb|600x600px]]&lt;br /&gt;
#You will now have several choices of device types you can turn ''on'' with your motion sensors, plus the option to set an '''Off Delay per mode'''.[[File:Motion Lighting Scenes per mode.png|none|thumb|757x757px]]&lt;br /&gt;
#:'''Use Delay Per Mode'''&lt;br /&gt;
#:By default, your lights will turn ''off'' whenever motion stops being detected. To avoid this, you can set a delay after the last motion is detected, and before the lights turn ''off''. Toggle the '''Use delay per mode''' switch at the top. ''Off'' delay fields will appear for each mode you have selected. Enter the number of minutes you want to delay the lights turning ''off''.&lt;br /&gt;
#:'''Set these dimmers per mode'''&lt;br /&gt;
#:Select the dimmers you want to active and for which modes. You will also be asked to set the dimmer level.&lt;br /&gt;
#:'''Set color temperature per mode for these bulbs'''&lt;br /&gt;
#:If you have bulbs with variable color temperatures, select them here. Choose the modes during which they will be active, and what color temperature you want them to display.&lt;br /&gt;
#:'''Set color per mode for these bulbs'''&lt;br /&gt;
#:If you have color-changing bulbs, select them here. Select the modes during which they will be active and what color you want them to be.&lt;br /&gt;
#:'''Push button per mode'''&lt;br /&gt;
#:Select a button you would also like Motion Lighting to push when motion is activated. This will trigger whatever action you have set for the button in Button Controller, Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; or other apps. Select the modes for which this will be active.&lt;br /&gt;
#:'''Turn on a switches per mode'''&lt;br /&gt;
#:Select which switches you would like to turn ''on'' when motion is activated and select the modes for which the switches will be active.&lt;br /&gt;
#:'''Select Scenes per mode'''&lt;br /&gt;
#:Select the scenes you would like to turn ''on'' when motion is activated. You can select a different scene for each mode.&lt;br /&gt;
#When finished setting up your Motion Lighting app, press the '''Done''' button.&lt;br /&gt;
&lt;br /&gt;
====Setting Options for Activate, Disable, and Enable Lights-On====&lt;br /&gt;
You have now created a functional motion lighting child app, with a motion trigger and some lights. If you want to add some additional options, choose '''Options for Activate, Disable, and Enable Lights-On'''.&lt;br /&gt;
&lt;br /&gt;
#You will be presented with a list of options and may select as many as you want, leaving any options you don't want blank.[[File:Motion Lighting active and disable options.png|none|thumb|606x606px]]&lt;br /&gt;
#:'''Buttons to turn on lights'''&lt;br /&gt;
#:Select any buttons you'd like to use to manually turn ''on'' your specified lights. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button). If you only define a button to turn ''on'' the light, turning the light ''off'' will be handled solely by motion sensor activity.&lt;br /&gt;
#:'''Buttons to toggle on/off'''&lt;br /&gt;
#:Select any buttons you'd like to use to manually toggle the lights ''on'' and ''off''. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Buttons to disable on'''&lt;br /&gt;
#:Select any buttons you'd like to use to disable this motion lighting child app and prevent the lights from turning ''on'' with motion when pressed. This is helpful to prevent lights from turning ''on'' in a bedroom, for example. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Button to enable turning on/off'''&lt;br /&gt;
#:If you selected a button to disable the child app, you can re-enable it with a different button. This is different from '''Buttons to toggle on/off''', which simple toggles the light on or off without affecting the motion sensor input. Defining a button here will allow the motion lighting child app to once again respond to your defined motion sensor(s). Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Enable on/off at Time'''&lt;br /&gt;
#:If you use a button or switch to manually disable your motion lighting child app, you can use this option to automatically re-enable at sunrise, sunset or a specific. This option does not turn your lights ''on'' immediately, it merely re-enables the motion lighting child app at a specified time, so it will once again respond to motion.&lt;br /&gt;
#:'''Enable override with dimmer level change''' '''(defaults is enabled)'''&lt;br /&gt;
#:Disable this option if you don't want to prevent a motion inactive from turning the lights ''off'', and stop additional motion active events from changing the dimmer level if you manually adjust it. Keep this option enabled if you want to be able to manually set lights low or bright, without the motion lighting settings overriding your manual dimmer setting when motion is detected.&lt;br /&gt;
#:'''Override for level only (default is automation suspend)'''&lt;br /&gt;
#:If this option is enabled, motion active events will not change your manual dimmer level settings, but when no motion is detected, the lights will still turn ''off'' when your specified time has elapsed.&lt;br /&gt;
#:'''Switch to disable turning on'''&lt;br /&gt;
#:Select any switches you'd like to use to disable this child app so lights will not turn ''on'' when this switch is ''on'', even if motion is detected.&lt;br /&gt;
#:'''Turn on only between two times'''&lt;br /&gt;
#:Select a window of time when you would like your motion lighting child app to be active.&lt;br /&gt;
#:'''Turn on only if lux is less than this value'''&lt;br /&gt;
#:Select a lux sensor and select a value (1-10000). The lights will only turn ''on'' if the lux value is below this level.&lt;br /&gt;
#:'''Select a fade time for the lights'''&lt;br /&gt;
#:Enter a fade time for your dimmers if supported by the device.&lt;br /&gt;
#:'''Adjust levels when mode changes'''&lt;br /&gt;
#:If the lights are ''on'' when the mode changes, they will be set to the new level as defined by '''Set these dimmers per mode'''&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''''.''&lt;br /&gt;
&lt;br /&gt;
====Options for Additional Sensors, Lights-Off and Off options====&lt;br /&gt;
Now that you have your options for '''On''' selected, let's turn our attention to the '''Off''' options. If you want to add some additional options, choose '''Options for Additional Sensors, Lights-Off and Off options'''.&lt;br /&gt;
&lt;br /&gt;
#Again, we are presented with a series of options for controlling when the motion-activated lights will turn ''off''.[[File:Motion Lighting Options for OFF.png|none|thumb|600x600px]]&lt;br /&gt;
#:'''Additional Motion Sensors to keep on'''&lt;br /&gt;
#:Selecting motion sensors in this section will not trigger the lights to turn ''on'', but if the lights have been triggered by the primary selected sensor, they will stay on as long as this sensor is active. (Example: you can put a sensor in the shower that will not trigger the bathroom lights to turn ''on'', but will ensure they will remain ''on'' as long as someone is in the shower).&lt;br /&gt;
#:'''Additional Switches to turn off lights'''&lt;br /&gt;
#:Select any switches that are not already included in your setup, and you would like these switches to automatically turn ''off'' when motion becomes inactive. For example, these might be switches that you always manually turn ''on'', such as a bathroom exhaust fan, but you want it to always turn ''off'' when motion stops.&lt;br /&gt;
#:'''Button to Push when turned off'''&lt;br /&gt;
#:Select any buttons you would like to be automatically pushed when motion becomes inactive.&lt;br /&gt;
#:'''Minutes to delay before off'''&lt;br /&gt;
#:Set the number of minutes following the last motion sensed, for which you would like to delay the ''off'' state. It's a good idea to set a delay of at least a minute to prevent lights from turning ''off'' while people are still in the room.&lt;br /&gt;
#:'''Buttons to turn off lights'''&lt;br /&gt;
#:Select the buttons you wish to use to manually turn ''off'' lights, rather than waiting for motion inactive and delay before ''off''.&lt;br /&gt;
#:'''Switches to turn off lights'''&lt;br /&gt;
#:Select any switches you wish to use to manually turn ''off'' lights, rather than waiting for motion inactive and delay before ''off''.&lt;br /&gt;
#:'''Don't turn off if already on'''&lt;br /&gt;
#:Enabling this option will force any light that was already ''on'' before motion began, to not turn ''off'' when the motion stops.&lt;br /&gt;
#:'''Buttons to disable off'''&lt;br /&gt;
#:Select a button that will override any ''off'' automations and keep your motion lights ''on,'' even if motion stops.&lt;br /&gt;
#:'''Modes to disable Turning off'''&lt;br /&gt;
#:Select the modes during which your lights will not turn ''off'' even when motion stops. Your motion lights will still turn on during these modes (unless you disable them in the previous section).&lt;br /&gt;
#:'''Switch to disable off'''&lt;br /&gt;
#:Select a switch that will override any ''off'' automations and keep your motion lights ''on,'' even if motion stops.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''.&lt;br /&gt;
#::'''Control with Alexa or Google Home using this name'''&lt;br /&gt;
#::You can also specify a name you wish to use for control of these lights using Amazon Alexa or Google Home. Select a name that is clear and easy for your voice assistant to understand.&lt;br /&gt;
#:'''NOTE''':  If you are using Motion Lighting to turn lights ''on'' and a switch to turn them ''off'', you will need to have the switch itself selected in '''Options for lights off'''. If you don't, and you turn your lights off outside of your ''Motion Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and won't turn them ''on'' again from new motion before the timer to turn them off runs out. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your Motion Lighting app, select '''Done'''.&lt;br /&gt;
&lt;br /&gt;
==='''Creating a Mode Lighting App'''===&lt;br /&gt;
Mode Lighting apps work similar to Motion Lighting apps, but allow you to set lighting that is triggered by mode changes, rather than motion sensors.&lt;br /&gt;
&lt;br /&gt;
#Open the Motion Lighting Apps in your Hubitat Web Interface&lt;br /&gt;
#Select '''Create New Motion Lighting App...'''[[File:Create new Mode Lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Mode Lighting app[[File:Mode Lighting - enter name.png|none|thumb|600x600px]]&lt;br /&gt;
#Select '''Lights to turn On''' to choose lights you want controlled by mode changes.[[File:Mode Lighting - Lights to turn On.png|none|thumb|600x600px]][[File:Mode Lighting - options for Lights to turn On.png|none|thumb|600x600px]][[File:Mode Lighting - Lights to turn ON - defined.png|none|thumb|900x900px]]&lt;br /&gt;
#:'''Set these dimmers per mode'''&lt;br /&gt;
#:Select the dimmers you want activated, and by which modes. You will also be asked to set the dimmer level.&lt;br /&gt;
#:'''Set color temperature per mode for these bulbs'''&lt;br /&gt;
#:Select the color temperature adjustable bulbs you want triggered, and then choose the modes you want to trigger them. Finally, set the color temperature you want these lights to display for each mode you selected.&lt;br /&gt;
#:'''Set color per mode for these bulbs'''&lt;br /&gt;
#:Select the RGB or RBGW color bulbs you want triggered, and then the modes you want to trigger them. Finally, set the bulb color and level you want these lights to display for each mode you selected.&lt;br /&gt;
#:'''Push button per mode'''&lt;br /&gt;
#:Here you can specify a button per mode you want pushed, when a mode change occurs. '''NOTE''': ''You can specify different buttons per mode, but only within a single button controller.''&lt;br /&gt;
#:'''Turn on a switches per mode'''&lt;br /&gt;
#:Select the switches you want to turn ''on'' and the modes you would like it triggered. This will turn ''on'' whatever light or appliance is activated by the switch.&lt;br /&gt;
#:&lt;br /&gt;
#:'''NOTE''':  If you are using Mode Lighting to turn lights ''on'' in modes where you don't want motion to turn ''on'' the lights, you will need to have the switch itself selected in '''Options for lights off''', explained below. If you don't, and you turn your lights off outside of your ''Mode Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and will execute any adjustments per mode you specified, instead of turning them ''on'' to the adjustments per mode you are expecting to happen from an ''off'' state. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''&lt;br /&gt;
&lt;br /&gt;
====Options for lights on====&lt;br /&gt;
&lt;br /&gt;
#If you want the option to turn these lights on outside of mode changes, select '''Options for lights on'''. Choose buttons and/or switches you want to use to turn on the lights manually.&lt;br /&gt;
#If your lights are already on at the time of a mode change, but you want their levels to adjust based on your ''Mode Lighting app'', enable the  '''Adjust levels when mode changes''' option''.''[[File:Mode Lighting Options for ON.png|none|thumb|600x600px]]&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''.&lt;br /&gt;
&lt;br /&gt;
====Options for lights off====&lt;br /&gt;
&lt;br /&gt;
#Choose from the following options for turning lights and switches ''off'', or activating buttons when your mode lighting app turns off the lights. You can also specify buttons and/or switches that can override you mode lighting child app, and immediately turn off lights.&lt;br /&gt;
#:'''Additional Switches to Turn Off'''&lt;br /&gt;
#:Here you can select switches that you’d like turned off when your mode lighting child app is triggered.&lt;br /&gt;
#:'''Buttons to Push when turned off'''&lt;br /&gt;
#:Select any buttons you would like activated when the mode lighting child app turns the lights off.&lt;br /&gt;
#:'''Buttons to turn off lights'''&lt;br /&gt;
#:Select the buttons you would like to use to immediately turn off your lights, overriding your mode lighting settings.&lt;br /&gt;
#:'''Switches to turn off lights'''&lt;br /&gt;
#:Select the switches you would like to use to immediately turn off your lights, overriding your mode lighting settings.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''&lt;br /&gt;
#:&lt;br /&gt;
#:'''Control with Alexa or Google Home using this name'''&lt;br /&gt;
#:You can also specify a name you wish to use for control of these lights using Amazon Alexa or Google Home. Select a name that is clear and easy for your voice assistant to understand.&lt;br /&gt;
#:&lt;br /&gt;
#:'''NOTE''':  If you are using Mode Lighting to turn lights ''on'' in modes where you don't want motion to turn ''on'' the lights, you will need to have the switch itself selected in '''Options for lights off'''. If you don't, and you turn your lights off outside of your ''Mode Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and will execute any adjustments per mode you specified, instead of turning them ''on'' to the adjustments per mode you are expecting to happen from an ''off'' state. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your Mode Lighting app, select '''Done'''.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Motion_Lighting_Apps&amp;diff=2271</id>
		<title>Motion Lighting Apps</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Motion_Lighting_Apps&amp;diff=2271"/>
		<updated>2019-08-12T17:00:33Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Motion Lighting Apps offer a quick way to automate your lighting to be triggered by motion sensors or modes. The setup for Motion Lighting and Mode Lighting apps are slightly different. Here's how to start: &lt;br /&gt;
&lt;br /&gt;
==='''Installing the Motion Lighting apps'''===&lt;br /&gt;
&lt;br /&gt;
#From the Hubitat Web Interface select '''Apps'''[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose Motion Lighting Apps from the list of Hubitat Elevation™ Built-In Apps[[File:Install Motion Lighting Apps.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
==='''Creating a Motion Lighting App'''===&lt;br /&gt;
&lt;br /&gt;
#Open the Motion Lighting Apps in your Hubitat Web Interface&lt;br /&gt;
#Select '''Create New Motion Lighting App...'''[[File:Create new motion lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Motion Lighting rule and press '''Continue'''[[File:Naming Motion lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Select '''Motion Sensors''' to choose which motion sensors should trigger your lights. Check all that apply and press '''Update'''.[[File:Motion Lighting select motion sensors.png|none|thumb|600x600px]]&lt;br /&gt;
#Select the '''Lights to turn On''' when motion is detected[[File:Motion lighting - selecting lights.png|none|thumb|600x600px]]&lt;br /&gt;
#You will now have several choices of device types you can turn ''on'' with your motion sensors, plus the option to set an '''Off Delay per mode'''.[[File:Motion Lighting Scenes per mode.png|none|thumb|757x757px]]&lt;br /&gt;
#:'''Use Delay Per Mode'''&lt;br /&gt;
#:By default, your lights will turn ''off'' whenever motion stops being detected. To avoid this, you can set a delay after the last motion is detected, and before the lights turn ''off''. Toggle the '''Use delay per mode''' switch at the top. ''Off'' delay fields will appear for each mode you have selected. Enter the number of minutes you want to delay the lights turning ''off''.&lt;br /&gt;
#:'''Set these dimmers per mode'''&lt;br /&gt;
#:Select the dimmers you want to active and for which modes. You will also be asked to set the dimmer level.&lt;br /&gt;
#:'''Set color temperature per mode for these bulbs'''&lt;br /&gt;
#:If you have bulbs with variable color temperatures, select them here. Choose the modes during which they will be active, and what color temperature you want them to display.&lt;br /&gt;
#:'''Set color per mode for these bulbs'''&lt;br /&gt;
#:If you have color-changing bulbs, select them here. Select the modes during which they will be active and what color you want them to be.&lt;br /&gt;
#:'''Push button per mode'''&lt;br /&gt;
#:Select a button you would also like Motion Lighting to push when motion is activated. This will trigger whatever action you have set for the button in Button Controller, Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; or other apps. Select the modes for which this will be active.&lt;br /&gt;
#:'''Turn on a switches per mode'''&lt;br /&gt;
#:Select which switches you would like to turn ''on'' when motion is activated and select the modes for which the switches will be active.&lt;br /&gt;
#:'''Select Scenes per mode'''&lt;br /&gt;
#:Select the scenes you would like to turn ''on'' when motion is activated. You can select a different scene for each mode.&lt;br /&gt;
#When finished setting up your Motion Lighting app, press the '''Done''' button.&lt;br /&gt;
&lt;br /&gt;
====Setting Options for Activate, Disable, and Enable Lights-On====&lt;br /&gt;
You have now created a functional motion lighting child app, with a motion trigger and some lights. If you want to add some additional options, choose '''Options for Activate, Disable, and Enable Lights-On'''.&lt;br /&gt;
&lt;br /&gt;
#You will be presented with a list of options and may select as many as you want, leaving any options you don't want blank.[[File:Motion Lighting active and disable options.png|none|thumb|606x606px]]&lt;br /&gt;
#:'''Buttons to turn on lights'''&lt;br /&gt;
#:Select any buttons you'd like to use to manually turn ''on'' your specified lights. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button). If you only define a button to turn ''on'' the light, turning the light ''off'' will be handled solely by motion sensor activity.&lt;br /&gt;
#:'''Buttons to toggle on/off'''&lt;br /&gt;
#:Select any buttons you'd like to use to manually toggle the lights ''on'' and ''off''. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Buttons to disable on'''&lt;br /&gt;
#:Select any buttons you'd like to use to disable this motion lighting child app and prevent the lights from turning ''on'' with motion when pressed. This is helpful to prevent lights from turning ''on'' in a bedroom, for example. Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Button to enable turning on/off'''&lt;br /&gt;
#:If you selected a button to disable the child app, you can re-enable it with a different button. This is different from '''Buttons to toggle on/off''', which simple toggles the light on or off without affecting the motion sensor input. Defining a button here will allow the motion lighting child app to once again respond to your defined motion sensor(s). Enter the button number into the field (enter &amp;quot;1&amp;quot; if the controller only has one button).&lt;br /&gt;
#:'''Enable on/off at Time'''&lt;br /&gt;
#:If you use a button or switch to manually disable your motion lighting child app, you can use this option to automatically re-enable at sunrise, sunset or a specific. This option does not turn your lights ''on'' immediately, it merely re-enables the motion lighting child app at a specified time, so it will once again respond to motion.&lt;br /&gt;
#:'''Enable override with dimmer level change''' '''(defaults is enabled)'''&lt;br /&gt;
#:Disable this option if you don't want to prevent a motion inactive from turning the lights ''off'', and stop additional motion active events from changing the dimmer level if you manually adjust it. Keep this option enabled if you want to be able to manually set lights low or bright, without the motion lighting settings overriding your manual dimmer setting when motion is detected.&lt;br /&gt;
#:'''Override for level only (default is automation suspend)'''&lt;br /&gt;
#:If this option is enabled, motion active events will not change your manual dimmer level settings, but when no motion is detected, the lights will still turn ''off'' when your specified time has elapsed.&lt;br /&gt;
#:'''Switch to disable turning on'''&lt;br /&gt;
#:Select any switches you'd like to use to disable this child app so lights will not turn ''on'' when this switch is ''on'', even if motion is detected.&lt;br /&gt;
#:'''Turn on only between two times'''&lt;br /&gt;
#:Select a window of time when you would like your motion lighting child app to be active.&lt;br /&gt;
#:'''Turn on only if lux is less than this value'''&lt;br /&gt;
#:Select a lux sensor and select a value (1-10000). The lights will only turn ''on'' if the lux value is below this level.&lt;br /&gt;
#:'''Select a fade time for the lights'''&lt;br /&gt;
#:Enter a fade time for your dimmers if supported by the device.&lt;br /&gt;
#:'''Adjust levels when mode changes'''&lt;br /&gt;
#:If the lights are ''on'' when the mode changes, they will be set to the new level as defined by '''Set these dimmers per mode'''&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''''.''&lt;br /&gt;
&lt;br /&gt;
====Options for Additional Sensors, Lights-Off and Off options====&lt;br /&gt;
Now that you have your options for '''On''' selected, let's turn our attention to the '''Off''' options. If you want to add some additional options, choose '''Options for Additional Sensors, Lights-Off and Off options'''.&lt;br /&gt;
&lt;br /&gt;
#Again, we are presented with a series of options for controlling when the motion-activated lights will turn ''off''.[[File:Motion Lighting Options for OFF.png|none|thumb|600x600px]]&lt;br /&gt;
#:'''Additional Motion Sensors to keep on'''&lt;br /&gt;
#:Selecting motion sensors in this section will not trigger the lights to turn ''on'', but if the lights have been triggered by the primary selected sensor, they will stay on as long as this sensor is active. (Example: you can put a sensor in the shower that will not trigger the bathroom lights to turn ''on'', but will ensure they will remain ''on'' as long as someone is in the shower).&lt;br /&gt;
#:'''Additional Switches to turn off lights'''&lt;br /&gt;
#:Select any switches that are not already included in your setup, and you would like these switches to automatically turn ''off'' when motion becomes inactive. For example, these might be switches that you always manually turn ''on'', such as a bathroom exhaust fan, but you want it to always turn ''off'' when motion stops.&lt;br /&gt;
#:'''Button to Push when turned off'''&lt;br /&gt;
#:Select any buttons you would like to be automatically pushed when motion becomes inactive.&lt;br /&gt;
#:'''Minutes to delay before off'''&lt;br /&gt;
#:Set the number of minutes following the last motion sensed, for which you would like to delay the ''off'' state. It's a good idea to set a delay of at least a minute to prevent lights from turning ''off'' while people are still in the room.&lt;br /&gt;
#:'''Buttons to turn off lights'''&lt;br /&gt;
#:Select the buttons you wish to use to manually turn ''off'' lights, rather than waiting for motion inactive and delay before ''off''.&lt;br /&gt;
#:'''Switches to turn off lights'''&lt;br /&gt;
#:Select any switches you wish to use to manually turn ''off'' lights, rather than waiting for motion inactive and delay before ''off''.&lt;br /&gt;
#:'''Don't turn off if already on'''&lt;br /&gt;
#:Enabling this option will force any light that was already ''on'' before motion began, to not turn ''off'' when the motion stops.&lt;br /&gt;
#:'''Buttons to disable off'''&lt;br /&gt;
#:Select a button that will override any ''off'' automations and keep your motion lights ''on,'' even if motion stops.&lt;br /&gt;
#:'''Modes to disable Turning off'''&lt;br /&gt;
#:Select the modes during which your lights will not turn ''off'' even when motion stops. Your motion lights will still turn on during these modes (unless you disable them in the previous section).&lt;br /&gt;
#:'''Switch to disable off'''&lt;br /&gt;
#:Select a switch that will override any ''off'' automations and keep your motion lights ''on,'' even if motion stops.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''.&lt;br /&gt;
#::'''Control with Alexa or Google Home using this name'''&lt;br /&gt;
#::You can also specify a name you wish to use for control of these lights using Amazon Alexa or Google Home. Select a name that is clear and easy for your voice assistant to understand.&lt;br /&gt;
#:'''NOTE''':  If you are using Motion Lighting to turn lights ''on'' and a switch to turn them off, you will need to have the switch itself selected in '''Options for lights off'''. If you don't, and you turn your lights off outside of your ''Motion Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and won't turn them on again from new motion before the timer to turn them off runs out. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your Motion Lighting app, select '''Done'''.&lt;br /&gt;
&lt;br /&gt;
==='''Creating a Mode Lighting App'''===&lt;br /&gt;
Mode Lighting apps work similar to Motion Lighting apps, but allow you to set lighting that is triggered by mode changes, rather than motion sensors.&lt;br /&gt;
&lt;br /&gt;
#Open the Motion Lighting Apps in your Hubitat Web Interface&lt;br /&gt;
#Select '''Create New Motion Lighting App...'''[[File:Create new Mode Lighting app.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Mode Lighting app[[File:Mode Lighting - enter name.png|none|thumb|600x600px]]&lt;br /&gt;
#Select '''Lights to turn On''' to choose lights you want controlled by mode changes.[[File:Mode Lighting - Lights to turn On.png|none|thumb|600x600px]][[File:Mode Lighting - options for Lights to turn On.png|none|thumb|600x600px]][[File:Mode Lighting - Lights to turn ON - defined.png|none|thumb|900x900px]]&lt;br /&gt;
#:'''Set these dimmers per mode'''&lt;br /&gt;
#:Select the dimmers you want activated, and by which modes. You will also be asked to set the dimmer level.&lt;br /&gt;
#:'''Set color temperature per mode for these bulbs'''&lt;br /&gt;
#:Select the color temperature adjustable bulbs you want triggered, and then choose the modes you want to trigger them. Finally, set the color temperature you want these lights to display for each mode you selected.&lt;br /&gt;
#:'''Set color per mode for these bulbs'''&lt;br /&gt;
#:Select the RGB or RBGW color bulbs you want triggered, and then the modes you want to trigger them. Finally, set the bulb color and level you want these lights to display for each mode you selected.&lt;br /&gt;
#:'''Push button per mode'''&lt;br /&gt;
#:Here you can specify a button per mode you want pushed, when a mode change occurs. '''NOTE''': ''You can specify different buttons per mode, but only within a single button controller.''&lt;br /&gt;
#:'''Turn on a switches per mode'''&lt;br /&gt;
#:Select the switches you want to turn ''on'' and the modes you would like it triggered. This will turn ''on'' whatever light or appliance is activated by the switch.&lt;br /&gt;
#:&lt;br /&gt;
#:'''NOTE''':  If you are using Mode Lighting to turn lights ''on'' in modes where you don't want motion to turn ''on'' the lights, you will need to have the switch itself selected in '''Options for lights off''', explained below. If you don't, and you turn your lights off outside of your ''Mode Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and will execute any adjustments per mode you specified, instead of turning them ''on'' to the adjustments per mode you are expecting to happen from an ''off'' state. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''&lt;br /&gt;
&lt;br /&gt;
====Options for lights on====&lt;br /&gt;
&lt;br /&gt;
#If you want the option to turn these lights on outside of mode changes, select '''Options for lights on'''. Choose buttons and/or switches you want to use to turn on the lights manually.&lt;br /&gt;
#If your lights are already on at the time of a mode change, but you want their levels to adjust based on your ''Mode Lighting app'', enable the  '''Adjust levels when mode changes''' option''.''[[File:Mode Lighting Options for ON.png|none|thumb|600x600px]]&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''.&lt;br /&gt;
&lt;br /&gt;
====Options for lights off====&lt;br /&gt;
&lt;br /&gt;
#Choose from the following options for turning lights and switches ''off'', or activating buttons when your mode lighting app turns off the lights. You can also specify buttons and/or switches that can override you mode lighting child app, and immediately turn off lights.&lt;br /&gt;
#:'''Additional Switches to Turn Off'''&lt;br /&gt;
#:Here you can select switches that you’d like turned off when your mode lighting child app is triggered.&lt;br /&gt;
#:'''Buttons to Push when turned off'''&lt;br /&gt;
#:Select any buttons you would like activated when the mode lighting child app turns the lights off.&lt;br /&gt;
#:'''Buttons to turn off lights'''&lt;br /&gt;
#:Select the buttons you would like to use to immediately turn off your lights, overriding your mode lighting settings.&lt;br /&gt;
#:'''Switches to turn off lights'''&lt;br /&gt;
#:Select the switches you would like to use to immediately turn off your lights, overriding your mode lighting settings.&lt;br /&gt;
#When you are satisfied with your chosen options, select '''Done'''&lt;br /&gt;
#:&lt;br /&gt;
#:'''Control with Alexa or Google Home using this name'''&lt;br /&gt;
#:You can also specify a name you wish to use for control of these lights using Amazon Alexa or Google Home. Select a name that is clear and easy for your voice assistant to understand.&lt;br /&gt;
#:&lt;br /&gt;
#:'''NOTE''':  If you are using Mode Lighting to turn lights ''on'' in modes where you don't want motion to turn ''on'' the lights, you will need to have the switch itself selected in '''Options for lights off'''. If you don't, and you turn your lights off outside of your ''Mode Lighting child app,'' then it won't know you did that. It will continue to register them as ''on'', and will execute any adjustments per mode you specified, instead of turning them ''on'' to the adjustments per mode you are expecting to happen from an ''off'' state. This includes turning lights off via Amazon Alexa or Google Home. You need to specify the same switch Alexa or Google Assistant is using to turn the light ''off'' in the '''Options for lights off'''.&lt;br /&gt;
#When you are satisfied with your Mode Lighting app, select '''Done'''.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=List_of_Compatible_Devices&amp;diff=2269</id>
		<title>List of Compatible Devices</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=List_of_Compatible_Devices&amp;diff=2269"/>
		<updated>2019-08-01T18:09:36Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The table below lists devices compatible with Hubitat Elevation™. You can sort the list by Brand Name, Protocol or Device Type to help you quickly find the device you are looking for. This list will be updated over time. &lt;br /&gt;
&lt;br /&gt;
Devices listed here are confirmed to have worked with Hubitat, this does not mean it is guaranteed to work with Hubitat.  Support cannot assist you with pairing devices with the hub.  Building a proper mesh network with repeaters is required to make most Zigbee and Z-Wave devices work with Hubitat. . &lt;br /&gt;
&lt;br /&gt;
Zigbee and Z-Wave devices require the correct drivers to connect and work properly with the hub. LAN and Cloud devices connect using the specific integration app listed and may require an additional bridge device to communicate.&lt;br /&gt;
&lt;br /&gt;
While this list includes devices known by Hubitat to work, there are countless other devices users have running on their hubs. Visit our [https://community.hubitat.com/t/compatible-devices-wiki/465 Community Devices Page] to see other devices users have running on their hubs. Some of these devices use custom drivers, for which support comes from the custom driver author, not from Hubitat. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Brand (click link for reset/join instructions)&lt;br /&gt;
!Device&lt;br /&gt;
!Product Number&lt;br /&gt;
!Device type&lt;br /&gt;
!Protocol&lt;br /&gt;
!Driver Name&lt;br /&gt;
!Integration App&lt;br /&gt;
!Additional Required Hardware&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#ADT                                 |ADT]]                    ||Zigbee Water Sensor                                     ||                  ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]             ||ERIA Motion Sensor                                      ||                  ||Motion Sensor         ||Zigbee||ERIA Motion Sensor                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]             ||ERIA Dimmer Switch                                      ||                  ||Button Controller     ||Zigbee||ERIA Dimmer Switch                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#AduroSmart                          |AduroSmart]]             ||ERIA Contact Sensor                                     ||                  ||Contact Sensor        ||Zigbee||ERIA Contact Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Siren 6                                                 ||ZW164-A           ||Siren                 ||Z-Wave||Aeotec Siren 6                            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Doorbell 6                                              ||ZW162-A           ||Doorbell              ||Z-Wave||Aeotec Doorbell 6                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Nano Switch                                             ||ZW116             ||Switch                ||Z-Wave||Aeotec Nano Switch                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Nano Switch                                             ||ZW139             ||Switch                ||Z-Wave||Aeotec Nano Switch                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||WallMote Quad                                           ||ZW130             ||Button Controller     ||Z-Wave||Aeon WallMote                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Contact Sensor                                          ||DSB04100          ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Door/Window Sensor Gen 2                                ||                  ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Doorbell                                                ||ZW056             ||Doorbell              ||Z-Wave||Aeon Labs Doorbell                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Dry Contact Sensor                                      ||ZW097-A           ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Micro Switch G2                                         ||DSC26103          ||Switch                ||Z-Wave||Aeon Micro Switch                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Home Energy Meter                                       ||                  ||Energy Meter          ||Z-Wave||Aeon Home Energy Meter                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||LED Bulb 6 Multi-Color                                  ||                  ||Bulb                  ||Z-Wave||Aeotec LED Bulb 6 Multi-Color             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Micro Illuminator G2                                    ||DSC27103          ||Dimmer                ||Z-Wave||Aeon Micro Dimmer                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Micro Motor Controllers                                 ||                  ||Motor Controller      ||Z-Wave||Aeon Motor Controller                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Minimote                                                ||DSA03202          ||Button Controller     ||Z-Wave||Aeon Minimote                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Motor Controller                                        ||                  ||Motor Controller      ||Z-Wave||Aeon Motor Controller                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||MultiSensor 5                                           ||                  ||Motion Sensor         ||Z-Wave||Aeon MultiSensor 6                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||MultiSensor 6                                           ||ZW100-A           ||Motion Sensor         ||Z-Wave||Aeon MultiSensor 6                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||NanoMote One                                            ||ZWA003-A          ||Button Controller     ||Z-Wave||Aeotec NanoMote                           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||NanoMote Quad                                           ||ZWA004-A          ||Button Controller     ||Z-Wave||Aeotec NanoMote                           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Recessed Door Sensor                                    ||DS854-ZWUS        ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Recessed Door Sensor Gen 5                              ||ZW089             ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Siren                                                   ||ZW080             ||Siren                 ||Z-Wave||Aeon Siren                                || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Smart Switch 6                                          ||ZW096AU           ||Outlet                ||Z-Wave||Aeotec Smart Switch 6                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Smart Switch 6                                          ||ZW096-A02         ||Outlet                ||Z-Wave||Aeotec Smart Switch 6                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Smart Switch 6                                          ||ZW110-B09         ||Outlet                ||Z-Wave||Aeotec Smart Switch 6                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Smart Switch 6                                          ||ZW096-A02         ||Outlet                ||Z-Wave||Aeotec Smart Switch 6                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Aeotec*                  ||Smart Switch 6                                          ||ZW110-B09         ||Outlet                ||Z-Wave||Aeotec Smart Switch 6                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||TriSensor                                               ||ZWA005-A          ||Motion Sensor         ||Z-Wave||Aeotec TriSensor                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||WallMote                                                ||ZW129-A           ||Button Controller     ||Z-Wave||Aeon WallMote                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Door Window Sensor 6                                    ||                  ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Range Extender 6                                        ||                  ||Repeater              ||Z-Wave||Generic Z-Wave Repeater                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||LED Bulb 5                                              ||ZW098-A52         ||Bulb                  ||Z-Wave||Aeon LED Bulb                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||LED Bulb 6 Multi-White                                  ||                  ||Bulb                  ||Z-Wave||Aeotec LED Bulb 6 Multi-White             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Range Extender                                          ||DSD37-ZWUS        ||Repeater              ||Z-Wave||Generic Z-Wave Repeater                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Garage Door Controller Gen 5                            ||                  ||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Aeotec .28Aeon Labs.29              |Aeotec*]]                ||Nano Dimmer                                             ||ZW111             ||Dimmer                ||Z-Wave||Aeotec Nano Dimmer                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Amazon                   ||Echo                                                    ||                  ||Voice Assistant       ||Cloud ||                                          ||Amazon Echo Skill||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#August                              |August]]                 ||August Pro Lock                                         ||                  ||Lock                  ||Z-Wave||August Pro Z-Wave Lock                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]                ||360 Ceiling Sensor                                      ||IX32              ||Motion Sensor         ||Z-Wave||BeSense Motion Sensor                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]                ||Door/Window Sensor                                      ||IM20              ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#BeSense                             |BeSense]]                ||PIR Wall Sensor                                         ||IX30              ||Motion Sensor         ||Z-Wave||BeSense Motion Sensor                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Bosch                    ||PIR Motion Detector                                     ||ISW-ZPR1-WP13     ||Motion Sensor         ||Zigbee||Bosch Motion Detector                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Bosch                    ||TriTech Motion Detector                                 ||ISW-ZDL1-WP11G    ||Motion Sensor         ||Zigbee||Bosch Motion Detector                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Contact Sensor                                          ||                  ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Micro Door Sensor                                       ||                  ||Contact Sensor        ||Zigbee||SmartSense Multi Sensor                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Motion Sensor                                           ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Outlet Plug-in                                          ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Smart Outlet                                            ||4200-C            ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Centralite                          |Centralite]]             ||Perl Thermostat                                         ||                  ||Thermostat            ||Zigbee||Generic Zigbee Thermostat                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#CREE                                |Cree]]                   ||Connected A-19 Bulb                                     ||                  ||Bulb                  ||Zigbee||Generic Zigbee Bulb                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Denon                    ||Audio Video Receivers                                   ||                  ||AVR                   ||LAN   ||Denon AVR                                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Door Sensor                                             ||DMWD1             ||Contact Sensor        ||Z-Wave||Dome Door Sensor                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Door/Window Sensor Pro                                  ||DMDP1             ||Contact Sensor        ||Z-Wave||Dome Door/Window Sensor Pro               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Leak Sensor                                             ||DMWS1             ||Water Sensor          ||Z-Wave||Dome Leak Sensor                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Motion Sensor                                           ||DMMS1             ||Motion Sensor         ||Z-Wave||Dome Motion Sensor                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Mouser                                                  ||DMMZ1             ||Mouse Trap            ||Z-Wave||Dome Mouser                               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||On/Off Plug                                             ||DMOF1             ||Outlet                ||Z-Wave||Dome On Off Plug                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Siren                                                   ||DMS01             ||Siren                 ||Z-Wave||Dome Siren                                || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Water Shutoff                                           ||DMWV1             ||Valve                 ||Z-Wave||Dome Water Shut-Off                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dome                                |Dome]]                   ||Dome Range Extender                                     ||DMEX1             ||Repeater              ||Z-Wave||Dome Range Extender                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Dragon Tech                         |Dragontech]]             ||Outlet                                                  ||                  ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Eaton .28Cooper Wiring Devices.29   |Eaton]]                  ||Dimmer                                                  ||RF9540            ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Ecobee                   ||                                                        ||                  ||Thermostat            ||Cloud ||                                          ||Ecobee Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Contact Sensor                                          ||DWZWAVE2.5-ECO    ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Garage Door Tilt Sensor                                 ||TILT-ZWAVE2       ||Tilt Sensor           ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Motion Sensor                                           ||PIRZWAVE2.5       ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Siren                                                   ||SC-ZWAVE5         ||Siren                 ||Z-Wave||Ecolink Siren                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Smoke/CO Audio Detector                                 ||FF-ZWAVE5         ||Smoke/CO Detector     ||Z-Wave||Ecolink Smoke/CO Audio Detector           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Tilt Sensor                                             ||TILTZWAVE2.5      ||Tilt Sensor           ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Wireless Double Rocker Switch                           ||DDLS2-ZWAVE5      ||Switch                ||Z-Wave||Ecolink Wireless Switch                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Wireless Rocker Switch                                  ||DLS-ZWAVE5        ||Switch                ||Z-Wave||Ecolink Wireless Switch                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Wireless Toggle Switch                                  ||TLS-ZWAVE5        ||Switch                ||Z-Wave||Ecolink Wireless Switch                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Flood/Freeze Sensor                                     ||FLF-ZWAVE5        ||Water Sensor          ||Z-Wave||Generic Z-Wave Water Sensor               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Ecolink                             |Ecolink]]                ||Wireless Double Toggle Switch                           ||DTLS2-ZWAVE5      ||Switch                ||Z-Wave||Ecolink Wireless Switch                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Enerwave                            |Enerwave]]               ||Duplex Outlet                                           ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Enerwave                            |Enerwave]]               ||Motion Sensor                                           ||                  ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]             ||Contact Sensor                                          ||HSM02             ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]             ||Flood Detector                                          ||ST812             ||Water Sensor          ||Z-Wave||Generic Z-Wave Water Sensor               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]             ||Motion Sensor                                           ||HSP02             ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]             ||Smoke Detector                                          ||SF813             ||Smoke Detector        ||Z-Wave||Generic Z-Wave Smoke Detector             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Everspring                          |Everspring]]             ||Temperature/Humidity Sensor                             ||ST814             ||Temperature Sensor    ||Z-Wave||Generic Z-Wave Temperature/Humidity Sensor|| ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Evolve                              |Evolve]]                 ||Relay                                                   ||LFM-20            ||Relay                 ||Z-Wave||Generic Z-Wave Relay                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Button                                                  ||FGPB-101          ||Button Controller     ||Z-Wave||Generic Z-Wave Button Controller          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Door/Window Sensor 2                                    ||FGDW-002          ||Contact Sensor        ||Z-Wave||Fibaro Door/Window Sensor 2               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Flood Sensor                                            ||FGFS-101          ||Water Sensor          ||Z-Wave||Fibaro Flood Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Flood Sensor ZW5                                        ||FGFS-101 ZW5      ||Water Sensor          ||Z-Wave||Fibaro Flood Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||KeyFob                                                  ||FGKF-601 ZW5      ||Button Controller     ||Z-Wave||Generic Z-Wave Button Controller          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Motion Sensor ZW5                                       ||FGMS-001          ||Motion Sensor         ||Z-Wave||Fibaro Motion Sensor ZW5                  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Fibaro RGBW Controller                                  ||FGRGBW-101        ||RGBW Controller       ||Z-Wave||Fibaro RGBW Controller                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Single Switch 2                                         ||FGS-213           ||Switch                ||Z-Wave||Fibaro Switch                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Wall Plug                                               ||FGWPB-111         ||Outlet                ||Z-Wave||Fibaro Wall Plug                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Wall Plug                                               ||FGWPB-121         ||Outlet                ||Z-Wave||Fibaro Wall Plug                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Fibaro                              |Fibaro]]                 ||Fibaro Dimmer 2                                         ||FGD-212           ||Dimmer                ||Z-Wave||Fibaro Dimmer                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#First Alert                         |First Alert]]            ||Smoke &amp;amp; CO Alarm                                        ||ZCOMBO            ||Smoke/CO Detector     ||Z-Wave||Generic Z-Wave Smoke/CO Detector          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |FortrezZ                 ||MIMO2+                                                  ||MIMO2+            ||Relay                 ||Z-Wave||Fortrezz MIMO2+                           || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |FortrezZ                 ||MIMOlite                                                ||MIMOlite          ||Relay                 ||Z-Wave||Fortrezz MIMOlite                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Link Bulb                                               ||                  ||Bulb                  ||Zigbee||Generic Zigbee Bulb                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Link Daylight Bulb                                      ||                  ||Bulb                  ||Zigbee||Generic Zigbee Bulb                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Link Soft White Bulb                                    ||                  ||Bulb                  ||Zigbee||Generic Zigbee Bulb                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Plug-In Smart Switch                                    ||12719/ZW4101      ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Plug-In Outdoor Smart Switch                            ||12720/ZW4201      ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||In-Wall Switch                                          ||12722/ZW4001      ||Switch                ||Z-Wave||Generic Z-Wave Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Fan Control                                       ||12730/ZW4002      ||Fan Controller        ||Z-Wave||GE Smart Fan Control                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Switch                                            ||14291             ||Switch                ||Z-Wave||Generic Z-Wave Smart Switch               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Dimmer                                            ||14294             ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Motion Switch                                     ||26931             ||Switch                ||Z-Wave||Jasco Z-Wave Motion Switch                || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Motion Dimmer                                     ||26993             ||Dimmer                ||Z-Wave||Jasco Z-Wave Motion Dimmer                || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||GE Smart Door Sensor                                    ||32563ZW6301       ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Switch                                                  ||45856             ||Switch                ||Zigbee||Generic Zigbee Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GE.2FJasco                          |GE/Jasco]]               ||Smart Dimmer                                            ||45857             ||Dimmer                ||Zigbee||Generic Zigbee Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]              ||Garage Door Controller                                  ||                  ||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]              ||Glass Break Detector                                    ||                  ||Glass Break Detector  ||Z-Wave||Generic Glass Break Detector              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#GoControl                           |GoControl]]              ||Z-Wave Thermostat                                       ||GC-TBZ48          ||Thermostat            ||Z-Wave||GoControl Z-Wave Thermostat               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Google                   ||Google Home Assistant                                   ||                  ||Voice Assistant       ||Cloud ||                                          ||Google Home Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Google                   ||Chromecast                                              ||                  ||Media Renderer        ||LAN   ||                                          ||Chromecast Integration (beta)||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Graber                              |Graber]]                 ||Z-Wave+ Roller Blinds                                   ||                  ||Shade Controller      ||Z-Wave||Generic Z-Wave Shade                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Halo Labs                           |Halo Labs]]              ||Halo+ Smoke Alarm                                       ||                  ||Smoke/CO Detector     ||Zigbee||Halo Smoke Alarm                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hampton Bay                         |Hampton Bay]]            ||Fan Controller                                          ||MR101Z            ||Fan Controller        ||Zigbee||                                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]                   ||Four-Key Scene Controller                               ||HKZW-SCN04        ||Button Controller     ||Z-Wave||Aeotec NanoMote                           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]                   ||One-Key Scene Controller                                ||HKZW-SCN01        ||Button Controller     ||Z-Wave||Aeotec NanoMote                           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Hank                                |Hank]]                   ||RGBW LED Bulb                                           ||HKZW-RGB01        ||Bulb                  ||Z-Wave||Hank RGBW LED Bulb                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#HomePro                             |HomePro]]                ||Outlet                                                  ||ZRP110            ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||HomeSeer Indicator Light Sensor                         ||HS-FS100-L+       ||Light Sensor          ||Z-Wave||HomeSeer Flex Sensor                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||HomeSeer Perimeter Water Sensor                         ||HS-FS100-W+       ||Water Sensor          ||Z-Wave||HomeSeer Flex Sensor                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||Wall Dimmer                                             ||HS-WD200+         ||Dimmer                ||Z-Wave||HomeSeer WD-200 Dimmer                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||Wall Switch                                             ||HS-WS200+         ||Switch                ||Z-Wave||Generic Z-Wave CentralScene Switch        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||ZWave Plus Door/Window Sensor                           ||HS-DS100+         ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Homeseer                            |Homeseer]]               ||Water Sensor                                            ||HS-LS100+         ||Water Sensor          ||Z-Wave||HomeSeer Leak Sensor                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |IFTTT                    ||                                                        ||                  ||                      ||Cloud ||                                          ||IFTTT Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]                   ||TRÅDFRI Bulb E26                                        ||1000lm Warm White ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]                   ||TRÅDFRI Outlet                                          ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IKEA                                |IKEA]]                   ||TRÅDFRI Signal Repeater                                 ||                  ||Repeater              ||Zigbee||                                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]               ||Outlet                                                  ||                  ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]               ||Switch                                                  ||                  ||Switch                ||Z-Wave||Generic Z-Wave Smart Switch               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]               ||Switch Module                                           ||                  ||Switch                ||Z-Wave||Generic Z-Wave Smart Switch               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Inovelli                            |Inovelli]]               ||Switch Module                                           ||                  ||Switch                ||Z-Wave||Generic Z-Wave Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Button                                               ||BTN900            ||Button Controller     ||Zigbee||Iris V1 Button                            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Care Pendant                                         ||PDT900            ||Button Controller     ||Zigbee||Iris V1 Care Pendant                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Door/Window Sensor                                   ||DWS800            ||Contact Sensor        ||Zigbee||Iris V1 Contact Sensor                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Keyfob                                               ||KEY903            ||Presence Sensor       ||Zigbee||Iris V1 Key Fob                           || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Motion Sensor                                        ||MOT800            ||Motion Sensor         ||Zigbee||Iris V1 Motion Sensor                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]] V1 (AlertMe.com)  ||V1 Smart Plug                                           ||SPG800            ||Outlet                ||Zigbee||Iris V1 Outlet                            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Button                                               ||3460-L            ||Button Controller     ||Zigbee||Iris Button Controller                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Door/Window Sensor                                   ||3320-L            ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||Garage Door Opener                                      ||GD-00Z-1          ||Garage Door Controller||Z-Wave||Generic Z-Wave Garage Door Opener         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Keypad                                               ||3405-L            ||Keypad                ||Zigbee||Iris V2 Keypad                            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V3 Keypad                                               ||iL02_1            ||Keypad                ||Zigbee||Iris V3 Keypad                            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Motion Sensor                                        ||3326-L            ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V3 Motion Sensor                                        ||iL07_1            ||Motion Sensor         ||Zigbee||Generic Zigbee Motion/Humidity Sensor     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Outlet                                               ||3210-L            ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||V2 Smart Fob                                            ||3450-L            ||Button Controller     ||Zigbee||Iris 4 Button Fob                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||Smart Plug Z-Wave Repeater                              ||3210-L            ||Repeater              ||Z-Wave||Generic Z-Wave Repeater                   || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#IRIS                                |Iris]]                   ||Smart Water Sensor                                      ||3315-L            ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#KEEN Home                           |KEEN Home]]              ||Smart Vent                                              ||                  ||Vent                  ||Zigbee||Keen Home Smart Vent                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |keyWe                    ||Lock                                                    ||                  ||Lock                  ||Z-Wave||keyWe Z-Wave Lock                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||10-Button Deadbolt                                      ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||10-Button Touch Deadbolt                                ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||5-Button Deadbolt                                       ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||5-Button Lever                                          ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||910/912 Lock                                            ||                  ||Lock                  ||Z-Wave||Generic Z-Wave Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Kwikset                             |Kwikset]]                ||Smartcode Lock                                          ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leak Intelligence                   |Leak Intelligence]]      ||Leak Gopher Valve                                       ||                  ||Valve                 ||Z-Wave||Generic Z-Wave Valve                      || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Fan Controller                                          ||                  ||Fan Controller        ||Z-Wave||Leviton Fan Controller                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Plug-in Appliance Module                                ||DZPA1             ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Plug-in Dimmer Module                                   ||VRMX1             ||Outlet                ||Z-Wave||Generic Z-Wave Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Smart Dimmer                                            ||DZ6HD-1BZ         ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Smart Dimmer                                            ||DZMX1             ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Scene controller                                        ||VRSC4             ||Button Controller     ||Z-Wave||Leviton VRSC4                             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Switch                                                  ||DZ15S             ||Switch                ||Z-Wave||Generic Z-Wave Smart Switch               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Dimmer                                                  ||VRI06-1LZ         ||Dimmer                ||Z-Wave||Generic Z-Wave Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Dimmer                                                  ||VRI10-1LZ         ||Dimmer                ||Z-Wave||Generic Z-Wave Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Switch                                                  ||DZS15-1LZ         ||Switch                ||Z-Wave||Generic Z-Wave Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Leviton                             |Leviton]]                ||Switch                                                  ||VRS15-1LZ         ||Switch                ||Z-Wave||Generic Z-Wave Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Life360                  ||Life360 App                                             ||                  ||Presence Sensor       ||Cloud ||                                          ||Life360 Connector||Compatible Smart Phone&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]                 ||Contact Sensor                                          ||WADWAZ-1          ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]                 ||Motion Sensor                                           ||WAPIRZ-1          ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion/Temperature Sensor  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Linear                              |Linear]]                 ||Siren                                                   ||WA105DBZ-1        ||Siren                 ||Z-Wave||Linear/Vision Siren                       || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Caséta Dimmers and Switches                             ||                  ||Dimmer                ||LAN   ||Lutron Dimmer, Lutron Switch              ||Lutron Integration||Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Caséta SmartBridge Pro                                  ||                  ||Bridge                ||LAN   ||Lutron Keypad                             ||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Pico Remotes                                            ||                  ||Button Controller     ||LAN   ||Lutron Pico, Lutron Fast Pico             ||Lutron Integration||Caséta SmartBridge Pro or Radio RA2&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Dimmers and Switches                           ||                  ||Dimmer                ||LAN   ||Lutron Dimmer, Lutron Switch              ||Lutron Integration||RadioRA2 Select or RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Keypads                                        ||                  ||Keypad                ||LAN   ||Lutron Keypad                             ||Lutron Integration||RadioRA2 Select or RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Main Repeater                                  ||                  ||Repeater              ||LAN   ||Lutron Keypad                             ||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Motion Sensors                                 ||                  ||Motion Sensor         ||LAN   ||Lutron Motion Sensor                      ||Lutron Integration||RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Select                                         ||                  ||Bridge                ||LAN   ||Lutron Keypad                             ||Lutron Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 VCRX Garage Controller                         ||                  ||Garage Controller     ||LAN   ||Lutron Keypad                             ||Lutron Integration||RadioRA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Serena Shades                                           ||                  ||Shade Control         ||LAN   ||Lutron Shade                              ||Lutron Integration||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Sivoia QS Triathlon Shades                              ||                  ||Shade Control         ||LAN   ||Lutron Shade                              ||Lutron Integration||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||RadioRA2 Thermostat                                     ||                  ||Thermostat            ||LAN   ||Lutron Thermostat                         ||Lutron Integration||RA2 Main Repeater&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lutron                              |Lutron]]                 ||Lutron Fan Control                                      ||                  ||Fan Controller        ||LAN   ||Lutron Thermostat                         ||Lutron Fan Control||RadioRA2 Select, RA2 Main Repeater or Caséta SmartBridge Pro&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Lux                                 |Lux]]                    ||Zigbee Thermostat                                       ||KONOz             ||Thermostat            ||Zigbee||LUX Zigbee Thermostat                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Marantz                  ||Audio Video Receivers                                   ||                  ||AVR                   ||LAN   ||Denon AVR                                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#MCO Home                            |MCOHome]]                ||Dimmer Switch                                           ||                  ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Contact Sensor                                          ||                  ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Outlet                                                  ||                  ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Plugin Dimmer                                           ||                  ||Dimmer                ||Z-Wave||Generic Z-Wave Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plugin On/Off                                    ||11995             ||Outlet                ||Z-Wave||Generic Z-Wave Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plus PIR Motion Detector With Temperature Sensor ||15271             ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion/Temperature Sensor  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plus PIR Multi Sensor                            ||15902             ||Motion Sensor         ||Z-Wave||Zooz 4-in-1 Sensor                        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plus Recessed Door/Window Sensor                 ||15268             ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plus Smart Plug and Repeater with 2 USB ports    ||27481             ||Outlet                ||Z-Wave||Zooz Power Switch                         || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Monoprice                           |Monoprice]]              ||Z-Wave Plus Door/Window Sensor                          ||15270             ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NanoLeaf                 ||Aurora Light Panels                                     ||                  ||Bulb                  ||LAN   ||Nanoleaf Aurora                           || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NanoLeaf                 ||Canvas Light Panels                                     ||                  ||Bulb                  ||LAN   ||Nanoleaf Aurora                           || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEEO                     ||NEEO Remote                                             ||                  ||AVR Remote            ||LAN   ||NEEO Remote                               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Door/Window Sensor                          ||NAS-DS02ZU        ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Door/Window Sensor                          ||NAS-DS01ZE        ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Motion Sensor                               ||NAS-PD01ZU-T      ||Motion Sensor         ||Z-Wave||Neo Coolcam Motion Sensor                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Power Plug                                  ||NAS-WR02Z*        ||Outlet                ||Z-Wave||Neo Coolcam Power Plug                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Remote Control 1                            ||NAS-RC03ZU        ||Button Controller     ||Z-Wave||Neo Coolcam Remote Control                || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Neo                                 |NEO]]                    ||NEO Coolcam Remote Control 4                            ||NAS-RC03ZU        ||Button Controller     ||Z-Wave||Neo Coolcam Remote Control                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEO                      ||Neo Coolcam Light Switch 1                              ||NAS-SC02ZU-1      ||Switch                ||Z-Wave||Neo Coolcam Light Switch                  || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |NEO                      ||Neo Coolcam Light Switch 2                              ||NAS-SC02ZU-2      ||Switch                ||Z-Wave||Neo Coolcam Light Switch                  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NodOn                               |NodOn]]                  ||Octan Remote                                            ||CRC-3US-1         ||Button Controller     ||Z-Wave||Generic Z-Wave Button Controller          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NodOn                               |NodOn]]                  ||Soft Remote                                             ||CRC-3US-6         ||Button Controller     ||Z-Wave||Generic Z-Wave Button Controller          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]                   ||Curtain Motion Sensor                                   ||NCZ-3045-HA       ||Motion Sensor         ||Zigbee||NYCE Motion Sensor Series                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]                   ||Celing Motion Censor                                    ||NCZ-3043-HA       ||Motion Sensor         ||Zigbee||NYCE Motion Sensor Series                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]                   ||Motion Sensor                                           ||NCZ-3041-HA       ||Motion Sensor         ||Zigbee||NYCE Motion Sensor Series                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]                   ||Garage Door (Tilt) Sensor                               ||NCZ-3014-HA       ||Contact Sensor        ||Zigbee||NYCE Iris Tilt Sensor                     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#NYCE                                |NYCE]]                   ||Door/Window Sensor                                      ||NCZ-3011-HA       ||Contact Sensor        ||Zigbee||NYCE Contact Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Onkyo                    ||Audio Video Receivers                                   ||                  ||AVR                   ||LAN   ||Onkyo AVR                                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orbit                               |Orbit]]                  ||Smart Hose Faucet Timer                                 ||27087             ||Irrigation Controller ||Zigbee||Orbit Hose Water Timer                    || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orbit                               |Orbit]]                  ||12-Station Sprinkler Controller                         ||27396             ||Irrigation Controller ||Zigbee||Orbit 12-Station Sprinkler Controller     || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Orvibo                              |Orvibo]]                 ||Motion Sensor                                           ||SN11              ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Lightify Flex RGBW                                      ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Smart+ Classic E27 Multicolor                           ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Lightify LED Classic B40 Tunable White 60W              ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Lightify LED Flood BR30 Tunable White                   ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Lightify LED Recessed Kit RT 5/6 Tunable                ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Lightify LED Tunable White 60W                          ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Osram                    ||Smart Outdoor Plug                                      ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ                      ||Contact Sensor                                          ||3300              ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ                      ||Moisture Sensor                                         ||3315              ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |PEQ                      ||Motion Sensor                                           ||3305              ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Dimmer Switch                                           ||                  ||Button Controller     ||Zigbee||Philips Dimmer Button Controller          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Ambiance White                                          ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Bloom Lights                                            ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGB Light                  ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Bridge                                                  ||                  ||Bridge                ||LAN   ||                                          ||Hue Bridge Integrator||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Living Colors Lights                                    ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGB Light                  ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Lux                                                     ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Motion Sensor                                           ||9290012607        ||Motion Sensor         ||Zigbee||Hue Motion Sensor                         || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Outdoor Motion Sensor                                   ||9290019758        ||Motion Sensor         ||Zigbee||Hue Motion Sensor                         || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||Strip Lights                                            ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGB Light                  ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||White and Color Ambiance LightStrip                     ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Philips Hue              ||White Ambiance                                          ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              ||Hue Bridge Integrator||Philips Hue Bridge (Optional, but recommended)&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Pioneer                  ||Audio Video Receivers                                   ||                  ||AVR                   ||LAN   ||Pioneer AVR                               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Pushover                 ||Pushover                                                ||                  ||Notification          ||Cloud ||Pushover driver                           || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||Relay                                                   ||                  ||Relay                 ||Z-Wave||Generic Z-Wave Relay                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||2 Relay Module                                          ||ZMNHBD3           ||Relay                 ||Z-Wave||Qubino 2 Relay Module                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||Relay Module                                            ||ZMNHND3           ||Relay                 ||Z-Wave||Qubino 1D Relay Module                    || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||DC Shutter Module                                       ||ZMNHOD3           ||Relay                 ||Z-Wave||Qubino Shutter Module                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||Shutter Module                                          ||ZMNHCD3           ||Relay                 ||Z-Wave||Qubino Shutter Module                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||Thermostat Module                                       ||ZMNHID3           ||Thermostat            ||Z-Wave||Qubino Thermostat Module                  || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||1 Relay Module                                          ||ZMNHAD3           ||Relay                 ||Z-Wave||Qubino 1 Relay Module                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Qubino                   ||Dimmer Module                                           ||ZMNHDD3           ||Dimmer                ||Z-Wave||Qubino Dimmer Module                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Quotra                   ||Quotra Wireless Smart Dimmer                            ||                  ||Dimmer                ||Zigbee||Generic Zigbee Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Rachio                   ||                                                        ||                  ||Irrigation Controller ||Cloud ||                                          ||Rachio Integration||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]                  ||CT100 Thermostat                                        ||CT100             ||Thermostat            ||Z-Wave||Generic Z-Wave Thermostat                 || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]                  ||CT101 Thermostat                                        ||CT101             ||Thermostat            ||Z-Wave||Radio Thermostat                          || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Radio Thermostat Company of America |Radio]]                  ||Thermostat Z-Wave USNAP Module                          ||                  ||Thermostat            ||Z-Wave||Generic Z-Wave Thermostat                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Remotec                  ||ZFM-80 relay                                            ||ZFM-80            ||Relay                 ||Z-Wave||Remotec ZFM-80                            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Remotec                  ||ZRC-90 Button Controller                                ||ZRC-90            ||Button Controller     ||Z-Wave||Remotec ZRC-90                            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |RGBgenie                 ||Single Color Wall Mounted Remote Controller             ||ZB-5121           ||Button Controller     ||Zigbee||RGBgenie Controller ZB-512x               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |RGBgenie                 ||Monochrome Controller Panel                             ||ZB-3026           ||Button Controller     ||Zigbee||RGBgenie Controller ZB-3026               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |RGBgenie                 ||Color Remote                                            ||ZB-5028           ||Button Controller     ||Zigbee||RGBgenie Controller ZB-5028               || ||&lt;br /&gt;
|-																   &lt;br /&gt;
                                                                   |Salus                    ||Smart Plug                                              ||SP600             ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Samsung                  ||Button V5                                               ||                  ||Button Controller     ||Zigbee||Samsung Zigbee Button                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Samsung                  ||Motion Sensor V5                                        ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Samsung                  ||Moisture Sensor V5                                      ||                  ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Samsung                  ||Multi Sensor V5                                         ||                  ||Contact Sensor        ||Zigbee||SmartThings Multipurpose Sensor V5        || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Schlage                             |Schlage]]                ||Lock                                                    ||FE599             ||Lock                  ||Z-Wave||Schlage FE599/BE369 Lock                  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Schlage                             |Schlage]]                ||Deadbolt Lock                                           ||BE369             ||Lock                  ||Z-Wave||Schlage FE599/BE369 Lock                  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Schlage                             |Schlage]]                ||Touchscreen Lock                                        ||BE468             ||Lock                  ||Z-Wave||Schlage BE468/BE469 Lock                  || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Schlage                             |Schlage]]                ||Touchscreen Lock                                        ||BE469             ||Lock                  ||Z-Wave||Schlage BE468/BE469 Lock                  || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled                  ||Element Classic Bulb                                    ||                  ||Bulb                  ||Zigbee||Sengled Element Classic                   || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled                  ||Element Plus Color Bulb                                 ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled                  ||Element Plus Plus Bulb                                  ||                  ||Bulb                  ||Zigbee||Generic Zigbee CT Bulb (dev)              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sengled                  ||Smart Window and Door Sensor                            ||E1D-G73WNA        ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sensative                ||Strips Guard                                            ||                  ||Contact Sensor        ||Z-Wave||Generic Z-Wave Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sensative                ||Strips Drips                                            ||                  ||Water Sensor          ||Z-Wave||Strips Multi-Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sensative                ||Strips Comfort                                          ||                  ||Temperature Sensor    ||Z-Wave||Strips Multi-Sensor                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |sharptools.io            ||                                                        ||                  ||Dashboard             ||Cloud ||                                          ||SharpTools||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart thermostat for electric heating                   ||TH1124ZB          ||Thermostat            ||Zigbee||Sinope TH1124ZB (4KW) Thermostat          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Low Voltage Thermostat                            ||TH1400ZB          ||Thermostat            ||Zigbee||Sinope TH1400ZB Thermostat                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Floor Heating Thermostat                          ||TH1300ZB          ||Thermostat            ||Zigbee||Sinope TH1300ZB Thermostat                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Electrical Load Controller                        ||RM3250ZB          ||Switch                ||Zigbee||Sinope load controller                    || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Water Leak Detector                               ||WL4200            ||Water Sensor          ||Zigbee||Sinope Moisture Sensor                    || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Water Leak Detector with Sensor                   ||WL4200S           ||Water Sensor          ||Zigbee||Sinope Moisture Sensor                    || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sinope                   ||Smart Water Valve                                       ||VA4200WZ          ||Valve                 ||Zigbee||Sinope water valve                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Contact Sensor                                          ||3300-S            ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||F-OUT-US-2                                              ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||F-SS-MULT-001/2                                         ||                  ||Motion Sensor         ||Zigbee||SmartSense Multi Sensor V4                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Humidity Sensor                                         ||3310-S            ||Humidity Sensor       ||Zigbee||SmartThings Humidity Sensor               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Moisture Sensor                                         ||3300-S            ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Moisture Sensor V4                                      ||                  ||Water Sensor          ||Zigbee||Generic Zigbee Moisture Sensor            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Motion Sensor                                           ||                  ||Motion Sensor         ||Zigbee||SmartSense Multi Sensor                   || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Motion Sensor V2                                        ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Motion Sensor V3                                        ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Motion Sensor V4                                        ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Multi Sensor                                            ||STSS-MULT-001     ||Motion Sensor         ||Zigbee||SmartSense Multi V1                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Multipupose Sensor V4                                   ||STS-MLT-250       ||Motion Sensor         ||Zigbee||SmartSense Multi Sensor V4                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Presence Sensor V2                                      ||                  ||Presence Sensor       ||Zigbee||SmartThings Presence Sensor V2            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Presence Sensor V4                                      ||                  ||Presence Sensor       ||Zigbee||SmartThings Presence Sensor V4            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |SmartThings              ||Versions 1, 2, 3 and 4                                  ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Somfy                    ||2 Button Controller                                     ||                  ||Button Controller     ||Z-Wave||Somfy 2 Button Controller                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sonos                    ||Speakers                                                ||                  ||Speaker               ||LAN   ||                                          ||Sonos Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sunricher                ||Dimmer Module                                           ||ZG9101SAC-HP      ||Dimmer                ||Zigbee||Generic Zigbee Dimmer                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart Contact Sensor                                    ||                  ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart Motion Sensor                                     ||                  ||Motion Sensor         ||Zigbee||Generic Zigbee Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart A19 RGBW                                          ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart BR30 RGBW                                         ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart Flex RGBW                                         ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart Outdoor RGBW Flex                                 ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart RT5/6 RGBW                                        ||                  ||Bulb                  ||Zigbee||Generic Zigbee RGBW Light                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Smart+ A19 Dimmable                                     ||                  ||Bulb                  ||Zigbee||Generic Zigbee Bulb                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Dimmer Switch                                           ||                  ||Button Controller     ||Zigbee||Sylvania Dimmer Switch Button Controller  || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Lightify Smart Switch                                   ||                  ||Button Controller     ||Zigbee||Lightify Smart Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Sylvania                 ||Sylvania Smart+                                         ||                  ||Outlet                ||Zigbee||Generic Zigbee Outlet                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Telguard                 ||Switch                                                  ||GDC1              ||Switch                ||Z-Wave||Generic Z-Wave Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Telldus                  ||Outlet Switch                                           ||                  ||Outlet                ||Z-Wave||Generic Z-Wave Smart Switch               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Third Reality            ||Switch                                                  ||                  ||Switch                ||Zigbee||Generic Zigbee Switch                     || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |TKB                      ||TKB Dimmer Socket                                       ||TZ67E             ||Dimmer                ||Z-Wave||Generic Z-Wave Smart Dimmer               || ||&lt;br /&gt;
|-&lt;br /&gt;
|[[Join and Reset Instructions#Utilitech                           |Utilitech]]              ||Siren                                                   ||                  ||Siren                 ||Z-Wave||Linear/Vision Siren                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Vision                   ||Siren                                                   ||zm1601US-3        ||Siren                 ||Z-Wave||Linear/Vision Siren                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Vision                   ||Siren                                                   ||zm1601US-5        ||Siren                 ||Z-Wave||Linear/Vision Siren                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Vision                   ||Vision Shock Sensor                                     ||ZS5101            ||Acceleration Sensor   ||Z-Wave||Generic Z-Wave Acceleration Sensor        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Visonic                  ||Window Door Sensor                                      ||MCT-340 E         ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Visonic                  ||Window Door Sensor                                      ||MCT-340 SMA       ||Contact Sensor        ||Zigbee||Generic Zigbee Contact Sensor             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |WaterCop                 ||Shutoff Valve                                           ||192390.02         ||Valve                 ||Z-Wave||Generic Z-Wave Valve                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Weather Underground      ||Weather Underground                                     ||                  ||Notification          ||Cloud ||WeatherUnderground                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Wireless                 ||Smoke Detector                                          ||ZWN-SD            ||Smoke Detector        ||Z-Wave||Generic Z-Wave Smoke Detector             || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Xfinity                  ||Xfinity 3400-X Keypad                                   ||3400              ||Keypad                ||Zigbee||Centralitle Keypad                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Assure Lock                                             ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Push Button Deadbolt Lock                               ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Push Button Lever Lock                                  ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Touch Screen Deadbolt Lock                              ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Touch Screen Lever Lock                                 ||                  ||Lock                  ||Zigbee||Generic Zigbee Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||Conexis L1                                              ||Conexis L1        ||Lock                  ||Z-Wave||Yale Conexis L1 Z-Wave Lock               || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yale                     ||YRD226 Lock                                             ||YRD226            ||Lock                  ||Z-Wave||Generic Z-Wave Lock                       || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yeelight                 ||Mono Bulb                                               ||                  ||Bulb                  ||LAN   ||Yeelight Bulb                             ||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yeelight                 ||Smart LED Bulb (CT)                                     ||                  ||Bulb                  ||LAN   ||Yeelight CT Bulb                          ||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yeelight                 ||Smart LED Bulb (Color and CT)                           ||                  ||Bulb                  ||LAN   ||Yeelight RGBW Bulb                        ||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Yeelight                 ||Smart LED Bulb (Color)                                  ||                  ||Bulb                  ||LAN   ||Yeelight RGB Bulb                         ||Yeelight Integration||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zen                      ||Thermostat                                              ||                  ||Thermostat            ||Zigbee||Zen Thermostat                            || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zipato                   ||Siren                                                   ||PH-PSE02          ||Siren                 ||Z-Wave||Zipato Siren                              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zlink                    ||ZL-WD-100 Dimmer                                        ||                  ||Dimmer                ||Z-Wave||Generic Z-Wave CentralScene Dimmer        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zlink                    ||ZL-WS-100 Switch                                        ||                  ||Switch                ||Z-Wave||Generic Z-Wave CentralScene Switch        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||4-in-1 Sensor                                           ||ZSE40             ||Motion Sensor         ||Z-Wave||Zooz 4-in-1 Sensor                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Dimmer Switch                                           ||ZEN22             ||Dimmer                ||Z-Wave||Zooz Central Scene Dimmer                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz On/Off Toggle                                      ||ZEN23             ||Switch                ||Z-Wave||Zooz Central Scene Switch                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz S2 On/Off Switch                                   ||ZEN26             ||Switch                ||Z-Wave||Zooz Central Scene Switch                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz Dimmer Toggle                                      ||ZEN24             ||Dimmer                ||Z-Wave||Zooz Central Scene Dimmer                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz S2 Dimmer                                          ||ZEN27             ||Dimmer                ||Z-Wave||Zooz Central Scene Dimmer                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Motion Sensor                                           ||ZSE02             ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Motion Sensor ZSE18                                     ||ZSE18             ||Motion Sensor         ||Z-Wave||Zooz Motion Sensor ZSE18                  || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Power Strip                                             ||ZEN20             ||Power Strip           ||Z-Wave||Zooz Power Strip                          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Power Strip VER 2.0                                     ||ZEN20             ||Power Strip           ||Z-Wave||Zooz Power Strip                          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Power Switch                                            ||ZEN15             ||Switch                ||Z-Wave||Zooz Power Switch                         || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Smart Chime                                             ||ZSE33             ||Doorbell              ||Z-Wave||Dome Siren                                || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Smart Plug                                              ||ZEN06             ||Outlet                ||Z-Wave||Zooz Power Switch                         || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Smart Switch                                            ||ZEN21             ||Switch                ||Z-Wave||Zooz Central Scene Switch                 || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Water Valve                                             ||                  ||Valve                 ||Z-Wave||Generic Z-Wave Valve                      || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Water Sensor                                            ||ZSE30             ||Water Sensor          ||Z-Wave||Dome Leak Sensor                          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Motion and Light Mini Sensor                            ||ZSE09             ||Motion Sensor         ||Z-Wave||Dome Motion Sensor                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Outdoor Motion Sensor                                   ||ZSE29             ||Motion Sensor         ||Z-Wave||Generic Z-Wave Motion Sensor              || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz S2 Multisiren                                      ||ZSE19             ||Siren                 ||Z-Wave||Zooz S2 Multisiren                        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |Zooz                     ||Zooz Double plug                                        ||ZEN25             ||Outlet                ||Z-Wave||Zooz Double Plug                          || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |ZWP                      ||WD-100 Dimmer                                           ||                  ||Dimmer                ||Z-Wave||Generic Z-Wave CentralScene Dimmer        || ||&lt;br /&gt;
|-&lt;br /&gt;
                                                                   |ZWP                      ||ZWP WS100 Switch                                        ||                  ||Switch                ||Z-Wave||Generic Z-Wave CentralScene Switch        || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Note: Aeotec was formerly known as Aeon Labs.&lt;br /&gt;
&lt;br /&gt;
__NOEDITSECTION__&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Z-Wave_Poller&amp;diff=2212</id>
		<title>Z-Wave Poller</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Z-Wave_Poller&amp;diff=2212"/>
		<updated>2019-07-19T15:24:01Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Z-Wave poller app corrects a polling issue with certain Z-Wave devices that do not display their state properly, but the issue only affects certain non Z-Wave Plus devices. Older GE dimmers and switches are well known to have this problem when activated manually.  If your GE devices pairs as &amp;quot;Generic Z-Wave Dimmer&amp;quot; or &amp;quot;Generic Z-Wave Switch&amp;quot; it is a candidate for needing Z-Wave Poller.  Z-Wave Poller only works with devices that pair with these two drivers.  To verify that your Z-Wave device is a candidate for Z-Wave poller, active your device manually, and watch the logs to see if the device '''does NOT''' register a change of state in the logs. If it doesn't, then it is a candidate for Z-Wave Poller, but if does register a change in the logs, you should not use the Z-Wave Poller app with it. &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
=== Installing the Z-Wave Poller app ===&lt;br /&gt;
&lt;br /&gt;
# From the Hubitat Web Interface select '''Apps'''[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]&lt;br /&gt;
# Choose Z-Wave Poller from the list of Hubitat Elevation™ Built-In Apps[[File:Install Z-Wave Poller.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
=== Choose non Z-Wave Plus devices that require polling ===&lt;br /&gt;
&lt;br /&gt;
#Use the ''Select Dimmers to Poll'' dropdown menu to choose the Z-Wave dimmers you would like to poll, then choose '''Update'''.&lt;br /&gt;
#Use the ''Select Switches to Poll'' dropdown menu to choose the Z-Wave switches you would like to poll, then choose '''Update'''.&lt;br /&gt;
#When your devices are selected, select '''Start polling for selected devices'''.[[File:Z-Wave Poller setup.png|none|thumb|600x600px]]&lt;br /&gt;
#You can pause Z-Wave polling at any time by opening the app and choosing either '''Stop polling for selected devices''' or '''Stop All Poling'''.[[File:Stop Z-Wave Poller.png|none|thumb|595x595px]]&lt;br /&gt;
#To assist with troubleshooting, you can also turn on '''Enable Logging'''&lt;br /&gt;
#When you are finished, select '''Done'''.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2180</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2180"/>
		<updated>2019-07-11T20:04:28Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions with Stop selected&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  END-REP is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;END-REP&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2179</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2179"/>
		<updated>2019-07-11T20:02:27Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
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 Repetition 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.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  END-REP is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;END-REP&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2178</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2178"/>
		<updated>2019-07-11T19:57:32Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated periodically, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this for a selected 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 will be repeated.  A new feature, END-REP, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 END-REP&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  END-REP is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;END-REP&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2175</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2175"/>
		<updated>2019-07-04T15:02:36Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of Week Schedule:      at certain time on certain days of the week&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2167</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2167"/>
		<updated>2019-07-03T00:52:11Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Introduction to Automation&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A home automation system is a collection of smart devices and a Hubitat Elevation® hub.  The objective of the system is to provide automatic control of various devices in the home based on events and conditions.  This introduction explains the structure of the system and the way that it operates.  Understanding these concepts is essential to being able to design your own home automation system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Events&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An automation system is &amp;quot;event driven&amp;quot;.  The devices in your home automation system regularly generate events.  An event is simply a small message a device or the hub sends out.  For example, when you turn on a smart switch, it sends out an event reporting that it was turned on.  One way to think of the automation system is that there is a constant stream of events.  The role of the hub is to make sense out of this stream of events and to cause things to happen in the system.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;automation&amp;quot; is a very small computer program that responds to events to cause something to happen.  For example, an automation could respond to the event of a door contact opening by turning on a porch light.  These &amp;quot;automations&amp;quot;, or &amp;quot;rules&amp;quot;, make up the brains of the home automation system, making it &amp;quot;smart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of all of the events occurring in the system, each automation is only interested in a few specific ones.  To avoid having to process every single event, each automation &amp;quot;subscribes&amp;quot; to the ones it is interested in.  Our example porch light automation subscribes to the events from the door contact sensor; it doesn't care about any other events.  Its job is to turn on a light when that contact opens.  Each automation in a system has subscriptions to the events it is concerned with.  The hub's job is to send each automation just those events that the automation has subscribed to.&lt;br /&gt;
&lt;br /&gt;
There are four basic types of events:  device events, time events, hub events, and network events.  Devices events are generated by the smart devices in the system, like the door contact sensor reporting 'open'.  Time events are generated by a scheduler in the hub for things like sunrise, 5:00 PM, etc.  Hub events are special events that the hub generates; for example the hub generates an event when it starts up.  Network events are messages that come to the hub from the LAN or internet.  Some devices use the LAN to send events, some use Z-Wave or Zigbee radio signals.&lt;br /&gt;
&lt;br /&gt;
For every device event or network event to be processed so that an automation can respond to it, there must be a &amp;quot;driver&amp;quot; in the system.  For example, a driver would receive a message from the Zigbee radio network sent by the door contact, and convert it into an event.  Each smart device in the system has a corresponding driver installed in the hub.  The hub serves as the traffic cop, forwarding device events to automations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Automations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above, an automation is a small app that runs on the hub.  It's purpose is to respond to events by causing actions.  Every automation has these two elements:  the events that provoke it to act, and the actions if performs as a consequence.  &lt;br /&gt;
&lt;br /&gt;
Some automations are very simple.  The one described where opening a door causes a light to turn on is very simple.  We may want it to be more sophisticated.   Suppose we only want the porch light to turn on when the door opens at night, not during the day.  To accomplish this, the automation will need more than just the events and the actions -- it needs to evaluate *conditions*.  Based on this evaluation of conditions, it may or may not do some action, or perhaps it will do different actions depending on the conditions.  For our porch light automation, we want our rule to test what time it is, and decide based on that whether or not to turn on the light. &lt;br /&gt;
&lt;br /&gt;
Now, we have a complete picture of what an automation is:  It responds to *events*, evaluates *conditions* and then takes *actions* based on the conditions.  All automations have this general form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Machine 4.0&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Rule Machine 4.0]] is a built-in app in Hubitat Elevation® that can be used to create automations.  Each rule created with it has the described form, with *Trigger Events* and *Actions*, and the *Actions* can have *conditions* to be evaluated as part of deciding what the automation does.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2166</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2166"/>
		<updated>2019-07-03T00:51:10Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Introduction to Automation&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A home automation system is a collection of smart devices and a Hubitat Elevation® hub.  The objective of the system is to provide automatic control of various devices in the home based on events and conditions.  This introduction explains the structure of the system and the way that it operates.  Understanding these concepts is essential to being able to design your own home automation system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Events&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An automation system is &amp;quot;event driven&amp;quot;.  The devices in your home automation system regularly generate events.  An event is simply a small message a device or the hub sends out.  For example, when you turn on a smart switch, it sends out an event reporting that it was turned on.  One way to think of the automation system is that there is a constant stream of events.  The role of the hub is to make sense out of this stream of events and to cause things to happen in the system.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;automation&amp;quot; is a very small computer program that responds to events to cause something to happen.  For example, an automation could respond to the event of a door contact opening by turning on a porch light.  These &amp;quot;automations&amp;quot;, or &amp;quot;rules&amp;quot;, make up the brains of the home automation system, making it &amp;quot;smart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of all of the events occurring in the system, each automation is only interested in a few specific ones.  To avoid having to process every single event, each automation &amp;quot;subscribes&amp;quot; to the ones it is interested in.  Our example porch light automation subscribes to the events from the door contact sensor; it doesn't care about any other events.  Its job is to turn on a light when that contact opens.  Each automation in a system has subscriptions to the events it is concerned with.  The hub's job is to send each automation just those events that the automation has subscribed to.&lt;br /&gt;
&lt;br /&gt;
There are four basic types of events:  device events, time events, hub events, and network events.  Devices events are generated by the smart devices in the system, like the door contact sensor reporting 'open'.  Time events are generated by a scheduler in the hub for things like sunrise, 5:00 PM, etc.  Hub events are special events that the hub generates; for example the hub generates an event when it starts up.  Network events are messages that come to the hub from the LAN or internet.  Some devices use the LAN to send events, some use Z-Wave or Zigbee radio signals.&lt;br /&gt;
&lt;br /&gt;
For every device event or network event to be processed so that an automation can respond to it, there must be a &amp;quot;driver&amp;quot; in the system.  For example, a driver would receive a message from the Zigbee radio network sent by the door contact, and convert it into an event.  Each smart device in the system has a corresponding driver installed in the hub.  The hub serves as the traffic cop, forwarding device events to automations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Automations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above, an automation is a small app that runs on the hub.  It's purpose is to respond to events by causing actions.  Every automation has these two elements:  the events that provoke it to act, and the actions if performs as a consequence.  &lt;br /&gt;
&lt;br /&gt;
Some automations are very simple.  The one described where opening a door causes a light to turn on is very simple.  We may want it to be more sophisticated.   Suppose we only want the porch light to turn on when the door opens at night, not during the day.  To accomplish this, the automation will need more than just the events and the actions -- it needs to evaluate *conditions*.  Based on this evaluation of conditions, it may or may not do some action, or perhaps it will do different actions depending on the conditions.  For our porch light automation, we want our rule to test what time it is, and decide based on that whether or not to turn on the light. &lt;br /&gt;
&lt;br /&gt;
Now, we have a complete picture of what an automation is:  It responds to *events*, evaluates *conditions* and then takes *actions* based on the conditions.  All automations have this general form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Machine 4.0&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Rule Machine 4.0]] is a built-in app in Hubitat Elevation® that can be used to create automations.  Each rule created with it has the described form, with *Trigger Events* and *Actions*, and the *Actions* can have *conditions* to be evaluated as part of deciding what the automation does.&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2165</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2165"/>
		<updated>2019-07-03T00:50:33Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Introduction to Automation&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A home automation system is a collection of smart devices and a Hubitat Elevation® hub.  The objective of the system is to provide automatic control of various devices in the home based on events and conditions.  This introduction explains the structure of the system and the way that it operates.  Understanding these concepts is essential to being able to design your own home automation system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Events&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An automation system is &amp;quot;event driven&amp;quot;.  The devices in your home automation system regularly generate events.  An event is simply a small message a device or the hub sends out.  For example, when you turn on a smart switch, it sends out an event reporting that it was turned on.  One way to think of the automation system is that there is a constant stream of events.  The role of the hub is to make sense out of this stream of events and to cause things to happen in the system.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;automation&amp;quot; is a very small computer program that responds to events to cause something to happen.  For example, an automation could respond to the event of a door contact opening by turning on a porch light.  These &amp;quot;automations&amp;quot;, or &amp;quot;rules&amp;quot;, make up the brains of the home automation system, making it &amp;quot;smart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of all of the events occurring in the system, each automation is only interested in a few specific ones.  To avoid having to process every single event, each automation &amp;quot;subscribes&amp;quot; to the ones it is interested in.  Our example porch light automation subscribes to the events from the door contact sensor; it doesn't care about any other events.  Its job is to turn on a light when that contact opens.  Each automation in a system has subscriptions to the events it is concerned with.  The hub's job is to send each automation just those events that the automation has subscribed to.&lt;br /&gt;
&lt;br /&gt;
There are four basic types of events:  device events, time events, hub events, and network events.  Devices events are generated by the smart devices in the system, like the door contact sensor reporting 'open'.  Time events are generated by a scheduler in the hub for things like sunrise, 5:00 PM, etc.  Hub events are special events that the hub generates; for example the hub generates an event when it starts up.  Network events are messages that come to the hub from the LAN or internet.  Some devices use the LAN to send events, some use Z-Wave or Zigbee radio signals.&lt;br /&gt;
&lt;br /&gt;
For every device event or network event to be processed so that an automation can respond to it, there must be a &amp;quot;driver&amp;quot; in the system.  For example, a driver would receive a message from the Zigbee radio network sent by the door contact, and convert it into an event.  Each smart device in the system has a corresponding driver installed in the hub.  The hub serves as the traffic cop, forwarding device events to automations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Automations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above, an automation is a small app that runs on the hub.  It's purpose is to respond to events by causing actions.  Every automation has these two elements:  the events that provoke it to act, and the actions if performs as a consequence.  &lt;br /&gt;
&lt;br /&gt;
Some automations are very simple.  The one described where opening a door causes a light to turn on is very simple.  We may want it to be more sophisticated.   Suppose we only want the porch light to turn on when the door opens at night, not during the day.  To accomplish this, the automation will need more than just the events and the actions -- it needs to evaluate *conditions*.  Based on this evaluation of conditions, it may or may not do some action, or perhaps it will do different actions depending on the conditions.  For our porch light automation, we want our rule to test what time it is, and decide based on that whether or not to turn on the light. &lt;br /&gt;
&lt;br /&gt;
Now, we have a complete picture of what an automation is:  It responds to *events*, evaluates *conditions* and then takes *actions* based on the conditions.  All automations have this general form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Machine 4.0&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Rule Machine 4.0]] is a built-in app in Hubitat Elevation® that can be used to create automations.  Each rule created with it has the described form, with *Trigger Events* and *Actions*, and the *Actions* can have *conditions* to be evaluated as part of deciding what the automation does.&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2164</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2164"/>
		<updated>2019-07-03T00:49:58Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Introduction to Automation&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A home automation system is a collection of smart devices and a Hubitat Elevation® hub.  The objective of the system is to provide automatic control of various devices in the home based on events and conditions.  This introduction explains the structure of the system and the way that it operates.  Understanding these concepts is essential to being able to design your own home automation system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Events&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An automation system is &amp;quot;event driven&amp;quot;.  The devices in your home automation system regularly generate events.  An event is simply a small message a device or the hub sends out.  For example, when you turn on a smart switch, it sends out an event reporting that it was turned on.  One way to think of the automation system is that there is a constant stream of events.  The role of the hub is to make sense out of this stream of events and to cause things to happen in the system.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;automation&amp;quot; is a very small computer program that responds to events to cause something to happen.  For example, an automation could respond to the event of a door contact opening by turning on a porch light.  These &amp;quot;automations&amp;quot;, or &amp;quot;rules&amp;quot;, make up the brains of the home automation system, making it &amp;quot;smart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of all of the events occurring in the system, each automation is only interested in a few specific ones.  To avoid having to process every single event, each automation &amp;quot;subscribes&amp;quot; to the ones it is interested in.  Our example porch light automation subscribes to the events from the door contact sensor; it doesn't care about any other events.  Its job is to turn on a light when that contact opens.  Each automation in a system has subscriptions to the events it is concerned with.  The hub's job is to send each automation just those events that the automation has subscribed to.&lt;br /&gt;
&lt;br /&gt;
There are four basic types of events:  device events, time events, hub events, and network events.  Devices events are generated by the smart devices in the system, like the door contact sensor reporting 'open'.  Time events are generated by a scheduler in the hub for things like sunrise, 5:00 PM, etc.  Hub events are special events that the hub generates; for example the hub generates an event when it starts up.  Network events are messages that come to the hub from the LAN or internet.  Some devices use the LAN to send events, some use Z-Wave or Zigbee radio signals.&lt;br /&gt;
&lt;br /&gt;
For every device event or network event to be processed so that an automation can respond to it, there must be a &amp;quot;driver&amp;quot; in the system.  For example, a driver would receive a message from the Zigbee radio network sent by the door contact, and convert it into an event.  Each smart device in the system has a corresponding driver installed in the hub.  The hub serves as the traffic cop, forwarding device events to automations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Automations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above, an automation is a small app that runs on the hub.  It's purpose is to respond to events by causing actions.  Every automation has these two elements:  the events that provoke it to act, and the actions if performs as a consequence.  &lt;br /&gt;
&lt;br /&gt;
Some automations are very simple.  The one described where opening a door causes a light to turn on is very simple.  We may want it to be more sophisticated.   Suppose we only want the porch light to turn on when the door opens at night, not during the day.  To accomplish this, the automation will need more than just the events and the actions -- it needs to evaluate *conditions*.  Based on this evaluation of conditions, it may or may not do some action, or perhaps it will do different actions depending on the conditions.  For our porch light automation, we want our rule to test what time it is, and decide based on that whether or not to turn on the light. &lt;br /&gt;
&lt;br /&gt;
Now, we have a complete picture of what an automation is:  It responds to *events*, evaluates *conditions* and then takes *actions* based on the conditions.  All automations have this general form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Machine 4.0 [Coming Soon]&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule Machine 4.0 is a built-in app in Hubitat Elevation® that can be used to create automations.  Each rule created with it has the described form, with *Trigger Events* and *Actions*, and the *Actions* can have *conditions* to be evaluated as part of deciding what the automation does.&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2163</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2163"/>
		<updated>2019-07-03T00:49:01Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Introduction to Automation&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A home automation system is a collection of smart devices and a Hubitat Elevation® hub.  The objective of the system is to provide automatic control of various devices in the home based on events and conditions.  This introduction explains the structure of the system and the way that it operates.  Understanding these concepts is essential to being able to design your own home automation system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Events&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An automation system is &amp;quot;event driven&amp;quot;.  The devices in your home automation system regularly generate events.  An event is simply a small message a device or the hub sends out.  For example, when you turn on a smart switch, it sends out an event reporting that it was turned on.  One way to think of the automation system is that there is a constant stream of events.  The role of the hub is to make sense out of this stream of events and to cause things to happen in the system.&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;automation&amp;quot; is a very small computer program that responds to events to cause something to happen.  For example, an automation could respond to the event of a door contact opening by turning on a porch light.  These &amp;quot;automations&amp;quot;, or &amp;quot;rules&amp;quot;, make up the brains of the home automation system, making it &amp;quot;smart&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Of all of the events occurring in the system, each automation is only interested in a few specific ones.  To avoid having to process every single event, each automation &amp;quot;subscribes&amp;quot; to the ones it is interested in.  Our example porch light automation subscribes to the events from the door contact sensor; it doesn't care about any other events.  Its job is to turn on a light when that contact opens.  Each automation in a system has subscriptions to the events it is concerned with.  The hub's job is to send each automation just those events that the automation has subscribed to.&lt;br /&gt;
&lt;br /&gt;
There are four basic types of events:  device events, time events, hub events, and network events.  Devices events are generated by the smart devices in the system, like the door contact sensor reporting 'open'.  Time events are generated by a scheduler in the hub for things like sunrise, 5:00 PM, etc.  Hub events are special events that the hub generates; for example the hub generates an event when it starts up.  Network events are messages that come to the hub from the LAN or internet.  Some devices use the LAN to send events, some use Z-Wave or Zigbee radio signals.&lt;br /&gt;
&lt;br /&gt;
For every device event or network event to be processed so that an automation can respond to it, there must be a &amp;quot;driver&amp;quot; in the system.  For example, a driver would receive a message from the Zigbee radio network sent by the door contact, and convert it into an event.  Each smart device in the system has a corresponding driver installed in the hub.  The hub serves as the traffic cop, forwarding device events to automations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Automations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above, an automation is a small app that runs on the hub.  It's purpose is to respond to events by causing actions.  Every automation has these two elements:  the events that provoke it to act, and the actions if performs as a consequence.  &lt;br /&gt;
&lt;br /&gt;
Some automations are very simple.  The one described where opening a door causes a light to turn on is very simple.  We may want it to be more sophisticated.   Suppose we only want the porch light to turn on when the door opens at night, not during the day.  To accomplish this, the automation will need more than just the events and the actions -- it needs to evaluate *conditions*.  Based on this evaluation of conditions, it may or may not do some action, or perhaps it will do different actions depending on the conditions.  For our porch light automation, we want our rule to test what time it is, and decide based on that whether or not to turn on the light. &lt;br /&gt;
&lt;br /&gt;
Now, we have a complete picture of what an automation is:  It responds to *events*, evaluates *conditions* and then takes *actions* based on the conditions.  All automations have this general form.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Machine 4.0 [Coming Soon]&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule Machine 4.0 is a built-in app in Hubitat Elevation® that can be used to create automations.  Each rule created with it has the described form, with *Trigger Events* and *Actions*, and the *Actions* can have *conditions* to be evaluated as part of deciding what the automation does.&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2162</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2162"/>
		<updated>2019-07-03T00:46:44Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2161</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2161"/>
		<updated>2019-07-03T00:46:16Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
          End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2160</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2160"/>
		<updated>2019-07-03T00:45:54Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;  Conditional Actions &lt;br /&gt;
	  IF (conditions) THEN&lt;br /&gt;
	  ELSE-IF (conditions) THEN&lt;br /&gt;
	  ELSE&lt;br /&gt;
	  END-IF&lt;br /&gt;
	  Simple Conditional Action&lt;br /&gt;
  Control Switches, Push Buttons &lt;br /&gt;
	  Turn switches on&lt;br /&gt;
	  Turn switches off&lt;br /&gt;
	  Toggle switches&lt;br /&gt;
	  Flash switches&lt;br /&gt;
	  Set switches per mode&lt;br /&gt;
	  Push a button&lt;br /&gt;
	  Push a button per mode&lt;br /&gt;
  Set Dimmers and Bulbs &lt;br /&gt;
	  Set dimmer level&lt;br /&gt;
	  Toggle dimmer level&lt;br /&gt;
	  Adjust dimmer level&lt;br /&gt;
	  Set dimmer level per mode&lt;br /&gt;
	  Fade dimmer level over time&lt;br /&gt;
	  Start raising dimmer level&lt;br /&gt;
	  Start lowering dimmer level&lt;br /&gt;
	  Stop changing dimmer level&lt;br /&gt;
	  Set color and level&lt;br /&gt;
	  Toggle color and level&lt;br /&gt;
	  Set color and level per mode&lt;br /&gt;
	  Set color temperature and level&lt;br /&gt;
	  Toggle color temperature and level&lt;br /&gt;
	  Set color temperature and level per mode&lt;br /&gt;
  Activate Scenes, Adjust Shades or Fans &lt;br /&gt;
	  Activate scenes&lt;br /&gt;
	  Activate scenes per mode&lt;br /&gt;
	  Open shades&lt;br /&gt;
	  Close shades&lt;br /&gt;
	  Set shade position&lt;br /&gt;
	  Set fan speed&lt;br /&gt;
	  Cycle fans&lt;br /&gt;
  Control HSM, Garage Doors, Locks or Valves &lt;br /&gt;
	  Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
	  Open garage door&lt;br /&gt;
	  Close garage door&lt;br /&gt;
	  Lock locks&lt;br /&gt;
	  Unlock locks&lt;br /&gt;
	  Open valves&lt;br /&gt;
	  Close valves&lt;br /&gt;
  Control Thermostats or Thermostat Scheduler &lt;br /&gt;
	  Set thermostats&lt;br /&gt;
	  Set Thermostat Scheduler&lt;br /&gt;
  Send or Speak a Message, Send HTTP Request &lt;br /&gt;
	  Send or Speak a Message&lt;br /&gt;
	  Send HTTP Get&lt;br /&gt;
	  Send HTTP Post&lt;br /&gt;
  Control Music Player, Sounds &lt;br /&gt;
	  Control Music Player&lt;br /&gt;
	  Sound Tone&lt;br /&gt;
	  Sound Chime&lt;br /&gt;
	  Control Siren&lt;br /&gt;
  Set Mode or Global Variables, Run Custom Action &lt;br /&gt;
	  Set Mode&lt;br /&gt;
	  Set Global Variable&lt;br /&gt;
	  Run Custom Action&lt;br /&gt;
  Set Private Boolean, Run/Stop/Pause Rules &lt;br /&gt;
	  Set Private Booleans True&lt;br /&gt;
	  Set Private Booleans False&lt;br /&gt;
	  Run Rule Actions&lt;br /&gt;
	  Stop Rule Actions&lt;br /&gt;
	  Pause Rules&lt;br /&gt;
	  Resume Rules&lt;br /&gt;
  Capture/Restore, Device Refresh or Polling &lt;br /&gt;
	  Capture Devices&lt;br /&gt;
	  Restore Devices&lt;br /&gt;
	  Refresh devices&lt;br /&gt;
	  Poll devices&lt;br /&gt;
	  Start Z-Wave poll on switches&lt;br /&gt;
	  Stop Z-Wave poll on switches&lt;br /&gt;
	  Start Z-Wave poll on dimmers&lt;br /&gt;
	  Stop Z-Wave poll on dimmers&lt;br /&gt;
  Delay or Repeat Actions, Wait &lt;br /&gt;
	  Delay Actions&lt;br /&gt;
	  Delay Actions Per Mode&lt;br /&gt;
	  Cancel Delayed Actions&lt;br /&gt;
	  Repeat Actions&lt;br /&gt;
      End Repetition&lt;br /&gt;
	  Stop Repeating Actions&lt;br /&gt;
	  Wait for Events&lt;br /&gt;
	  Wait for Condition&lt;br /&gt;
	  Cancel Wait&lt;br /&gt;
	  Exit Rule&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2159</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2159"/>
		<updated>2019-07-03T00:40:00Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;		&amp;quot;Conditional Actions&amp;quot;: &lt;br /&gt;
			&amp;quot;IF (conditions) THEN&amp;quot;,&lt;br /&gt;
			&amp;quot;ELSE-IF (conditions) THEN&amp;quot;,&lt;br /&gt;
			&amp;quot;ELSE&amp;quot;,&lt;br /&gt;
			&amp;quot;END-IF&amp;quot;,&lt;br /&gt;
			&amp;quot;Simple Conditional Action&amp;quot;&lt;br /&gt;
		&amp;quot;Control Switches, Push Buttons&amp;quot;: &lt;br /&gt;
			&amp;quot;Turn switches on&amp;quot;,&lt;br /&gt;
			&amp;quot;Turn switches off&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Flash switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Set switches per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Push a button&amp;quot;,&lt;br /&gt;
			&amp;quot;Push a button per mode&amp;quot;&lt;br /&gt;
		&amp;quot;Set Dimmers and Bulbs&amp;quot;: &lt;br /&gt;
			&amp;quot;Set dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Adjust dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set dimmer level per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Fade dimmer level over time&amp;quot;,&lt;br /&gt;
			&amp;quot;Start raising dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Start lowering dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop changing dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle color and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color and level per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color temperature and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle color temperature and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color temperature and level per mode&amp;quot;&lt;br /&gt;
		&amp;quot;Activate Scenes, Adjust Shades or Fans&amp;quot;: &lt;br /&gt;
			&amp;quot;Activate scenes&amp;quot;,&lt;br /&gt;
			&amp;quot;Activate scenes per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Open shades&amp;quot;,&lt;br /&gt;
			&amp;quot;Close shades&amp;quot;,&lt;br /&gt;
			&amp;quot;Set shade position&amp;quot;,&lt;br /&gt;
			&amp;quot;Set fan speed&amp;quot;,&lt;br /&gt;
			&amp;quot;Cycle fans&amp;quot;&lt;br /&gt;
		&amp;quot;Control HSM, Garage Doors, Locks or Valves&amp;quot;: &lt;br /&gt;
			&amp;quot;Arm/Disarm Hubitat® Safety Monitor&amp;quot;,&lt;br /&gt;
			&amp;quot;Open garage door&amp;quot;,&lt;br /&gt;
			&amp;quot;Close garage door&amp;quot;,&lt;br /&gt;
			&amp;quot;Lock locks&amp;quot;,&lt;br /&gt;
			&amp;quot;Unlock locks&amp;quot;,&lt;br /&gt;
			&amp;quot;Open valves&amp;quot;,&lt;br /&gt;
			&amp;quot;Close valves&amp;quot;&lt;br /&gt;
		&amp;quot;Control Thermostats or Thermostat Scheduler&amp;quot;: &lt;br /&gt;
			&amp;quot;Set thermostats&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Thermostat Scheduler&amp;quot;&lt;br /&gt;
		&amp;quot;Send or Speak a Message, Send HTTP Request&amp;quot;: &lt;br /&gt;
			&amp;quot;Send or Speak a Message&amp;quot;,&lt;br /&gt;
			&amp;quot;Send HTTP Get&amp;quot;,&lt;br /&gt;
			&amp;quot;Send HTTP Post&amp;quot;&lt;br /&gt;
		&amp;quot;Control Music Player, Sounds&amp;quot;: &lt;br /&gt;
			&amp;quot;Control Music Player&amp;quot;,&lt;br /&gt;
			&amp;quot;Sound Tone&amp;quot;,&lt;br /&gt;
			&amp;quot;Sound Chime&amp;quot;,&lt;br /&gt;
			&amp;quot;Control Siren&amp;quot;&lt;br /&gt;
		&amp;quot;Set Mode or Global Variables, Run Custom Action&amp;quot;: &lt;br /&gt;
			&amp;quot;Set Mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Global Variable&amp;quot;,&lt;br /&gt;
			&amp;quot;Run Custom Action&amp;quot;&lt;br /&gt;
		&amp;quot;Set Private Boolean, Run/Stop/Pause Rules&amp;quot;: &lt;br /&gt;
			&amp;quot;Set Private Booleans True&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Private Booleans False&amp;quot;,&lt;br /&gt;
			&amp;quot;Run Rule Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Rule Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Pause Rules&amp;quot;,&lt;br /&gt;
			&amp;quot;Resume Rules&amp;quot;&lt;br /&gt;
		&amp;quot;Capture/Restore, Device Refresh or Polling&amp;quot;: &lt;br /&gt;
			&amp;quot;Capture Devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Restore Devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Refresh devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Poll devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Start Z-Wave poll on switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Z-Wave poll on switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Start Z-Wave poll on dimmers&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Z-Wave poll on dimmers&amp;quot;&lt;br /&gt;
		&amp;quot;Delay or Repeat Actions, Wait&amp;quot;: [&lt;br /&gt;
			&amp;quot;Delay Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Delay Actions Per Mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Cancel Delayed Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Repeat Actions&amp;quot;,&lt;br /&gt;
                        &amp;quot;End Repetition&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Repeating Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Wait for Events&amp;quot;,&lt;br /&gt;
			&amp;quot;Wait for Condition&amp;quot;,&lt;br /&gt;
			&amp;quot;Cancel Wait&amp;quot;,&lt;br /&gt;
			&amp;quot;Exit Rule&amp;quot;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2158</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2158"/>
		<updated>2019-07-03T00:38:54Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== List of Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;		&amp;quot;Conditional Actions&amp;quot;: &lt;br /&gt;
			&amp;quot;IF (conditions) THEN&amp;quot;,&lt;br /&gt;
			&amp;quot;ELSE-IF (conditions) THEN&amp;quot;,&lt;br /&gt;
			&amp;quot;ELSE&amp;quot;,&lt;br /&gt;
			&amp;quot;END-IF&amp;quot;,&lt;br /&gt;
			&amp;quot;Simple Conditional Action&amp;quot;&lt;br /&gt;
		&amp;quot;Control Switches, Push Buttons&amp;quot;: &lt;br /&gt;
			&amp;quot;Turn switches on&amp;quot;,&lt;br /&gt;
			&amp;quot;Turn switches off&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Flash switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Set switches per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Push a button&amp;quot;,&lt;br /&gt;
			&amp;quot;Push a button per mode&amp;quot;&lt;br /&gt;
		&amp;quot;Set Dimmers and Bulbs&amp;quot;: &lt;br /&gt;
			&amp;quot;Set dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Adjust dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set dimmer level per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Fade dimmer level over time&amp;quot;,&lt;br /&gt;
			&amp;quot;Start raising dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Start lowering dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop changing dimmer level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle color and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color and level per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color temperature and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Toggle color temperature and level&amp;quot;,&lt;br /&gt;
			&amp;quot;Set color temperature and level per mode&amp;quot;&lt;br /&gt;
		&amp;quot;Activate Scenes, Adjust Shades or Fans&amp;quot;: &lt;br /&gt;
			&amp;quot;Activate scenes&amp;quot;,&lt;br /&gt;
			&amp;quot;Activate scenes per mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Open shades&amp;quot;,&lt;br /&gt;
			&amp;quot;Close shades&amp;quot;,&lt;br /&gt;
			&amp;quot;Set shade position&amp;quot;,&lt;br /&gt;
			&amp;quot;Set fan speed&amp;quot;,&lt;br /&gt;
			&amp;quot;Cycle fans&amp;quot;&lt;br /&gt;
		&amp;quot;Control HSM, Garage Doors, Locks or Valves&amp;quot;: &lt;br /&gt;
			&amp;quot;Arm/Disarm Hubitat® Safety Monitor&amp;quot;,&lt;br /&gt;
			&amp;quot;Open garage door&amp;quot;,&lt;br /&gt;
			&amp;quot;Close garage door&amp;quot;,&lt;br /&gt;
			&amp;quot;Lock locks&amp;quot;,&lt;br /&gt;
			&amp;quot;Unlock locks&amp;quot;,&lt;br /&gt;
			&amp;quot;Open valves&amp;quot;,&lt;br /&gt;
			&amp;quot;Close valves&amp;quot;&lt;br /&gt;
		&amp;quot;Control Thermostats or Thermostat Scheduler&amp;quot;: &lt;br /&gt;
			&amp;quot;Set thermostats&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Thermostat Scheduler&amp;quot;&lt;br /&gt;
		&amp;quot;Send or Speak a Message, Send HTTP Request&amp;quot;: &lt;br /&gt;
			&amp;quot;Send or Speak a Message&amp;quot;,&lt;br /&gt;
			&amp;quot;Send HTTP Get&amp;quot;,&lt;br /&gt;
			&amp;quot;Send HTTP Post&amp;quot;&lt;br /&gt;
		&amp;quot;Control Music Player, Sounds&amp;quot;: &lt;br /&gt;
			&amp;quot;Control Music Player&amp;quot;,&lt;br /&gt;
			&amp;quot;Sound Tone&amp;quot;,&lt;br /&gt;
			&amp;quot;Sound Chime&amp;quot;,&lt;br /&gt;
			&amp;quot;Control Siren&amp;quot;&lt;br /&gt;
		&amp;quot;Set Mode or Global Variables, Run Custom Action&amp;quot;: &lt;br /&gt;
			&amp;quot;Set Mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Global Variable&amp;quot;,&lt;br /&gt;
			&amp;quot;Run Custom Action&amp;quot;&lt;br /&gt;
		&amp;quot;Set Private Boolean, Run/Stop/Pause Rules&amp;quot;: &lt;br /&gt;
			&amp;quot;Set Private Booleans True&amp;quot;,&lt;br /&gt;
			&amp;quot;Set Private Booleans False&amp;quot;,&lt;br /&gt;
			&amp;quot;Run Rule Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Rule Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Pause Rules&amp;quot;,&lt;br /&gt;
			&amp;quot;Resume Rules&amp;quot;&lt;br /&gt;
		&amp;quot;Capture/Restore, Device Refresh or Polling&amp;quot;: &lt;br /&gt;
			&amp;quot;Capture Devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Restore Devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Refresh devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Poll devices&amp;quot;,&lt;br /&gt;
			&amp;quot;Start Z-Wave poll on switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Z-Wave poll on switches&amp;quot;,&lt;br /&gt;
			&amp;quot;Start Z-Wave poll on dimmers&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Z-Wave poll on dimmers&amp;quot;&lt;br /&gt;
		&amp;quot;Delay or Repeat Actions, Wait&amp;quot;: [&lt;br /&gt;
			&amp;quot;Delay Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Delay Actions Per Mode&amp;quot;,&lt;br /&gt;
			&amp;quot;Cancel Delayed Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Repeat Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Stop Repeating Actions&amp;quot;,&lt;br /&gt;
			&amp;quot;Wait for Events&amp;quot;,&lt;br /&gt;
			&amp;quot;Wait for Condition&amp;quot;,&lt;br /&gt;
			&amp;quot;Cancel Wait&amp;quot;,&lt;br /&gt;
			&amp;quot;Exit Rule&amp;quot;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2157</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2157"/>
		<updated>2019-07-03T00:35:33Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Wait for Condition ==&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
== Custom Actions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Global Variables ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
To include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
== Run actions from UI ==&lt;br /&gt;
&lt;br /&gt;
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 button.  If you change the Trigger Events in any way, you must either hit Done or Update Rule button.  &lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2156</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2156"/>
		<updated>2019-07-03T00:24:02Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
== Repeat Actions ==&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Wait for Events and Elapsed Time'''&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2155</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2155"/>
		<updated>2019-07-03T00:22:48Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  A Trigger Event listens for specific events.  When a trigger receives a selected event, it causes the defined actions to run.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following events in a Hubitat Elevation system to be acted upon.  Each event results in a single test. The supported events and states that can be tested are listed below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Wait for Events and Elapsed Time'''&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2154</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2154"/>
		<updated>2019-07-03T00:19:42Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay,  &lt;br /&gt;
                            smoke, water, rule, arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Wait for Events and Elapsed Time'''&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2153</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2153"/>
		<updated>2019-07-03T00:18:57Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Events ==&lt;br /&gt;
&lt;br /&gt;
Each rule has one or more Trigger Events that when triggered, cause the rule's actions to run.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Button:                     pressed / held / doubleTapped / released&lt;br /&gt;
Button Device:              select actions for any buttons of a button device&lt;br /&gt;
Certain Time:               at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:            hitting URL fires&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM alert:                  intrusion, intrusion-delay, intrusion-home, intrusion-home-delay, intrusion-night, cancelRuleAlerts, intrusion-night-delay, smoke, water, rule, &lt;br /&gt;
                            arming, armingHome, armingNight, cancel&lt;br /&gt;
HSM status:                 armed away, armed home, armed night, delayed arming home, delayed arming night, delayed arming away, disarmed, all disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Local End Point:            hitting URL fires&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Periodic:                   allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical dimmer level:      value     &lt;br /&gt;
Physical switch:            on / off&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Wait for Events and Elapsed Time'''&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2152</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2152"/>
		<updated>2019-07-03T00:01:36Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Wait for Events and Elapsed Time'''&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2151</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2151"/>
		<updated>2019-07-03T00:00:16Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Elapsed Time ==&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
Actions are the portion of a rule that defines what the rule does when it is triggered to run.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a logical expression as described above.  IF-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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop Repeating Actions&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2150</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2150"/>
		<updated>2019-07-02T23:57:08Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Elapsed Time ==&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 END-IF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE can be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  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.&lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2149</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2149"/>
		<updated>2019-07-02T23:53:05Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 clearly depends entirely on the conditional actions now available for making decisions in rules about what to do.&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 3.0, 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Elapsed Time ==&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2148</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2148"/>
		<updated>2019-07-02T23:52:18Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 clearly depends entirely on the conditional actions now available for making decisions in rules about what to do.&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 3.0, 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Elapsed Time ==&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Hubitat_Elevation_Documentation&amp;diff=2147</id>
		<title>Hubitat Elevation Documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Hubitat_Elevation_Documentation&amp;diff=2147"/>
		<updated>2019-07-02T23:48:40Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: /* App Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==[[Getting Started]]==&lt;br /&gt;
&lt;br /&gt;
#[[Registration and setup]]&lt;br /&gt;
#[[Discovering your Devices]]&lt;br /&gt;
#[[Automating your Devices]]&lt;br /&gt;
#[[Care and Maintenance]]&lt;br /&gt;
#[[How to Collect Information for Support|Support]]&lt;br /&gt;
&lt;br /&gt;
==Hubitat Web Interface Guide==&lt;br /&gt;
&lt;br /&gt;
'''Main Menu'''&lt;br /&gt;
&lt;br /&gt;
*[[Home]]&lt;br /&gt;
*[[Location and Modes]]&lt;br /&gt;
*[[Devices]]&lt;br /&gt;
**[[Device Discovery]]&lt;br /&gt;
**[[Device Detail]]&lt;br /&gt;
**[[Device Events]]&lt;br /&gt;
*[[Apps]] &lt;br /&gt;
**[[App Status]]&lt;br /&gt;
**[[App Events]]&lt;br /&gt;
*[[Settings]]&lt;br /&gt;
**[[Hub Details]]&lt;br /&gt;
**[[Hub Login Security]]&lt;br /&gt;
**[[Location and Modes]]&lt;br /&gt;
**[[Z-Wave Details]]&lt;br /&gt;
**[[Zigbee Details]]&lt;br /&gt;
***[[Zigbee Logs]]&lt;br /&gt;
**[[Check For Updates]]&lt;br /&gt;
**[[Backup and Restore]]&lt;br /&gt;
**[[Discover Zigbee and Z-Wave Devices]]&lt;br /&gt;
&lt;br /&gt;
'''Advanced Features'''&lt;br /&gt;
&lt;br /&gt;
*[[Apps Code]]&lt;br /&gt;
*[[Drivers Code]]&lt;br /&gt;
*[[System Events]]&lt;br /&gt;
**[[Hub Events]]&lt;br /&gt;
**[[Location Events]]&lt;br /&gt;
*[[Logs]]&lt;br /&gt;
**[[Past Logs]]&lt;br /&gt;
&lt;br /&gt;
==App Documentation==&lt;br /&gt;
&lt;br /&gt;
*[[Amazon Echo App]]&lt;br /&gt;
*[[Amazon Echo Skill]]&lt;br /&gt;
*[[Button Controllers]]&lt;br /&gt;
*[[Ecobee Integration]]&lt;br /&gt;
*[[Google Home]]&lt;br /&gt;
*[[Groups and Scenes]]&lt;br /&gt;
*[[Hub Link]]&lt;br /&gt;
*[[Hubitat® Dashboard|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Dashboard]]&lt;br /&gt;
*[[Hubitat® Safety Monitor|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Safety Monitor]]&lt;br /&gt;
*[[Hubitat® Simple Lighting|Hubitat&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; Simple Lighting]]&lt;br /&gt;
*[[Hue Bridge Integration]]&lt;br /&gt;
*[[IFTTT Integration]]&lt;br /&gt;
*[[Life360 Connector]]&lt;br /&gt;
*[[Link to Hub]]&lt;br /&gt;
*[[Lock Code Manager]]&lt;br /&gt;
*[[Lutron Integrator]]&lt;br /&gt;
*[[Maker API]]&lt;br /&gt;
*[[Mode Lighting]]&lt;br /&gt;
*[[Mode Manager]]&lt;br /&gt;
*[[Motion Lighting Apps]]&lt;br /&gt;
*[[Nest Integration]]&lt;br /&gt;
*[[Notifications]]&lt;br /&gt;
*[[Rachio Integration]]&lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
*[[Rule-3.0]]&lt;br /&gt;
*[[Rule-4.0]]&lt;br /&gt;
*[[Send Hub Events]]&lt;br /&gt;
*[[SharpTools]]&lt;br /&gt;
*[[Sonos Integration]]&lt;br /&gt;
*[[Zone Motion Controllers]]&lt;br /&gt;
*[[Z-Wave Poller]]&lt;br /&gt;
&lt;br /&gt;
==Device Documentation==&lt;br /&gt;
&lt;br /&gt;
*[[Pushover]]&lt;br /&gt;
&lt;br /&gt;
*[[SecurityKeypads]]&lt;br /&gt;
&lt;br /&gt;
==Compatible Devices==&lt;br /&gt;
&lt;br /&gt;
[[List of Compatible Devices]]&lt;br /&gt;
&lt;br /&gt;
[[Join and Reset Instructions]]&lt;br /&gt;
&lt;br /&gt;
==How to Guides==&lt;br /&gt;
&lt;br /&gt;
	[[Hub Placement Tips]]&lt;br /&gt;
&lt;br /&gt;
[[How to collect information for support]]&lt;br /&gt;
&lt;br /&gt;
[[How to Build a Solid Zigbee Mesh]]&lt;br /&gt;
&lt;br /&gt;
[[How to Build a Solid Z-Wave Mesh]]&lt;br /&gt;
&lt;br /&gt;
[[How to Remove a Device]]&lt;br /&gt;
&lt;br /&gt;
[[How to update your hub]]&lt;br /&gt;
&lt;br /&gt;
[[How to backup your hub]]&lt;br /&gt;
&lt;br /&gt;
[[How to change your location]]&lt;br /&gt;
&lt;br /&gt;
[[How to add/change a mode]]&lt;br /&gt;
&lt;br /&gt;
[[How to Install Custom Apps]]&lt;br /&gt;
&lt;br /&gt;
[[How to Install Custom Drivers]]&lt;br /&gt;
&lt;br /&gt;
[[How to add password protection]]&lt;br /&gt;
&lt;br /&gt;
[[How to Manage Lock Codes]]&lt;br /&gt;
&lt;br /&gt;
[[How to change accounts linked to your hub]]&lt;br /&gt;
&lt;br /&gt;
==Developer Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Developer Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Driver Capability List]]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2146</id>
		<title>Rule-5.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-5.0&amp;diff=2146"/>
		<updated>2019-07-02T23:47:43Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: Created page with &amp;quot;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;  Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;Rule 4.0 -- The new Rule Machine&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 is the culmination of a journey in the transformation of Rule Machine.  At once it simplifies and adds power, resulting in a fully generalized automation engine.  The prior top-level organization of RM is thrown out, replaced by a simpler interface.  The changes are described below, and how what was done in prior versions is now accomplished.  Gone are Rules, Triggers, Triggered Rules, Actions and Schedules.  Instead, you define what causes a rule to run, and then what it does.  The functionality of Button Controller is fully incorporated into Rule Machine, but with more power and flexibility.  New conditional logic capabilities are provided, allowing the most subtle or complex automations to be created. You define what causes the rule to run, and then what it does.&lt;br /&gt;
&lt;br /&gt;
'''What Became of Rule, Trigger, Triggered Rule, Action and Schedule?'''&lt;br /&gt;
&lt;br /&gt;
To explain how the former RM concepts of Rule, Trigger, Triggered Rule, Actions and Schedule are now accomplished, and how Button Controller is incorporated, first we address the easy and obvious:&lt;br /&gt;
&lt;br /&gt;
What was a Trigger is now the basic format for all rules.  Select Trigger Events and define actions.  &lt;br /&gt;
&lt;br /&gt;
What was an Action is accomplished by simply omitting Trigger Events and only defining actions. Obviously, such a rule needs to be run by some other rule or from the RM API. &lt;br /&gt;
&lt;br /&gt;
What was a Schedule is now available as a new type of Trigger Event, Days of Week Schedule.  &lt;br /&gt;
&lt;br /&gt;
Button Controller is fully incorporated as a new type of Trigger Event, Button Device.  Once Button Device is selected the full UI of Button Controller 3.0 is pulled up to define actions for any of the buttons available on the selected device.  Unlike Button Controller, these actions have full access to conditional logic and global variables.&lt;br /&gt;
&lt;br /&gt;
'''How to Build a Rule in Rule 4.0'''&lt;br /&gt;
&lt;br /&gt;
Now, for the more complex cases of a Rule, and a Triggered Rule, we will explain how a former Rule 3.0 Rule is done in Rule 4.0.  In a Rule the rule itself can be thought of as an overarching IF-THEN-ELSE, where if the rule was true in the IF part, then Actions for True would run, and if false, Actions for False would run.  This same logic can now simply be done with conditional actions IF-THEN and ELSE in the actions section of a rule.  As will be described below, IF-THEN now has the same full logical expression capability of the former Rule with AND, OR, XOR, NOT logical operators and nested parenthetical sub-expressions.  &lt;br /&gt;
&lt;br /&gt;
The trigger event is contact sensor &amp;quot;Front Door *changed*&amp;quot;.  In an old Rule, this is exactly how the Condition of Front Door *open* was interpreted -- the rule would be evaluated whenever any event happened for the Front Door.  Instead of that being implicit in the old Rule, now it is explicit in the 4.0 rule.  In the old Rule, our rule was &amp;quot;Front Door *open*&amp;quot;.  Now we make that the condition of an IF-THEN action.  What were Actions for True become the actions following IF-THEN, and Actions for False become the actions following ELSE.  Most Rules follow this basic format.  &lt;br /&gt;
&lt;br /&gt;
'''What became of Rule Truth and Cancel on Truth Change?'''&lt;br /&gt;
&lt;br /&gt;
There are two subtle issues from Rule 3.0 that have changed, cancel on truth change and requiring truth change to take action.  The concept of rule truth is gone in Rule 4.0.  Instead, all of this is now explicit in the way you write the actions for a rule.  Below are two examples to illustrate cancel on truth change, first for 3.0 and then 4.0.  This rule uses Cancel On Truth Change to keep some lights on as long as motion is active:&lt;br /&gt;
&lt;br /&gt;
If we don't want the actions to run unless there was a change, the equivalent of change in rule truth of a 3.0 Rule, we can do that explicitly using Private Boolean.  In the example above, if one of the two motion sensors went inactive, and then became active again before the lights turned off, the actions would run again, turning the lights on again.  Generally, this is harmless.  &lt;br /&gt;
&lt;br /&gt;
What this accomplishes is that once the lights are turned on from motion active, Private Boolean is set to false, and 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.&lt;br /&gt;
&lt;br /&gt;
'''What  about Triggered Rules?'''&lt;br /&gt;
&lt;br /&gt;
All &amp;quot;rules&amp;quot; in Rule 4.0 are in effect Triggered Rules.  The rules shown above, the equivalents in Rule 4.0 for Rules in 3.0, are all triggered rules.  They each have a trigger event, and then conditional actions.  Instead of a rule with Actions for True and Actions for False, as with other rules in 4.0 they simply use conditional logic in the actions to create an equivalent IF-THEN-ELSE structure.&lt;br /&gt;
&lt;br /&gt;
== Conditional Actions and Logical Expressions ==&lt;br /&gt;
&lt;br /&gt;
Rule 4.0 clearly depends entirely on the conditional actions now available for making decisions in rules about what to do.&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 3.0, 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Automatic Condition Creation'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Every condition that you create in a Conditional action is available for use in other actions, and can be edited. &lt;br /&gt;
&lt;br /&gt;
== Wait for Events and Elapsed Time ==&lt;br /&gt;
&lt;br /&gt;
The Wait for Event action from Rule 3.0 has changed to Wait for Events.  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 a new 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.  Unlike Rule 3.0, Wait for Events and Wait for Condition may be used in a Simple Conditional Action.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=2073</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=2073"/>
		<updated>2019-06-10T22:24:24Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
See the full Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; documentation here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Notifier&amp;diff=2041</id>
		<title>Notifier</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Notifier&amp;diff=2041"/>
		<updated>2019-06-09T18:06:04Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: Created page with &amp;quot;The Hubitat Notifications App is a simple way to enable hub events from devices, Lock Code Manager, and Mode changes to send audio, SMS notifications or text not...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Hubitat Notifications App is a simple way to enable hub events from devices, [[Lock Code Manager]], and [[Modes|Mode]] changes to send audio, SMS notifications or text notifications via an app such as Pushover. Multiple users may be notified, and it is possible to have simultaneous text and text to speech audio notifications. Notifications may also be restricted to certain times, days of the week and Modes.&lt;br /&gt;
&lt;br /&gt;
===Installing the Notifications parent app===&lt;br /&gt;
&lt;br /&gt;
#From the Hubitat Web Interface select '''Apps'''[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose the Notifications app from the list of Hubitat Elevation™ Built-In Apps[[File:Install Notifications app.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Creating and configuring Notifier child apps===&lt;br /&gt;
&lt;br /&gt;
#Press the ''Create New Notifier'' button to start configuration of a '''Notifier''' child application[[File:Create New Notifier app.png|none|thumb|600x600px]]&lt;br /&gt;
#Name your Notifier child app[[File:Name notification child app.png|none|thumb|600x600px]]&lt;br /&gt;
#Select the type of device you want to monitor for notifications[[File:Select device for Notifications.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose the specific devices to monitor for your '''Notifier'''[[File:Select devices for notifier.png|none|thumb|600x600px]]'''NOTE:''' When available, you may select multiple devices to monitor for notifications[[File:Monitor multiple for notifier.png|none|thumb|600x600px]]&lt;br /&gt;
#Select which events you want to monitor for your notifications[[File:Device notification events.png|none|thumb|600x600px]]&lt;br /&gt;
#Choose for how long the event must be true before a notification is sent. For example, if a door is unlocked, should the notification be sent immediately or should it be delayed by a specified number of minutes? '''NOTE:''' If the event you are monitoring becomes false before the specified time has elapsed, such as the lock being once again locked before the 2 minute wait time has been reached as in the example below, then no notification will be sent until the event state is true for the number of minutes you define.[[File:How long before notification.png|none|thumb|600x600px]]&lt;br /&gt;
#Specify how frequently you would like to be notified about an event. Toggle the switch for '''Only once per day''', to limit notifications to one per a single 24 hour period, or you can limit the notifications to once within a specified number of minutes for events that may fluctuate frequently, such the temperature rise or fall.[[File:Notification frequency.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Configure notification types===&lt;br /&gt;
&lt;br /&gt;
#Choose the type of notification you want. You may send audio, SMS text notifications or notifications via an app such as [[Pushover]]. Multiple users may be notified, and it is possible to have simultaneous text, and text to speech audio notifications.[[File:Choose Notification type.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Text Notifications===&lt;br /&gt;
&lt;br /&gt;
#For text notifications, choose a device such as [[Pushover]]. It is not mandatory that you select a notification device, and you may simply send message by SMS if you wish, but services such as Pushover are recommended if you need to send more then '''10 text notifications per day''', which is the limit for the Hubitat Elevation™ built-in SMS text messaging capability.[[File:Select Notification device.png|none|thumb|600x600px]]&lt;br /&gt;
#You may enter custom messages to include in your text notification.[[File:Custom notification message 2.1.png|none|thumb|600x600px]]&lt;br /&gt;
#You may also add '''%device%''', '''%value%''', '''%text%''', '''%time%''', and '''%date%''' to include these variables in the message. For example, if you simple added '''%device% %value''' to the '''Custom message to send''' field for the front door lock used in the previous example, you would see '''''Front Door Lock Unlocked''''' in the text notification.[[File:Notifications by event variables.png|none|thumb|600x600px]]&lt;br /&gt;
#If you want to have more than one text message, separate them with a semicolon ''';''' and if you would prefer they are delivered in a random order, toggle the '''Random message?''' switch.[[File:Random notifications.png|none|thumb|600x600px]]&lt;br /&gt;
#If you want to use the Hubitat Elevation™ built-in SMS text messaging capability, enter your phone numbers in the format '''+1&amp;lt;10 digits&amp;gt;'''. For Example, if your phone number is 719-567-6743, then you would enter '''+17195676743'''[[File:SMS notifications.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Audio Notifications===&lt;br /&gt;
&lt;br /&gt;
#Audio notifications may be delivered via a supported speech device such as Google Home, or on a supported music device such as Sonos. Audio notification setup is similar to text notifications. You may also add '''%device%''', '''%value%''', '''%text%''', '''%time%''', and '''%date%''' to include these variables in the audio notification. For example, if you simple added '''%device% %value''' to the '''Message to speak''' field for the front door lock used in the previous example, you would hear '''''Front Door Lock Unlocked''''' in your audio notification. '''NOTE:''' When using this method with text to speech devices, it is recommended to add a comma between multiple variables for a more natural sounding intonation.[[File:Music device for notifications.png|none|thumb|600x600px]]&lt;br /&gt;
#For Music devices, it is also possible to set the volume level for messages[[File:Set audio notification volume.png|none|thumb|600x600px]]&lt;br /&gt;
&lt;br /&gt;
===Restrictions===&lt;br /&gt;
&lt;br /&gt;
#Notifications may be restricted to certain times, days of the week and Modes.[[File:Restrict Notifications.png|none|thumb|600x600px]]&lt;br /&gt;
#You may set a switch to disable notifications. For example, you may not wish to receive notifications about your front door being unlocked while you are in your home, therefore you could turn on a switch to prevent this from occurring. In the example below, this could be accomplished by creating a [[Rule Machine]] rule to enable a switch when a presence devices is active, and disable the switch when presence is no longer detected.[[File:Disable Notifications by switch.png|none|thumb|600x600px]]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2039</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2039"/>
		<updated>2019-06-06T18:11:19Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine®&amp;lt;/strong&amp;gt; is a generalized rule engine for Hubitat.  It allows you to predicate actions to be taken by Hubitat by a logical rule based on specified conditions of your system.  Rule Machine also provides Triggers, basic event-causes-action building blocks, and Triggered Rules where an event causes a rule evaluation.  Rules, Triggers, Triggered Rules, and Actions work together to create sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule is a method of specifying certain conditions and their truth relationships in order to cause some action to take place in Hubitat.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, one person posed this case:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Suppose my presence or my wife’s presence is home, there is motion in the bedroom, it’s between 8 PM and 11PM, and the temperature is below 65 — if those conditions are met, turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order for this action to take place in Hubitat, based on those conditions, Rule Machine will evaluate those conditions, and if they are met, turn on the electric blanket.  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows you to specify the conditions, the rule they must meet, and the desired actions to take place. This is called a &amp;lt;strong&amp;gt;Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggers?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A &amp;lt;strong&amp;gt;Trigger&amp;lt;/strong&amp;gt; is a simple mechanism through which some event in your system causes a selected action to take place.  This is a basic building block of automations.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example: if the door opens, turn on the light.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggered Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Triggered Rule adds a rule to be evaluated for a trigger event.  When any of its trigger events fire,  it evaluates the conditions under the rule and then takes actions based on the truth outcome of that evaluation.  This is called a &amp;lt;strong&amp;gt;Triggered Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Actions?&amp;lt;/h2&amp;gt;&lt;br /&gt;
Actions are a set of actions that can be run.  An &amp;lt;strong&amp;gt;Actions&amp;lt;/strong&amp;gt; doesn't do anything unless it is run by another rule.  They can be used by Rules, Triggers, Triggered Rules and Schedule as an action.  One defined set of actions can be used by multiple other rules or triggers without having to be defined for each one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Schedules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;strong&amp;gt;Schedule&amp;lt;/strong&amp;gt; allows a set of actions to be done at a pre-determined time.  Optionally, a second set of actions can be done after some time.  For example, a pool pump could be turned on at 5:00 AM every day, and then turned off 180 minutes later.  Schedules can be defined by day of week, including groups of days (e.g. one schedule for weekdays and a different schedule of weekends).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Conditions and Trigger Events?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows a wide range of possible conditions and events to be selected.  For rules we select conditions.  For triggers we select events.  Conditions and events are closely related because each event results in a condition.  For example, the door opening is an event and results in the condition of the door being open.  Both rules and triggers rely on events to cause their actions.  Rules examine the conditions, and act on truth change.  Triggers act on events.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of week:               Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM status:                 armed away, armed home, disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Time of day:		    between two times, including sunrise / sunset with offsets&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Triggers respond to these additional events:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button:               pressed / held&lt;br /&gt;
Certain Time:         at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:      hitting URL fires&lt;br /&gt;
Local End Point:      hitting URL fires&lt;br /&gt;
Periodic:             Allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical switch:      on / off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For each condition/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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, the conditions for the electric blanket case are,&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present (ANY)&amp;lt;br&amp;gt;bedroom motion is active&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;How is a rule defined?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is a logical expression built up using the conditions and the three logical operators &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;, along with parenthesized sub-rules, each of which is itself a logical expression.  A logical expression defines the logical relationship between the various conditions.  In order to decide if the end action should be taken or not, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the truth of the defined rule.  In the electric blanket case, we have a very simple rule: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;bedroom motion is active AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There can be more complex rules than this.  Suppose we want the same basic rule, but want it to apply if either bedroom motion is active or the bedroom door is closed.  We would add the additional condition of “bedroom door is closed”.  That rule would be this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;(bedroom motion is active OR bedroom door is closed) AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we have used parentheses to group two conditions into a sub-rule: (bedroom motion is active &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; bedroom door is closed).  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows arbitrarily complex rules to be defined, with parentheses used to group conditions into sub-rules.  To use this feature of sub-rules in parentheses, you must first turn on the &amp;quot;Advanced Rule input&amp;quot; option, at the beginning of the Define Rule page.  It allows nested sub-rules to any depth, and it allows any number of conditions.  To help you see exactly the rule you are building, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; displays the partial rule at each step as you define it.  See screen shots in a following post.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; is a fully generalized rule engine.  The logical expression can be described as a sequence of terms, separated by operators, where each term is either a condition or a parenthesized sub-rule, and the operators are &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;.  The evaluation of a rule or sub-rule is strictly left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without further evaluation.  For those familiar with coding, there is no operator precedence as to &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, only for &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; that applies to the term it precedes.  Each rule or sub-rule may have as many terms as desired, each separated by &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;.  Any term may be logically negated by preceding it with the &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Evaluation for Rules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is installed with conditions, rule, and actions. For a rule, whenever something happens in Hubitat that could affect the conditions, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the rule to see if it is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.  If it becomes &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then it will take some selected actions; if it becomes &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, it can take some other selected actions.  In the case of the electric blanket, the rule would be evaluated whenever any of the following things happen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence arrives or leaves&amp;lt;br&amp;gt;the bedroom motion goes active or inactive&amp;lt;br&amp;gt;the bedroom door is opened or closed&amp;lt;br&amp;gt;the time becomes 8:00 PM, or becomes 11:00 PM&amp;lt;br&amp;gt;the bedroom temperature is reported&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Since our rule for this case involves all of these possible events, any of those events might be the one that changes the evaluation outcome from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.  If that happens, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; only acts on the change of rule state from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, except in the case of a trigger event causing rule evaluation.  It may evaluate the rule many times, depending on what sort of events are subscribed to, but only a truth change causes action.  A trigger causing rule evaluation will result in action if the rule is true, without regard to prior rule truth or rule truth changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The evaluation of a rule  is strictly from left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without any further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without any further evaluation.  You must take this into consideration as you define your rule, if you have many terms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Triggered Rule&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a trigger event of a triggered rule occurs the conditions are evaluated under the rule, and then actions are taken based on the true/false outcome.  Only a trigger event will cause rule evaluation, and the action will be performed irrespective of the prior rule truth (unlike a rule, above).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Actions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  These actions can be run in whatever order you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action. &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated.  This supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  The action End Repetition can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a rule proves &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions for True page.  When a Rule proves &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;,  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions on the Actions for False page.  When a Trigger event occurs for a trigger, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions page.  When a trigger event occurs for a Triggered Rule, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will evaluate the rule and do the Actions for True or Actions for False accordingly.  A Schedule does one set of Actions at the scheduled time, and optionally another set of actions some time later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The actions supported are the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Control Switches, Capture and Restore: &lt;br /&gt;
     Turn on these switches&lt;br /&gt;
     Turn off these switches&lt;br /&gt;
     Toggle these switches&lt;br /&gt;
     Flash these switches&lt;br /&gt;
     Set these switches per mode&lt;br /&gt;
     Capture Devices&lt;br /&gt;
     Restore Devices&lt;br /&gt;
Set Dimmers:&lt;br /&gt;
     Set these dimmers&lt;br /&gt;
     Toggle these dimmers&lt;br /&gt;
     Adjust these dimmers&lt;br /&gt;
     Set these dimmers per mode&lt;br /&gt;
     Fade these dimmers over time&lt;br /&gt;
     Start raising dimmers&lt;br /&gt;
     Start lowering dimmers&lt;br /&gt;
     Stop changing dimmers&lt;br /&gt;
Set Color or Color Temperature Bulbs: &lt;br /&gt;
     Set color&lt;br /&gt;
     Set color per mode&lt;br /&gt;
     Set color temperature&lt;br /&gt;
     Set color temperature per mode&lt;br /&gt;
Activate Scenes, Adjust Shades or Fans: &lt;br /&gt;
     Activate scenes&lt;br /&gt;
     Activate scenes per mode&lt;br /&gt;
     Open shades&lt;br /&gt;
     Close shades&lt;br /&gt;
     Set shade position&lt;br /&gt;
     Set fan speed&lt;br /&gt;
     Adjust fans&lt;br /&gt;
Control HSM, Garage Doors, Locks or Valves: &lt;br /&gt;
     Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
     Open garage door&lt;br /&gt;
     Close garage door&lt;br /&gt;
     Lock locks&lt;br /&gt;
     Unlock locks&lt;br /&gt;
     Open valves&lt;br /&gt;
     Close valves&lt;br /&gt;
Control Thermostats or Thermostat Scheduler: &lt;br /&gt;
     Set thermostats&lt;br /&gt;
     Set Thermostat Scheduler&lt;br /&gt;
Send or Speak a Message, Send HTTP Request: &lt;br /&gt;
     Send or Speak a Message&lt;br /&gt;
     Send HTTP Get&lt;br /&gt;
     Send HTTP Post&lt;br /&gt;
Control Music Player Sounds: &lt;br /&gt;
     Control Music Player&lt;br /&gt;
     Sound Tone&lt;br /&gt;
     Control Siren&lt;br /&gt;
Set Mode or Global Variables, Push Buttons: &lt;br /&gt;
     Set Mode&lt;br /&gt;
     Set Global Variable&lt;br /&gt;
     Push a button&lt;br /&gt;
     Push a button per mode&lt;br /&gt;
Set Private Boolean, Run/Stop/Pause Rules: &lt;br /&gt;
     Set Private Booleans True&lt;br /&gt;
     Set Private Booleans False&lt;br /&gt;
     Evaluate Rules&lt;br /&gt;
     Run Rule Actions&lt;br /&gt;
     Stop Rule Actions&lt;br /&gt;
     Pause Rules&lt;br /&gt;
     Resume Rules&lt;br /&gt;
Run Custom Action or Custom Command, Polling: &lt;br /&gt;
     Run Custom Action&lt;br /&gt;
     Run Custom Command&lt;br /&gt;
     Refresh devices&lt;br /&gt;
     Poll devices&lt;br /&gt;
     Start Z-Wave poll on switches&lt;br /&gt;
     Stop Z-Wave poll on switches&lt;br /&gt;
     Start Z-Wave poll on dimmers&lt;br /&gt;
     Stop Z-Wave poll on dimmers&lt;br /&gt;
Delay or Repeat Actions: &lt;br /&gt;
     Delay Actions&lt;br /&gt;
     Delay Actions Per Mode&lt;br /&gt;
     Repeat Actions&lt;br /&gt;
     End Repetition&lt;br /&gt;
Conditional Actions: &lt;br /&gt;
     Simple Conditional Action&lt;br /&gt;
     IF (condition) THEN&lt;br /&gt;
     ELSE-IF (condition) THEN&lt;br /&gt;
     ELSE&lt;br /&gt;
     END-IF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note&amp;lt;/strong&amp;gt;: Multiple phone numbers may be entered for SMS messages, each separated by a comma.  Phone numbers must begin with +1.  Messages may have embedded values from the most recent rule event, as follows:&lt;br /&gt;
  %device%     name of last event device&lt;br /&gt;
  %value%      value of last event&lt;br /&gt;
  %time%       time of last event&lt;br /&gt;
  %date%       date of last event&lt;br /&gt;
  %now%        current time&lt;br /&gt;
  %variable%   value of Global Variable, use its name&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule - Trigger Integration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One of the most powerful features of Rule Machine is the ability of Rules and Triggers to be combined to create sophisticated automations.  Just as with the devices in your system, the Rules you have in Rule Machine have a state, their truth state.  Both Rules and Triggers can use rule-truth as a condition or as an event.  This leads to many possibilities, several of which are very useful:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Trigger can use rule-truth as an event.  When a Rule changes state, a Trigger can take actions.  This integration allows you to have additional actions for each Rule.  If you need more Actions for True, simply create a Trigger tied to rule-truth for that Rule becoming true, and you have additional actions available in the Trigger.  For example, suppose you want one Rule to start a sequence of actions.  Perhaps do one thing after 3 minutes, something else after 10 minutes, and then a final thing after 30 minutes.  One Rule plus two Triggers can do this, where each Trigger is tied to the rule-truth, then has an action that it delays taking for 10, or 30 minutes; the rule itself has the action of true of doing something after 3 minutes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule can also use rule-truth as a condition.  This feature allows generalized linking of Rules.  One example would be to have a master set of conditions, that several Rules would need.  One Rule has those conditions but no actions.  The other Rules have the first rule-truth as a condition, and have whatever additional conditions they need, and take whatever actions they want.  This can make repetitive rule creation much simpler, or lead to very sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can take an action to cause a selected Rule (or Rules) to be evaluated.  This would allow, for example, a button to cause a Rule to be evaluated, through the use of a Trigger tied to the button.  Or, at a certain time of day, a Rule can be caused to be evaluated.  The reason these things might be useful, is that ordinarily a Rule only takes action when it changes truth state.  By causing a rule evaluation, the actions will be taken as selected for that Rule based on its truth, irrespective of the prior state of the rule-truth for that Rule.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can also cause a selected Rule or Rules to have their Actions for True run irrespective of the Rule's Conditions or Rule.  This allows for triggers to share a Rule's actions, while preserving its Rule (vs. Triggered Rule) nature.  It is also possible to create a Rule that has no Triggers and no Conditions, a Rule that only has Actions.  Such a Rule can be run from any other Trigger or Rule as an action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Warning&amp;lt;/strong&amp;gt;: It is possible with Rule-Trigger integration and Private Boolean to create rules with circular logic, possible indirect circular logic.  These are doomed to fail, sometimes by falling into infinite loops.  DO NOT use these features to create circularity, and be careful about the logic patterns you create by linking rules.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2038</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2038"/>
		<updated>2019-06-06T18:08:34Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine®&amp;lt;/strong&amp;gt; is a generalized rule engine for Hubitat.  It allows you to predicate actions to be taken by Hubitat by a logical rule based on specified conditions of your system.  Rule Machine also provides Triggers, basic event-causes-action building blocks, and Triggered Rules where an event causes a rule evaluation.  Rules, Triggers, Triggered Rules, and Actions work together to create sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule is a method of specifying certain conditions and their truth relationships in order to cause some action to take place in Hubitat.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, one person posed this case:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Suppose my presence or my wife’s presence is home, there is motion in the bedroom, it’s between 8 PM and 11PM, and the temperature is below 65 — if those conditions are met, turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order for this action to take place in Hubitat, based on those conditions, Rule Machine will evaluate those conditions, and if they are met, turn on the electric blanket.  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows you to specify the conditions, the rule they must meet, and the desired actions to take place. This is called a &amp;lt;strong&amp;gt;Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggers?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A &amp;lt;strong&amp;gt;Trigger&amp;lt;/strong&amp;gt; is a simple mechanism through which some event in your system causes a selected action to take place.  This is a basic building block of automations.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example: if the door opens, turn on the light.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggered Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Triggered Rule adds a rule to be evaluated for a trigger event.  When any of its trigger events fire,  it evaluates the conditions under the rule and then takes actions based on the truth outcome of that evaluation.  This is called a &amp;lt;strong&amp;gt;Triggered Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Actions?&amp;lt;/h2&amp;gt;&lt;br /&gt;
Actions are a set of actions that can be run.  An &amp;lt;strong&amp;gt;Actions&amp;lt;/strong&amp;gt; doesn't do anything unless it is run by another rule.  They can be used by Rules, Triggers, Triggered Rules and Schedule as an action.  One defined set of actions can be used by multiple other rules or triggers without having to be defined for each one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Schedules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;strong&amp;gt;Schedule&amp;lt;/strong&amp;gt; allows a set of actions to be done at a pre-determined time.  Optionally, a second set of actions can be done after some time.  For example, a pool pump could be turned on at 5:00 AM every day, and then turned off 180 minutes later.  Schedules can be defined by day of week, including groups of days (e.g. one schedule for weekdays and a different schedule of weekends).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Conditions and Trigger Events?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows a wide range of possible conditions and events to be selected.  For rules we select conditions.  For triggers we select events.  Conditions and events are closely related because each event results in a condition.  For example, the door opening is an event and results in the condition of the door being open.  Both rules and triggers rely on events to cause their actions.  Rules examine the conditions, and act on truth change.  Triggers act on events.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of week:               Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM status:                 armed away, armed home, disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Time of day:		    between two times, including sunrise / sunset with offsets&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Triggers respond to these additional events:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button:               pressed / held&lt;br /&gt;
Certain Time:         at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:      hitting URL fires&lt;br /&gt;
Local End Point:      hitting URL fires&lt;br /&gt;
Periodic:             Allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical switch:      on / off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For each condition/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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, the conditions for the electric blanket case are,&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present (ANY)&amp;lt;br&amp;gt;bedroom motion is active&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;How is a rule defined?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is a logical expression built up using the conditions and the three logical operators &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;, along with parenthesized sub-rules, each of which is itself a logical expression.  A logical expression defines the logical relationship between the various conditions.  In order to decide if the end action should be taken or not, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the truth of the defined rule.  In the electric blanket case, we have a very simple rule: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;bedroom motion is active AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There can be more complex rules than this.  Suppose we want the same basic rule, but want it to apply if either bedroom motion is active or the bedroom door is closed.  We would add the additional condition of “bedroom door is closed”.  That rule would be this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;(bedroom motion is active OR bedroom door is closed) AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we have used parentheses to group two conditions into a sub-rule: (bedroom motion is active &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; bedroom door is closed).  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows arbitrarily complex rules to be defined, with parentheses used to group conditions into sub-rules.  To use this feature of sub-rules in parentheses, you must first turn on the &amp;quot;Advanced Rule input&amp;quot; option, at the beginning of the Define Rule page.  It allows nested sub-rules to any depth, and it allows any number of conditions.  To help you see exactly the rule you are building, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; displays the partial rule at each step as you define it.  See screen shots in a following post.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; is a fully generalized rule engine.  The logical expression can be described as a sequence of terms, separated by operators, where each term is either a condition or a parenthesized sub-rule, and the operators are &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;.  The evaluation of a rule or sub-rule is strictly left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without further evaluation.  For those familiar with coding, there is no operator precedence as to &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, only for &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; that applies to the term it precedes.  Each rule or sub-rule may have as many terms as desired, each separated by &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;.  Any term may be logically negated by preceding it with the &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Evaluation for Rules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is installed with conditions, rule, and actions. For a rule, whenever something happens in Hubitat that could affect the conditions, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the rule to see if it is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.  If it becomes &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then it will take some selected actions; if it becomes &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, it can take some other selected actions.  In the case of the electric blanket, the rule would be evaluated whenever any of the following things happen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence arrives or leaves&amp;lt;br&amp;gt;the bedroom motion goes active or inactive&amp;lt;br&amp;gt;the bedroom door is opened or closed&amp;lt;br&amp;gt;the time becomes 8:00 PM, or becomes 11:00 PM&amp;lt;br&amp;gt;the bedroom temperature is reported&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Since our rule for this case involves all of these possible events, any of those events might be the one that changes the evaluation outcome from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.  If that happens, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; only acts on the change of rule state from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, except in the case of a trigger event causing rule evaluation.  It may evaluate the rule many times, depending on what sort of events are subscribed to, but only a truth change causes action.  A trigger causing rule evaluation will result in action if the rule is true, without regard to prior rule truth or rule truth changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The evaluation of a rule  is strictly from left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without any further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without any further evaluation.  You must take this into consideration as you define your rule, if you have many terms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Triggered Rule&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a trigger event of a triggered rule occurs the conditions are evaluated under the rule, and then actions are taken based on the true/false outcome.  Only a trigger event will cause rule evaluation, and the action will be performed irrespective of the prior rule truth (unlike a rule, above).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Actions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  These actions can be run in whatever order you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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 delayed action starts its delay timer -- it doesn't wait for that delay timer to run.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action. &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated.  This supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  The action End Repetition can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a rule proves &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions for True page.  When a Rule proves &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;,  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions on the Actions for False page.  When a Trigger event occurs for a trigger, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions page.  When a trigger event occurs for a Triggered Rule, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will evaluate the rule and do the Actions for True or Actions for False accordingly.  A Schedule does one set of Actions at the scheduled time, and optionally another set of actions some time later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The actions supported are the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Control Switches, Capture and Restore: &lt;br /&gt;
     Turn on these switches&lt;br /&gt;
     Turn off these switches&lt;br /&gt;
     Toggle these switches&lt;br /&gt;
     Flash these switches&lt;br /&gt;
     Set these switches per mode&lt;br /&gt;
     Capture Devices&lt;br /&gt;
     Restore Devices&lt;br /&gt;
Set Dimmers:&lt;br /&gt;
     Set these dimmers&lt;br /&gt;
     Toggle these dimmers&lt;br /&gt;
     Adjust these dimmers&lt;br /&gt;
     Set these dimmers per mode&lt;br /&gt;
     Fade these dimmers over time&lt;br /&gt;
     Start raising dimmers&lt;br /&gt;
     Start lowering dimmers&lt;br /&gt;
     Stop changing dimmers&lt;br /&gt;
Set Color or Color Temperature Bulbs: &lt;br /&gt;
     Set color&lt;br /&gt;
     Set color per mode&lt;br /&gt;
     Set color temperature&lt;br /&gt;
     Set color temperature per mode&lt;br /&gt;
Activate Scenes, Adjust Shades or Fans: &lt;br /&gt;
     Activate scenes&lt;br /&gt;
     Activate scenes per mode&lt;br /&gt;
     Open shades&lt;br /&gt;
     Close shades&lt;br /&gt;
     Set shade position&lt;br /&gt;
     Set fan speed&lt;br /&gt;
     Adjust fans&lt;br /&gt;
Control HSM, Garage Doors, Locks or Valves: &lt;br /&gt;
     Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
     Open garage door&lt;br /&gt;
     Close garage door&lt;br /&gt;
     Lock locks&lt;br /&gt;
     Unlock locks&lt;br /&gt;
     Open valves&lt;br /&gt;
     Close valves&lt;br /&gt;
Control Thermostats or Thermostat Scheduler: &lt;br /&gt;
     Set thermostats&lt;br /&gt;
     Set Thermostat Scheduler&lt;br /&gt;
Send or Speak a Message, Send HTTP Request: &lt;br /&gt;
     Send or Speak a Message&lt;br /&gt;
     Send HTTP Get&lt;br /&gt;
     Send HTTP Post&lt;br /&gt;
Control Music Player Sounds: &lt;br /&gt;
     Control Music Player&lt;br /&gt;
     Sound Tone&lt;br /&gt;
     Control Siren&lt;br /&gt;
Set Mode or Global Variables, Push Buttons: &lt;br /&gt;
     Set Mode&lt;br /&gt;
     Set Global Variable&lt;br /&gt;
     Push a button&lt;br /&gt;
     Push a button per mode&lt;br /&gt;
Set Private Boolean, Run/Stop/Pause Rules: &lt;br /&gt;
     Set Private Booleans True&lt;br /&gt;
     Set Private Booleans False&lt;br /&gt;
     Evaluate Rules&lt;br /&gt;
     Run Rule Actions&lt;br /&gt;
     Stop Rule Actions&lt;br /&gt;
     Pause Rules&lt;br /&gt;
     Resume Rules&lt;br /&gt;
Run Custom Action or Custom Command, Polling: &lt;br /&gt;
     Run Custom Action&lt;br /&gt;
     Run Custom Command&lt;br /&gt;
     Refresh devices&lt;br /&gt;
     Poll devices&lt;br /&gt;
     Start Z-Wave poll on switches&lt;br /&gt;
     Stop Z-Wave poll on switches&lt;br /&gt;
     Start Z-Wave poll on dimmers&lt;br /&gt;
     Stop Z-Wave poll on dimmers&lt;br /&gt;
Delay or Repeat Actions: &lt;br /&gt;
     Delay Actions&lt;br /&gt;
     Delay Actions Per Mode&lt;br /&gt;
     Repeat Actions&lt;br /&gt;
     End Repetition&lt;br /&gt;
Conditional Actions: &lt;br /&gt;
     Simple Conditional Action&lt;br /&gt;
     IF (condition) THEN&lt;br /&gt;
     ELSE-IF (condition) THEN&lt;br /&gt;
     ELSE&lt;br /&gt;
     END-IF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note&amp;lt;/strong&amp;gt;: Multiple phone numbers may be entered for SMS messages, each separated by a comma.  Phone numbers must begin with +1.  Messages may have embedded values from the most recent rule event, as follows:&lt;br /&gt;
  %device%     name of last event device&lt;br /&gt;
  %value%      value of last event&lt;br /&gt;
  %time%       time of last event&lt;br /&gt;
  %date%       date of last event&lt;br /&gt;
  %now%        current time&lt;br /&gt;
  %variable%   value of Global Variable, use its name&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule - Trigger Integration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One of the most powerful features of Rule Machine is the ability of Rules and Triggers to be combined to create sophisticated automations.  Just as with the devices in your system, the Rules you have in Rule Machine have a state, their truth state.  Both Rules and Triggers can use rule-truth as a condition or as an event.  This leads to many possibilities, several of which are very useful:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Trigger can use rule-truth as an event.  When a Rule changes state, a Trigger can take actions.  This integration allows you to have additional actions for each Rule.  If you need more Actions for True, simply create a Trigger tied to rule-truth for that Rule becoming true, and you have additional actions available in the Trigger.  For example, suppose you want one Rule to start a sequence of actions.  Perhaps do one thing after 3 minutes, something else after 10 minutes, and then a final thing after 30 minutes.  One Rule plus two Triggers can do this, where each Trigger is tied to the rule-truth, then has an action that it delays taking for 10, or 30 minutes; the rule itself has the action of true of doing something after 3 minutes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule can also use rule-truth as a condition.  This feature allows generalized linking of Rules.  One example would be to have a master set of conditions, that several Rules would need.  One Rule has those conditions but no actions.  The other Rules have the first rule-truth as a condition, and have whatever additional conditions they need, and take whatever actions they want.  This can make repetitive rule creation much simpler, or lead to very sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can take an action to cause a selected Rule (or Rules) to be evaluated.  This would allow, for example, a button to cause a Rule to be evaluated, through the use of a Trigger tied to the button.  Or, at a certain time of day, a Rule can be caused to be evaluated.  The reason these things might be useful, is that ordinarily a Rule only takes action when it changes truth state.  By causing a rule evaluation, the actions will be taken as selected for that Rule based on its truth, irrespective of the prior state of the rule-truth for that Rule.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can also cause a selected Rule or Rules to have their Actions for True run irrespective of the Rule's Conditions or Rule.  This allows for triggers to share a Rule's actions, while preserving its Rule (vs. Triggered Rule) nature.  It is also possible to create a Rule that has no Triggers and no Conditions, a Rule that only has Actions.  Such a Rule can be run from any other Trigger or Rule as an action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Warning&amp;lt;/strong&amp;gt;: It is possible with Rule-Trigger integration and Private Boolean to create rules with circular logic, possible indirect circular logic.  These are doomed to fail, sometimes by falling into infinite loops.  DO NOT use these features to create circularity, and be careful about the logic patterns you create by linking rules.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2021</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=2021"/>
		<updated>2019-05-25T02:24:53Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine®&amp;lt;/strong&amp;gt; is a generalized rule engine for Hubitat.  It allows you to predicate actions to be taken by Hubitat by a logical rule based on specified conditions of your system.  Rule Machine also provides Triggers, basic event-causes-action building blocks, and Triggered Rules where an event causes a rule evaluation.  Rules, Triggers, Triggered Rules, and Actions work together to create sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule is a method of specifying certain conditions and their truth relationships in order to cause some action to take place in Hubitat.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, one person posed this case:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Suppose my presence or my wife’s presence is home, there is motion in the bedroom, it’s between 8 PM and 11PM, and the temperature is below 65 — if those conditions are met, turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order for this action to take place in Hubitat, based on those conditions, Rule Machine will evaluate those conditions, and if they are met, turn on the electric blanket.  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows you to specify the conditions, the rule they must meet, and the desired actions to take place. This is called a &amp;lt;strong&amp;gt;Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggers?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A &amp;lt;strong&amp;gt;Trigger&amp;lt;/strong&amp;gt; is a simple mechanism through which some event in your system causes a selected action to take place.  This is a basic building block of automations.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example: if the door opens, turn on the light.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggered Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Triggered Rule adds a rule to be evaluated for a trigger event.  When any of its trigger events fire,  it evaluates the conditions under the rule and then takes actions based on the truth outcome of that evaluation.  This is called a &amp;lt;strong&amp;gt;Triggered Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Actions?&amp;lt;/h2&amp;gt;&lt;br /&gt;
Actions are a set of actions that can be run.  An &amp;lt;strong&amp;gt;Actions&amp;lt;/strong&amp;gt; doesn't do anything unless it is run by another rule.  They can be used by Rules, Triggers, Triggered Rules and Schedule as an action.  One defined set of actions can be used by multiple other rules or triggers without having to be defined for each one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Schedules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;strong&amp;gt;Schedule&amp;lt;/strong&amp;gt; allows a set of actions to be done at a pre-determined time.  Optionally, a second set of actions can be done after some time.  For example, a pool pump could be turned on at 5:00 AM every day, and then turned off 180 minutes later.  Schedules can be defined by day of week, including groups of days (e.g. one schedule for weekdays and a different schedule of weekends).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Conditions and Trigger Events?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows a wide range of possible conditions and events to be selected.  For rules we select conditions.  For triggers we select events.  Conditions and events are closely related because each event results in a condition.  For example, the door opening is an event and results in the condition of the door being open.  Both rules and triggers rely on events to cause their actions.  Rules examine the conditions, and act on truth change.  Triggers act on events.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of week:               Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM status:                 armed away, armed home, disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Time of day:		    between two times, including sunrise / sunset with offsets&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Triggers respond to these additional events:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button:               pressed / held&lt;br /&gt;
Certain Time:         at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:      hitting URL fires&lt;br /&gt;
Local End Point:      hitting URL fires&lt;br /&gt;
Periodic:             Allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical switch:      on / off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For each condition/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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, the conditions for the electric blanket case are,&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present (ANY)&amp;lt;br&amp;gt;bedroom motion is active&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;How is a rule defined?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is a logical expression built up using the conditions and the three logical operators &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;, along with parenthesized sub-rules, each of which is itself a logical expression.  A logical expression defines the logical relationship between the various conditions.  In order to decide if the end action should be taken or not, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the truth of the defined rule.  In the electric blanket case, we have a very simple rule: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;bedroom motion is active AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There can be more complex rules than this.  Suppose we want the same basic rule, but want it to apply if either bedroom motion is active or the bedroom door is closed.  We would add the additional condition of “bedroom door is closed”.  That rule would be this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;(bedroom motion is active OR bedroom door is closed) AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we have used parentheses to group two conditions into a sub-rule: (bedroom motion is active &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; bedroom door is closed).  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows arbitrarily complex rules to be defined, with parentheses used to group conditions into sub-rules.  To use this feature of sub-rules in parentheses, you must first turn on the &amp;quot;Advanced Rule input&amp;quot; option, at the beginning of the Define Rule page.  It allows nested sub-rules to any depth, and it allows any number of conditions.  To help you see exactly the rule you are building, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; displays the partial rule at each step as you define it.  See screen shots in a following post.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; is a fully generalized rule engine.  The logical expression can be described as a sequence of terms, separated by operators, where each term is either a condition or a parenthesized sub-rule, and the operators are &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;.  The evaluation of a rule or sub-rule is strictly left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without further evaluation.  For those familiar with coding, there is no operator precedence as to &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, only for &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; that applies to the term it precedes.  Each rule or sub-rule may have as many terms as desired, each separated by &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;.  Any term may be logically negated by preceding it with the &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Evaluation for Rules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is installed with conditions, rule, and actions. For a rule, whenever something happens in Hubitat that could affect the conditions, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the rule to see if it is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.  If it becomes &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then it will take some selected actions; if it becomes &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, it can take some other selected actions.  In the case of the electric blanket, the rule would be evaluated whenever any of the following things happen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence arrives or leaves&amp;lt;br&amp;gt;the bedroom motion goes active or inactive&amp;lt;br&amp;gt;the bedroom door is opened or closed&amp;lt;br&amp;gt;the time becomes 8:00 PM, or becomes 11:00 PM&amp;lt;br&amp;gt;the bedroom temperature is reported&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Since our rule for this case involves all of these possible events, any of those events might be the one that changes the evaluation outcome from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.  If that happens, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; only acts on the change of rule state from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, except in the case of a trigger event causing rule evaluation.  It may evaluate the rule many times, depending on what sort of events are subscribed to, but only a truth change causes action.  A trigger causing rule evaluation will result in action if the rule is true, without regard to prior rule truth or rule truth changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The evaluation of a rule  is strictly from left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without any further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without any further evaluation.  You must take this into consideration as you define your rule, if you have many terms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Triggered Rule&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a trigger event of a triggered rule occurs the conditions are evaluated under the rule, and then actions are taken based on the true/false outcome.  Only a trigger event will cause rule evaluation, and the action will be performed irrespective of the prior rule truth (unlike a rule, above).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Actions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  These actions can be run in whatever order you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action. &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated.  This supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  The action End Repetition can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a rule proves &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions for True page.  When a Rule proves &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;,  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions on the Actions for False page.  When a Trigger event occurs for a trigger, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions page.  When a trigger event occurs for a Triggered Rule, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will evaluate the rule and do the Actions for True or Actions for False accordingly.  A Schedule does one set of Actions at the scheduled time, and optionally another set of actions some time later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The actions supported are the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Control Switches, Capture and Restore: &lt;br /&gt;
     Turn on these switches&lt;br /&gt;
     Turn off these switches&lt;br /&gt;
     Toggle these switches&lt;br /&gt;
     Flash these switches&lt;br /&gt;
     Set these switches per mode&lt;br /&gt;
     Capture Devices&lt;br /&gt;
     Restore Devices&lt;br /&gt;
Set Dimmers:&lt;br /&gt;
     Set these dimmers&lt;br /&gt;
     Toggle these dimmers&lt;br /&gt;
     Adjust these dimmers&lt;br /&gt;
     Set these dimmers per mode&lt;br /&gt;
     Fade these dimmers over time&lt;br /&gt;
     Start raising dimmers&lt;br /&gt;
     Start lowering dimmers&lt;br /&gt;
     Stop changing dimmers&lt;br /&gt;
Set Color or Color Temperature Bulbs: &lt;br /&gt;
     Set color&lt;br /&gt;
     Set color per mode&lt;br /&gt;
     Set color temperature&lt;br /&gt;
     Set color temperature per mode&lt;br /&gt;
Activate Scenes, Adjust Shades or Fans: &lt;br /&gt;
     Activate scenes&lt;br /&gt;
     Activate scenes per mode&lt;br /&gt;
     Open shades&lt;br /&gt;
     Close shades&lt;br /&gt;
     Set shade position&lt;br /&gt;
     Set fan speed&lt;br /&gt;
     Adjust fans&lt;br /&gt;
Control HSM, Garage Doors, Locks or Valves: &lt;br /&gt;
     Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
     Open garage door&lt;br /&gt;
     Close garage door&lt;br /&gt;
     Lock locks&lt;br /&gt;
     Unlock locks&lt;br /&gt;
     Open valves&lt;br /&gt;
     Close valves&lt;br /&gt;
Control Thermostats or Thermostat Scheduler: &lt;br /&gt;
     Set thermostats&lt;br /&gt;
     Set Thermostat Scheduler&lt;br /&gt;
Send or Speak a Message, Send HTTP Request: &lt;br /&gt;
     Send or Speak a Message&lt;br /&gt;
     Send HTTP Get&lt;br /&gt;
     Send HTTP Post&lt;br /&gt;
Control Music Player Sounds: &lt;br /&gt;
     Control Music Player&lt;br /&gt;
     Sound Tone&lt;br /&gt;
     Control Siren&lt;br /&gt;
Set Mode or Global Variables, Push Buttons: &lt;br /&gt;
     Set Mode&lt;br /&gt;
     Set Global Variable&lt;br /&gt;
     Push a button&lt;br /&gt;
     Push a button per mode&lt;br /&gt;
Set Private Boolean, Run/Stop/Pause Rules: &lt;br /&gt;
     Set Private Booleans True&lt;br /&gt;
     Set Private Booleans False&lt;br /&gt;
     Evaluate Rules&lt;br /&gt;
     Run Rule Actions&lt;br /&gt;
     Stop Rule Actions&lt;br /&gt;
     Pause Rules&lt;br /&gt;
     Resume Rules&lt;br /&gt;
Run Custom Action or Custom Command, Polling: &lt;br /&gt;
     Run Custom Action&lt;br /&gt;
     Run Custom Command&lt;br /&gt;
     Refresh devices&lt;br /&gt;
     Poll devices&lt;br /&gt;
     Start Z-Wave poll on switches&lt;br /&gt;
     Stop Z-Wave poll on switches&lt;br /&gt;
     Start Z-Wave poll on dimmers&lt;br /&gt;
     Stop Z-Wave poll on dimmers&lt;br /&gt;
Delay or Repeat Actions: &lt;br /&gt;
     Delay Actions&lt;br /&gt;
     Delay Actions Per Mode&lt;br /&gt;
     Repeat Actions&lt;br /&gt;
     End Repetition&lt;br /&gt;
Conditional Actions: &lt;br /&gt;
     Simple Conditional Action&lt;br /&gt;
     IF (condition) THEN&lt;br /&gt;
     ELSE-IF (condition) THEN&lt;br /&gt;
     ELSE&lt;br /&gt;
     END-IF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note&amp;lt;/strong&amp;gt;: Multiple phone numbers may be entered for SMS messages, each separated by a comma.  Phone numbers must begin with +1.  Messages may have embedded values from the most recent rule event, as follows:&lt;br /&gt;
  %device%     name of last event device&lt;br /&gt;
  %value%      value of last event&lt;br /&gt;
  %time%       time of last event&lt;br /&gt;
  %date%       date of last event&lt;br /&gt;
  %now%        current time&lt;br /&gt;
  %variable%   value of Global Variable, use its name&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule - Trigger Integration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One of the most powerful features of Rule Machine is the ability of Rules and Triggers to be combined to create sophisticated automations.  Just as with the devices in your system, the Rules you have in Rule Machine have a state, their truth state.  Both Rules and Triggers can use rule-truth as a condition or as an event.  This leads to many possibilities, several of which are very useful:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Trigger can use rule-truth as an event.  When a Rule changes state, a Trigger can take actions.  This integration allows you to have additional actions for each Rule.  If you need more Actions for True, simply create a Trigger tied to rule-truth for that Rule becoming true, and you have additional actions available in the Trigger.  For example, suppose you want one Rule to start a sequence of actions.  Perhaps do one thing after 3 minutes, something else after 10 minutes, and then a final thing after 30 minutes.  One Rule plus two Triggers can do this, where each Trigger is tied to the rule-truth, then has an action that it delays taking for 10, or 30 minutes; the rule itself has the action of true of doing something after 3 minutes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule can also use rule-truth as a condition.  This feature allows generalized linking of Rules.  One example would be to have a master set of conditions, that several Rules would need.  One Rule has those conditions but no actions.  The other Rules have the first rule-truth as a condition, and have whatever additional conditions they need, and take whatever actions they want.  This can make repetitive rule creation much simpler, or lead to very sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can take an action to cause a selected Rule (or Rules) to be evaluated.  This would allow, for example, a button to cause a Rule to be evaluated, through the use of a Trigger tied to the button.  Or, at a certain time of day, a Rule can be caused to be evaluated.  The reason these things might be useful, is that ordinarily a Rule only takes action when it changes truth state.  By causing a rule evaluation, the actions will be taken as selected for that Rule based on its truth, irrespective of the prior state of the rule-truth for that Rule.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can also cause a selected Rule or Rules to have their Actions for True run irrespective of the Rule's Conditions or Rule.  This allows for triggers to share a Rule's actions, while preserving its Rule (vs. Triggered Rule) nature.  It is also possible to create a Rule that has no Triggers and no Conditions, a Rule that only has Actions.  Such a Rule can be run from any other Trigger or Rule as an action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Warning&amp;lt;/strong&amp;gt;: It is possible with Rule-Trigger integration and Private Boolean to create rules with circular logic, possible indirect circular logic.  These are doomed to fail, sometimes by falling into infinite loops.  DO NOT use these features to create circularity, and be careful about the logic patterns you create by linking rules.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1954</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1954"/>
		<updated>2019-05-10T19:55:53Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
See the full Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; documentation here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1953</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1953"/>
		<updated>2019-05-10T19:55:25Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
See the full Rule Machine® documentation here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=1952</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=1952"/>
		<updated>2019-05-10T19:46:02Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine®&amp;lt;/strong&amp;gt; is a generalized rule engine for Hubitat.  It allows you to predicate actions to be taken by Hubitat by a logical rule based on specified conditions of your system.  Rule Machine also provides Triggers, basic event-causes-action building blocks, and Triggered Rules where an event causes a rule evaluation.  Rules, Triggers, Triggered Rules, and Actions work together to create sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule is a method of specifying certain conditions and their truth relationships in order to cause some action to take place in Hubitat.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, one person posed this case:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Suppose my presence or my wife’s presence is home, there is motion in the bedroom, it’s between 8 PM and 11PM, and the temperature is below 65 — if those conditions are met, turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order for this action to take place in Hubitat, based on those conditions, Rule Machine will evaluate those conditions, and if they are met, turn on the electric blanket.  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows you to specify the conditions, the rule they must meet, and the desired actions to take place. This is called a &amp;lt;strong&amp;gt;Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggers?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A &amp;lt;strong&amp;gt;Trigger&amp;lt;/strong&amp;gt; is a simple mechanism through which some event in your system causes a selected action to take place.  This is a basic building block of automations.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example: if the door opens, turn on the light.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggered Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Triggered Rule adds a rule to be evaluated for a trigger event.  When any of its trigger events fire,  it evaluates the conditions under the rule and then takes actions based on the truth outcome of that evaluation.  This is called a &amp;lt;strong&amp;gt;Triggered Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Actions?&amp;lt;/h2&amp;gt;&lt;br /&gt;
Actions are a set of actions that can be run.  An &amp;lt;strong&amp;gt;Actions&amp;lt;/strong&amp;gt; doesn't do anything unless it is run by another rule.  They can be used by Rules, Triggers, Triggered Rules and Schedule as an action.  One defined set of actions can be used by multiple other rules or triggers without having to be defined for each one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Schedules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;strong&amp;gt;Schedule&amp;lt;/strong&amp;gt; allows a set of actions to be done at a pre-determined time.  Optionally, a second set of actions can be done after some time.  For example, a pool pump could be turned on at 5:00 AM every day, and then turned off 180 minutes later.  Schedules can be defined by day of week, including groups of days (e.g. one schedule for weekdays and a different schedule of weekends).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Conditions and Trigger Events?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows a wide range of possible conditions and events to be selected.  For rules we select conditions.  For triggers we select events.  Conditions and events are closely related because each event results in a condition.  For example, the door opening is an event and results in the condition of the door being open.  Both rules and triggers rely on events to cause their actions.  Rules examine the conditions, and act on truth change.  Triggers act on events.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of week:               Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM status:                 armed away, armed home, disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Time of day:		    between two times, including sunrise / sunset with offsets&lt;br /&gt;
Variable:                   value&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
Note: value means compare current value to a number, to another device with an offset, or to a variable with an offset&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Triggers respond to these additional events:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button:               pressed / held&lt;br /&gt;
Certain Time:         at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:      hitting URL fires&lt;br /&gt;
Local End Point:      hitting URL fires&lt;br /&gt;
Periodic:             Allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical switch:      on / off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For each condition/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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, the conditions for the electric blanket case are,&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present (ANY)&amp;lt;br&amp;gt;bedroom motion is active&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;How is a rule defined?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is a logical expression built up using the conditions and the three logical operators &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;, along with parenthesized sub-rules, each of which is itself a logical expression.  A logical expression defines the logical relationship between the various conditions.  In order to decide if the end action should be taken or not, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the truth of the defined rule.  In the electric blanket case, we have a very simple rule: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;bedroom motion is active AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There can be more complex rules than this.  Suppose we want the same basic rule, but want it to apply if either bedroom motion is active or the bedroom door is closed.  We would add the additional condition of “bedroom door is closed”.  That rule would be this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;(bedroom motion is active OR bedroom door is closed) AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we have used parentheses to group two conditions into a sub-rule: (bedroom motion is active &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; bedroom door is closed).  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows arbitrarily complex rules to be defined, with parentheses used to group conditions into sub-rules.  To use this feature of sub-rules in parentheses, you must first turn on the &amp;quot;Advanced Rule input&amp;quot; option, at the beginning of the Define Rule page.  It allows nested sub-rules to any depth, and it allows any number of conditions.  To help you see exactly the rule you are building, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; displays the partial rule at each step as you define it.  See screen shots in a following post.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; is a fully generalized rule engine.  The logical expression can be described as a sequence of terms, separated by operators, where each term is either a condition or a parenthesized sub-rule, and the operators are &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;.  The evaluation of a rule or sub-rule is strictly left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without further evaluation.  For those familiar with coding, there is no operator precedence as to &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, only for &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; that applies to the term it precedes.  Each rule or sub-rule may have as many terms as desired, each separated by &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;.  Any term may be logically negated by preceding it with the &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Evaluation for Rules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is installed with conditions, rule, and actions. For a rule, whenever something happens in Hubitat that could affect the conditions, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the rule to see if it is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.  If it becomes &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then it will take some selected actions; if it becomes &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, it can take some other selected actions.  In the case of the electric blanket, the rule would be evaluated whenever any of the following things happen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence arrives or leaves&amp;lt;br&amp;gt;the bedroom motion goes active or inactive&amp;lt;br&amp;gt;the bedroom door is opened or closed&amp;lt;br&amp;gt;the time becomes 8:00 PM, or becomes 11:00 PM&amp;lt;br&amp;gt;the bedroom temperature is reported&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Since our rule for this case involves all of these possible events, any of those events might be the one that changes the evaluation outcome from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.  If that happens, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; only acts on the change of rule state from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, except in the case of a trigger event causing rule evaluation.  It may evaluate the rule many times, depending on what sort of events are subscribed to, but only a truth change causes action.  A trigger causing rule evaluation will result in action if the rule is true, without regard to prior rule truth or rule truth changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The evaluation of a rule  is strictly from left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without any further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without any further evaluation.  You must take this into consideration as you define your rule, if you have many terms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Triggered Rule&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a trigger event of a triggered rule occurs the conditions are evaluated under the rule, and then actions are taken based on the true/false outcome.  Only a trigger event will cause rule evaluation, and the action will be performed irrespective of the prior rule truth (unlike a rule, above).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Actions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  These actions can be run in whatever order you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action. &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated.  This supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  The action End Repetition can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a rule proves &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions for True page.  When a Rule proves &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;,  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions on the Actions for False page.  When a Trigger event occurs for a trigger, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions page.  When a trigger event occurs for a Triggered Rule, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will evaluate the rule and do the Actions for True or Actions for False accordingly.  A Schedule does one set of Actions at the scheduled time, and optionally another set of actions some time later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The actions supported are the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Control Switches, Capture and Restore: &lt;br /&gt;
     Turn on these switches&lt;br /&gt;
     Turn off these switches&lt;br /&gt;
     Toggle these switches&lt;br /&gt;
     Flash these switches&lt;br /&gt;
     Set these switches per mode&lt;br /&gt;
     Capture Devices&lt;br /&gt;
     Restore Devices&lt;br /&gt;
Set Dimmers:&lt;br /&gt;
     Set these dimmers&lt;br /&gt;
     Toggle these dimmers&lt;br /&gt;
     Adjust these dimmers&lt;br /&gt;
     Set these dimmers per mode&lt;br /&gt;
     Fade these dimmers over time&lt;br /&gt;
     Start raising dimmers&lt;br /&gt;
     Start lowering dimmers&lt;br /&gt;
     Stop changing dimmers&lt;br /&gt;
Set Color or Color Temperature Bulbs: &lt;br /&gt;
     Set color&lt;br /&gt;
     Set color per mode&lt;br /&gt;
     Set color temperature&lt;br /&gt;
     Set color temperature per mode&lt;br /&gt;
Activate Scenes, Adjust Shades or Fans: &lt;br /&gt;
     Activate scenes&lt;br /&gt;
     Activate scenes per mode&lt;br /&gt;
     Open shades&lt;br /&gt;
     Close shades&lt;br /&gt;
     Set shade position&lt;br /&gt;
     Set fan speed&lt;br /&gt;
     Adjust fans&lt;br /&gt;
Control HSM, Garage Doors, Locks or Valves: &lt;br /&gt;
     Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
     Open garage door&lt;br /&gt;
     Close garage door&lt;br /&gt;
     Lock locks&lt;br /&gt;
     Unlock locks&lt;br /&gt;
     Open valves&lt;br /&gt;
     Close valves&lt;br /&gt;
Control Thermostats or Thermostat Scheduler: &lt;br /&gt;
     Set thermostats&lt;br /&gt;
     Set Thermostat Scheduler&lt;br /&gt;
Send or Speak a Message, Send HTTP Request: &lt;br /&gt;
     Send or Speak a Message&lt;br /&gt;
     Send HTTP Get&lt;br /&gt;
     Send HTTP Post&lt;br /&gt;
Control Music Player Sounds: &lt;br /&gt;
     Control Music Player&lt;br /&gt;
     Sound Tone&lt;br /&gt;
     Control Siren&lt;br /&gt;
Set Mode or Global Variables, Push Buttons: &lt;br /&gt;
     Set Mode&lt;br /&gt;
     Set Global Variable&lt;br /&gt;
     Push a button&lt;br /&gt;
     Push a button per mode&lt;br /&gt;
Set Private Boolean, Run/Stop/Pause Rules: &lt;br /&gt;
     Set Private Booleans True&lt;br /&gt;
     Set Private Booleans False&lt;br /&gt;
     Evaluate Rules&lt;br /&gt;
     Run Rule Actions&lt;br /&gt;
     Stop Rule Actions&lt;br /&gt;
     Pause Rules&lt;br /&gt;
     Resume Rules&lt;br /&gt;
Run Custom Action or Custom Command, Polling: &lt;br /&gt;
     Run Custom Action&lt;br /&gt;
     Run Custom Command&lt;br /&gt;
     Refresh devices&lt;br /&gt;
     Poll devices&lt;br /&gt;
     Start Z-Wave poll on switches&lt;br /&gt;
     Stop Z-Wave poll on switches&lt;br /&gt;
     Start Z-Wave poll on dimmers&lt;br /&gt;
     Stop Z-Wave poll on dimmers&lt;br /&gt;
Delay or Repeat Actions: &lt;br /&gt;
     Delay Actions&lt;br /&gt;
     Delay Actions Per Mode&lt;br /&gt;
     Repeat Actions&lt;br /&gt;
     End Repetition&lt;br /&gt;
Conditional Actions: &lt;br /&gt;
     Simple Conditional Action&lt;br /&gt;
     IF (condition) THEN&lt;br /&gt;
     ELSE-IF (condition) THEN&lt;br /&gt;
     ELSE&lt;br /&gt;
     END-IF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note&amp;lt;/strong&amp;gt;: Multiple phone numbers may be entered for SMS messages, each separated by a comma.  Phone numbers must begin with +1.  Messages may have embedded values from the most recent rule event, as follows:&lt;br /&gt;
  %device%     name of last event device&lt;br /&gt;
  %value%      value of last event&lt;br /&gt;
  %time%       time of last event&lt;br /&gt;
  %date%       date of last event&lt;br /&gt;
  %now%        current time&lt;br /&gt;
  %variable%   value of Global Variable, use its name&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule - Trigger Integration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One of the most powerful features of Rule Machine is the ability of Rules and Triggers to be combined to create sophisticated automations.  Just as with the devices in your system, the Rules you have in Rule Machine have a state, their truth state.  Both Rules and Triggers can use rule-truth as a condition or as an event.  This leads to many possibilities, several of which are very useful:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Trigger can use rule-truth as an event.  When a Rule changes state, a Trigger can take actions.  This integration allows you to have additional actions for each Rule.  If you need more Actions for True, simply create a Trigger tied to rule-truth for that Rule becoming true, and you have additional actions available in the Trigger.  For example, suppose you want one Rule to start a sequence of actions.  Perhaps do one thing after 3 minutes, something else after 10 minutes, and then a final thing after 30 minutes.  One Rule plus two Triggers can do this, where each Trigger is tied to the rule-truth, then has an action that it delays taking for 10, or 30 minutes; the rule itself has the action of true of doing something after 3 minutes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule can also use rule-truth as a condition.  This feature allows generalized linking of Rules.  One example would be to have a master set of conditions, that several Rules would need.  One Rule has those conditions but no actions.  The other Rules have the first rule-truth as a condition, and have whatever additional conditions they need, and take whatever actions they want.  This can make repetitive rule creation much simpler, or lead to very sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can take an action to cause a selected Rule (or Rules) to be evaluated.  This would allow, for example, a button to cause a Rule to be evaluated, through the use of a Trigger tied to the button.  Or, at a certain time of day, a Rule can be caused to be evaluated.  The reason these things might be useful, is that ordinarily a Rule only takes action when it changes truth state.  By causing a rule evaluation, the actions will be taken as selected for that Rule based on its truth, irrespective of the prior state of the rule-truth for that Rule.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can also cause a selected Rule or Rules to have their Actions for True run irrespective of the Rule's Conditions or Rule.  This allows for triggers to share a Rule's actions, while preserving its Rule (vs. Triggered Rule) nature.  It is also possible to create a Rule that has no Triggers and no Conditions, a Rule that only has Actions.  Such a Rule can be run from any other Trigger or Rule as an action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Warning&amp;lt;/strong&amp;gt;: When using any of the Rule - Trigger Integration features, &amp;lt;strong&amp;gt;do not change the name of any Rule, Trigger or Actions referenced by another rule&amp;lt;/strong&amp;gt;.  The name of a rule is the linkage mechanism, and it is not possible to correct for a rule name change in the rules that make reference to it.  Consequently, changing the name of a rule will cause all of the rules that reference that rule to be broken.  Similarly, removing a rule would cause all of the rules that reference that rule to be broken.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Further Warning&amp;lt;/strong&amp;gt;: It is possible with Rule-Trigger integration and Private Boolean to create rules with circular logic, possible indirect circular logic.  These are doomed to fail, sometimes by falling into infinite loops.  DO NOT use these features to create circularity, and be careful about the logic patterns you create by linking rules.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Global Variables&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Global Variables provide a mechanism to store values for use within a rule, or in any rule.  Global Variables are first created in the parent Rule Machine® app.  Global Variables come in four types: number, decimal, string and Boolean.  Numbers are integer values (whole numbers).  Decimals are decimal numbers, e.g. 3.14159.  Strings are any set of characters.  Booleans are true or false. In addition to creating Global Variables in Rule Machine®, their values can be set or changed, and they can be deleted.&lt;br /&gt;
&lt;br /&gt;
Global Variables can be used in rules in a number of ways.  They can be a Condition.  For Conditions that involve comparisons of a device's value, the device value may be compared to the value of a Global Variable.  They can be set by actions.  For numbers and decimals a value can be added to a Global Variable. Global Variables may be used in messages and http requests.  When setting a dimmer or bulb, the value to be set can be a Global Variable.  For using a Global Variable in a message or setting a dimmer or bulb, use %variableName% to represent the Global Variable.  A Delay Actions has an option to use a Global Variable for the number of seconds to delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1951</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1951"/>
		<updated>2019-05-10T19:29:05Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
See the Rule Machine Introduction here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.  &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=1950</id>
		<title>Rule Machine</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule_Machine&amp;diff=1950"/>
		<updated>2019-05-10T19:28:32Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine®&amp;lt;/strong&amp;gt; is a generalized rule engine for Hubitat.  It allows you to predicate actions to be taken by Hubitat by a logical rule based on specified conditions of your system.  Rule Machine also provides Triggers, basic event-causes-action building blocks, and Triggered Rules where an event causes a rule evaluation.  Rules, Triggers, Triggered Rules, and Actions work together to create sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule is a method of specifying certain conditions and their truth relationships in order to cause some action to take place in Hubitat.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, one person posed this case:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Suppose my presence or my wife’s presence is home, there is motion in the bedroom, it’s between 8 PM and 11PM, and the temperature is below 65 — if those conditions are met, turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order for this action to take place in Hubitat, based on those conditions, Rule Machine will evaluate those conditions, and if they are met, turn on the electric blanket.  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows you to specify the conditions, the rule they must meet, and the desired actions to take place. This is called a &amp;lt;strong&amp;gt;Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggers?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A &amp;lt;strong&amp;gt;Trigger&amp;lt;/strong&amp;gt; is a simple mechanism through which some event in your system causes a selected action to take place.  This is a basic building block of automations.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example: if the door opens, turn on the light.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Triggered Rules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Triggered Rule adds a rule to be evaluated for a trigger event.  When any of its trigger events fire,  it evaluates the conditions under the rule and then takes actions based on the truth outcome of that evaluation.  This is called a &amp;lt;strong&amp;gt;Triggered Rule&amp;lt;/strong&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Actions?&amp;lt;/h2&amp;gt;&lt;br /&gt;
Actions are a set of actions that can be run.  An &amp;lt;strong&amp;gt;Actions&amp;lt;/strong&amp;gt; doesn't do anything unless it is run by another rule.  They can be used by Rules, Triggers, Triggered Rules and Schedule as an action.  One defined set of actions can be used by multiple other rules or triggers without having to be defined for each one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Schedules?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;strong&amp;gt;Schedule&amp;lt;/strong&amp;gt; allows a set of actions to be done at a pre-determined time.  Optionally, a second set of actions can be done after some time.  For example, a pool pump could be turned on at 5:00 AM every day, and then turned off 180 minutes later.  Schedules can be defined by day of week, including groups of days (e.g. one schedule for weekdays and a different schedule of weekends).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;What are Conditions and Trigger Events?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows a wide range of possible conditions and events to be selected.  For rules we select conditions.  For triggers we select events.  Conditions and events are closely related because each event results in a condition.  For example, the door opening is an event and results in the condition of the door being open.  Both rules and triggers rely on events to cause their actions.  Rules examine the conditions, and act on truth change.  Triggers act on events.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Events are created by the devices in your system.  Each device creates events appropriate to the type of device.  When you create a rule, Rule Machine listens for any event that might affect the truth of the rule. When a rule receives a selected event, it evaluates the truth of its rule, and then takes selected actions based on that evaluation.  A trigger also listens for events.  When a trigger receives a selected event, it either takes the selected actions unconditionally (if no conditions were specified), or it causes the conditions to be evaluated under the rule and actions taken accordingly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine allows the following conditions/events in a Hubitat system to be tested in a rule or acted upon in a trigger.  Each condition results in a single test. There may be as many conditions as you want in a rule, or as many event triggers as you want in a trigger.  The supported conditions, events and states that can be tested are listed below.  Note: Days of week and Time of day are not available in a trigger.  There are additional events available for triggers; see below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Acceleration:	            active / inactive&lt;br /&gt;
Battery: 		    value&lt;br /&gt;
Contact:		    open / closed&lt;br /&gt;
Days of week:               Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday&lt;br /&gt;
Dimmer level: 	            value&lt;br /&gt;
Door: 			    open, closed, opening, closing, unknown&lt;br /&gt;
Energy meter:	            value&lt;br /&gt;
Garage door: 	            open, closed, opening, closing, unknown&lt;br /&gt;
HSM status:                 armed away, armed home, disarmed&lt;br /&gt;
Humidity:		    value&lt;br /&gt;
Illuminance:	            value&lt;br /&gt;
Lock:			    locked / unlocked&lt;br /&gt;
Mode:			    any of your hub's modes&lt;br /&gt;
Motion:			    active / inactive&lt;br /&gt;
Music player: 	            playing, paused, stopped&lt;br /&gt;
Power meter:	            value&lt;br /&gt;
Power source:               mains / battery&lt;br /&gt;
Presence:		    present / not present or arrives / leaves&lt;br /&gt;
Private Boolean: 	    true / false&lt;br /&gt;
Rule truth: 		    true / false&lt;br /&gt;
Smoke detector:             clear, detected, tested&lt;br /&gt;
Switch:			    on / off&lt;br /&gt;
Temperature:		    value&lt;br /&gt;
Thermostat mode: 	    heat / cool / auto / off / emergency heat&lt;br /&gt;
Thermostat state: 	    heating / cooling / fan only / idle / pending heat / pending cool&lt;br /&gt;
Time of day:		    between two times, including sunrise / sunset with offsets&lt;br /&gt;
Water sensor: 		    dry / wet&lt;br /&gt;
&lt;br /&gt;
Note: value means compare current value to a number or to another device with an offset&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Triggers respond to these additional events:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Button:               pressed / held&lt;br /&gt;
Certain Time:         at a certain time, including sunrise / sunset with offset&lt;br /&gt;
Cloud End Point:      hitting URL fires&lt;br /&gt;
Local End Point:      hitting URL fires&lt;br /&gt;
Periodic:             Allows periodic schedules for minutes, hourly, daily, weekly, monthly or yearly&lt;br /&gt;
Physical switch:      on / off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For each condition/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.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;For example, the conditions for the electric blanket case are,&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present (ANY)&amp;lt;br&amp;gt;bedroom motion is active&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;How is a rule defined?&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is a logical expression built up using the conditions and the three logical operators &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;, along with parenthesized sub-rules, each of which is itself a logical expression.  A logical expression defines the logical relationship between the various conditions.  In order to decide if the end action should be taken or not, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the truth of the defined rule.  In the electric blanket case, we have a very simple rule: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;bedroom motion is active AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;There can be more complex rules than this.  Suppose we want the same basic rule, but want it to apply if either bedroom motion is active or the bedroom door is closed.  We would add the additional condition of “bedroom door is closed”.  That rule would be this:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence is present AND&amp;lt;br&amp;gt;(bedroom motion is active OR bedroom door is closed) AND&amp;lt;br&amp;gt;time of day is between 8:00 PM and 11:00 PM AND&amp;lt;br&amp;gt;bedroom temperature is &amp;amp;lt;  65&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In this example, we have used parentheses to group two conditions into a sub-rule: (bedroom motion is active &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; bedroom door is closed).  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; allows arbitrarily complex rules to be defined, with parentheses used to group conditions into sub-rules.  To use this feature of sub-rules in parentheses, you must first turn on the &amp;quot;Advanced Rule input&amp;quot; option, at the beginning of the Define Rule page.  It allows nested sub-rules to any depth, and it allows any number of conditions.  To help you see exactly the rule you are building, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; displays the partial rule at each step as you define it.  See screen shots in a following post.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; is a fully generalized rule engine.  The logical expression can be described as a sequence of terms, separated by operators, where each term is either a condition or a parenthesized sub-rule, and the operators are &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt;.  The evaluation of a rule or sub-rule is strictly left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the sub-rule or the rule itself is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without further evaluation.  For those familiar with coding, there is no operator precedence as to &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;, only for &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; that applies to the term it precedes.  Each rule or sub-rule may have as many terms as desired, each separated by &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt;.  Any term may be logically negated by preceding it with the &amp;lt;code&amp;gt;NOT&amp;lt;/code&amp;gt; operator.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule Evaluation for Rules&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A rule is installed with conditions, rule, and actions. For a rule, whenever something happens in Hubitat that could affect the conditions, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; evaluates the rule to see if it is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.  If it becomes &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, then it will take some selected actions; if it becomes &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, it can take some other selected actions.  In the case of the electric blanket, the rule would be evaluated whenever any of the following things happen:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;my presence or my wife’s presence arrives or leaves&amp;lt;br&amp;gt;the bedroom motion goes active or inactive&amp;lt;br&amp;gt;the bedroom door is opened or closed&amp;lt;br&amp;gt;the time becomes 8:00 PM, or becomes 11:00 PM&amp;lt;br&amp;gt;the bedroom temperature is reported&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Since our rule for this case involves all of these possible events, any of those events might be the one that changes the evaluation outcome from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.  If that happens, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will turn on the electric blanket.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; only acts on the change of rule state from &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, except in the case of a trigger event causing rule evaluation.  It may evaluate the rule many times, depending on what sort of events are subscribed to, but only a truth change causes action.  A trigger causing rule evaluation will result in action if the rule is true, without regard to prior rule truth or rule truth changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The evaluation of a rule  is strictly from left to right.  If at any point in the evaluation, the truth value preceding an &amp;lt;code&amp;gt;AND&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; without any further evaluation.  Similarly, if the truth value preceding an &amp;lt;code&amp;gt;OR&amp;lt;/code&amp;gt; operator is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the rule is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; without any further evaluation.  You must take this into consideration as you define your rule, if you have many terms.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Triggered Rule&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a trigger event of a triggered rule occurs the conditions are evaluated under the rule, and then actions are taken based on the true/false outcome.  Only a trigger event will cause rule evaluation, and the action will be performed irrespective of the prior rule truth (unlike a rule, above).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Actions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  These actions can be run in whatever order you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action. &amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; The conditions in conditional actions do not cause Rule evaluation.  The conditions are evaluated at the time the action runs, and test the value of the condition at that moment.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated.  This supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  The action End Repetition can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When a rule proves &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions for True page.  When a Rule proves &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, after previously &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;,  &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions on the Actions for False page.  When a Trigger event occurs for a trigger, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will do the actions selected on the Actions page.  When a trigger event occurs for a Triggered Rule, &amp;lt;strong&amp;gt;Rule Machine&amp;lt;/strong&amp;gt; will evaluate the rule and do the Actions for True or Actions for False accordingly.  A Schedule does one set of Actions at the scheduled time, and optionally another set of actions some time later.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The actions supported are the following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Control Switches, Capture and Restore: &lt;br /&gt;
     Turn on these switches&lt;br /&gt;
     Turn off these switches&lt;br /&gt;
     Toggle these switches&lt;br /&gt;
     Flash these switches&lt;br /&gt;
     Set these switches per mode&lt;br /&gt;
     Capture Devices&lt;br /&gt;
     Restore Devices&lt;br /&gt;
Set Dimmers:&lt;br /&gt;
     Set these dimmers&lt;br /&gt;
     Toggle these dimmers&lt;br /&gt;
     Adjust these dimmers&lt;br /&gt;
     Set these dimmers per mode&lt;br /&gt;
     Fade these dimmers over time&lt;br /&gt;
     Start raising dimmers&lt;br /&gt;
     Start lowering dimmers&lt;br /&gt;
     Stop changing dimmers&lt;br /&gt;
Set Color or Color Temperature Bulbs: &lt;br /&gt;
     Set color&lt;br /&gt;
     Set color per mode&lt;br /&gt;
     Set color temperature&lt;br /&gt;
     Set color temperature per mode&lt;br /&gt;
Activate Scenes, Adjust Shades or Fans: &lt;br /&gt;
     Activate scenes&lt;br /&gt;
     Activate scenes per mode&lt;br /&gt;
     Open shades&lt;br /&gt;
     Close shades&lt;br /&gt;
     Set shade position&lt;br /&gt;
     Set fan speed&lt;br /&gt;
     Adjust fans&lt;br /&gt;
Control HSM, Garage Doors, Locks or Valves: &lt;br /&gt;
     Arm/Disarm Hubitat® Safety Monitor&lt;br /&gt;
     Open garage door&lt;br /&gt;
     Close garage door&lt;br /&gt;
     Lock locks&lt;br /&gt;
     Unlock locks&lt;br /&gt;
     Open valves&lt;br /&gt;
     Close valves&lt;br /&gt;
Control Thermostats or Thermostat Scheduler: &lt;br /&gt;
     Set thermostats&lt;br /&gt;
     Set Thermostat Scheduler&lt;br /&gt;
Send or Speak a Message, Send HTTP Request: &lt;br /&gt;
     Send or Speak a Message&lt;br /&gt;
     Send HTTP Get&lt;br /&gt;
     Send HTTP Post&lt;br /&gt;
Control Music Player Sounds: &lt;br /&gt;
     Control Music Player&lt;br /&gt;
     Sound Tone&lt;br /&gt;
     Control Siren&lt;br /&gt;
Set Mode or Global Variables, Push Buttons: &lt;br /&gt;
     Set Mode&lt;br /&gt;
     Set Global Variable&lt;br /&gt;
     Push a button&lt;br /&gt;
     Push a button per mode&lt;br /&gt;
Set Private Boolean, Run/Stop/Pause Rules: &lt;br /&gt;
     Set Private Booleans True&lt;br /&gt;
     Set Private Booleans False&lt;br /&gt;
     Evaluate Rules&lt;br /&gt;
     Run Rule Actions&lt;br /&gt;
     Stop Rule Actions&lt;br /&gt;
     Pause Rules&lt;br /&gt;
     Resume Rules&lt;br /&gt;
Run Custom Action or Custom Command, Polling: &lt;br /&gt;
     Run Custom Action&lt;br /&gt;
     Run Custom Command&lt;br /&gt;
     Refresh devices&lt;br /&gt;
     Poll devices&lt;br /&gt;
     Start Z-Wave poll on switches&lt;br /&gt;
     Stop Z-Wave poll on switches&lt;br /&gt;
     Start Z-Wave poll on dimmers&lt;br /&gt;
     Stop Z-Wave poll on dimmers&lt;br /&gt;
Delay or Repeat Actions: &lt;br /&gt;
     Delay Actions&lt;br /&gt;
     Delay Actions Per Mode&lt;br /&gt;
     Repeat Actions&lt;br /&gt;
     End Repetition&lt;br /&gt;
Conditional Actions: &lt;br /&gt;
     Simple Conditional Action&lt;br /&gt;
     IF (condition) THEN&lt;br /&gt;
     ELSE-IF (condition) THEN&lt;br /&gt;
     ELSE&lt;br /&gt;
     END-IF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Note&amp;lt;/strong&amp;gt;: Multiple phone numbers may be entered for SMS messages, each separated by a comma.  Phone numbers must begin with +1.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Rule - Trigger Integration&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;One of the most powerful features of Rule Machine is the ability of Rules and Triggers to be combined to create sophisticated automations.  Just as with the devices in your system, the Rules you have in Rule Machine have a state, their truth state.  Both Rules and Triggers can use rule-truth as a condition or as an event.  This leads to many possibilities, several of which are very useful:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Trigger can use rule-truth as an event.  When a Rule changes state, a Trigger can take actions.  This integration allows you to have additional actions for each Rule.  If you need more Actions for True, simply create a Trigger tied to rule-truth for that Rule becoming true, and you have additional actions available in the Trigger.  For example, suppose you want one Rule to start a sequence of actions.  Perhaps do one thing after 3 minutes, something else after 10 minutes, and then a final thing after 30 minutes.  One Rule plus two Triggers can do this, where each Trigger is tied to the rule-truth, then has an action that it delays taking for 10, or 30 minutes; the rule itself has the action of true of doing something after 3 minutes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A Rule can also use rule-truth as a condition.  This feature allows generalized linking of Rules.  One example would be to have a master set of conditions, that several Rules would need.  One Rule has those conditions but no actions.  The other Rules have the first rule-truth as a condition, and have whatever additional conditions they need, and take whatever actions they want.  This can make repetitive rule creation much simpler, or lead to very sophisticated automations.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can take an action to cause a selected Rule (or Rules) to be evaluated.  This would allow, for example, a button to cause a Rule to be evaluated, through the use of a Trigger tied to the button.  Or, at a certain time of day, a Rule can be caused to be evaluated.  The reason these things might be useful, is that ordinarily a Rule only takes action when it changes truth state.  By causing a rule evaluation, the actions will be taken as selected for that Rule based on its truth, irrespective of the prior state of the rule-truth for that Rule.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Both Triggers and Rules can also cause a selected Rule or Rules to have their Actions for True run irrespective of the Rule's Conditions or Rule.  This allows for triggers to share a Rule's actions, while preserving its Rule (vs. Triggered Rule) nature.  It is also possible to create a Rule that has no Triggers and no Conditions, a Rule that only has Actions.  Such a Rule can be run from any other Trigger or Rule as an action.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Warning&amp;lt;/strong&amp;gt;: When using any of the Rule - Trigger Integration features, &amp;lt;strong&amp;gt;do not change the name of any Rule, Trigger or Actions referenced by another rule&amp;lt;/strong&amp;gt;.  The name of a rule is the linkage mechanism, and it is not possible to correct for a rule name change in the rules that make reference to it.  Consequently, changing the name of a rule will cause all of the rules that reference that rule to be broken.  Similarly, removing a rule would cause all of the rules that reference that rule to be broken.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Further Warning&amp;lt;/strong&amp;gt;: It is possible with Rule-Trigger integration and Private Boolean to create rules with circular logic, possible indirect circular logic.  These are doomed to fail, sometimes by falling into infinite loops.  DO NOT use these features to create circularity, and be careful about the logic patterns you create by linking rules.  &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Custom Commands&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The Custom Commands section of Rule Machine allows you to discover commands available for virtually any device, including custom device types and otherwise not supported devices.  Once you've found a command you want to use, you can set parameters for it, and save it as a Custom Command.  These Custom Commands can be used in Actions for any rule (Actions for True, Actions for False, Actions).  Once you have saved one or more Custom Commands, the action &amp;quot;Run custom commands&amp;quot; becomes available in Actions, as the very last option.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These are some notable examples of published devices with custom capabilities:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two that are useful.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thing Shields, every ThingShield has nothing but custom commands, you can now run these commands directly from Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Thermostats often have commands that can be useful but are otherwise not exposed in Rule Machine.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Multi channel relays; these can be controlled directly instead of with virtual switches.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Any device that formerly required a custom app to support could be a candidate to migrate and control using Rule Machine.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Here are a few examples in use with Rule Machine:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;softwhite() and deepfade() on an Fibaro RGBW controller that uses &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@twack&amp;lt;/span&amp;gt; device type&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;playTrackAndRestore('https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3',6,30) on a Samsung Speaker&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;fanOff() on a custom AEON dual switch device by &amp;lt;span class=&amp;quot;mention&amp;quot;&amp;gt;@Mike_Maxwell&amp;lt;/span&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;With custom commands, you can explore any device you have to see the commands that it offers. There are two steps required to use those commands in your rules.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create, test and save your custom command with &amp;quot;Tap to create Custom Commands&amp;quot; on the Rule Machine main page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Incorporate the saved custom command into your rules with &amp;quot;Run custom commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;1. Create, test and save your custom command&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Rule Machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Under Expert Features &amp;quot;Tap to create Custom Commands&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a capability for devices to test for available commands (if unsure, try Actuator)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select a device of that capability to test for commands&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Select New custom command to see the available commands, then select the command you want&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Once selected, the command will be tested on the selected device and the results of the command execution shown&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add any required parameters to the command&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After the command is executing against the device as expected, select Save command now, then Done, then Done again to return to the Custom Commands page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The saved custom command will now be available in your new and existing rules&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;2. Select the custom command to run in your rule and the devices to run it on&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new rule or edit an existing one&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In the Actions section (at the very bottom), select Run custom command, then select the custom command (saved above) and the devices to run it on&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Be sure that each device selected supports the selected command; any errors will be trapped and shown in the logs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;3. Manage custom commands&amp;lt;/strong&amp;gt;&amp;lt;br&amp;gt;One or more custom commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then Done. You can also test saved custom commands against other devices you might select.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Tips&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-select your test device or the &amp;quot;saved command to test&amp;quot; before leaving the custom commands page, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;available device commands&amp;quot; after saving the new command, otherwise the command will execute the next time you open the page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Un-Select &amp;quot;parameter type&amp;quot; for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The success or failure of any parameters can't be determined by expert, use the logging in the IDE if you're having issues getting a command to function.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If your wizBang device isn't in the list, add capability actuator to it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;Cautions&amp;lt;/strong&amp;gt;:&amp;lt;br&amp;gt;Using custom commands exposes commands on device types that aren't published or supported by Hubitat. When you expose these commands and play with them, you are doing so at your own risk. No one will have any sympathy when you successfully execute &amp;lt;code&amp;gt;wipeDisk()&amp;lt;/code&amp;gt; on your new Samsung appliance and have bricked it. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Rule Machine API&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible for other apps to use Rules, Triggers, Triggered Rules, and Actions defined in Rule Machine.  This is very similar, and uses the same mechanism, as actions in Rule Machine that affect other rules.  It is also possible to use Rules, Triggers, Triggered Rules, and Actions from an HTTP request to an endpoint.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from other apps&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, import the RM helper class into your app:&lt;br /&gt;
&lt;br /&gt;
`import hubitat.helper.RMUtils`&lt;br /&gt;
&lt;br /&gt;
'''The List of Rules'''&lt;br /&gt;
&lt;br /&gt;
Rule Machine maintains a list of available Rules, Triggers, Triggered Rules, and Actions.  This list can be obtained with this method call:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
&lt;br /&gt;
The resulting list, in this example in the variable &amp;quot;rules&amp;quot;, can be used as an input to an &amp;quot;enum&amp;quot;, as the options.&lt;br /&gt;
&lt;br /&gt;
'''Supported Actions'''&lt;br /&gt;
&lt;br /&gt;
It is possible to set the Private Boolean, evaluate a rule, run the rule actions, or stop running rule actions (either delayed or repeating).  This is accomplished by sending an action request to Rule Machine.  These will each take this form:&lt;br /&gt;
&lt;br /&gt;
     def RMUtils.sendAction(rules, action, appLabel)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Set Private Boolean True:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanTrue&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Set Private Boolean False:     &lt;br /&gt;
     action     &amp;quot;setRuleBooleanFalse&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Evaluate Rule:&lt;br /&gt;
     action     &amp;quot;runRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Run Rule Actions:&lt;br /&gt;
     action     &amp;quot;runRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Stop Rule Actions:&lt;br /&gt;
     action     &amp;quot;stopRuleAct&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Pause Rule:&lt;br /&gt;
     action     &amp;quot;pauseRule&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 Resume Rule:&lt;br /&gt;
     action     &amp;quot;resumeRule&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In each case above, a list of rules selected by input is sent.  The rule options come from the variable to which they were input as described above, in the options section of the input..&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;appLabel&amp;quot; parameter is passed and will appear in the log entry that the rule makes when it performs the action commanded.  Typically, simply pass `app.label`, for the name of the app that is causing the action.  This has no other function than logging.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
     def rules = RMUtils.getRuleList()&lt;br /&gt;
     input &amp;quot;theseRules&amp;quot;, &amp;quot;enum&amp;quot;, title: &amp;quot;Select which rules to stop&amp;quot;, options: rules&lt;br /&gt;
     RMUtils.sendAction(theseRules, &amp;quot;stopRuleAct&amp;quot;, app.label)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Using Rule Machine from HTTP requests&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also possible to cause Rule Machine to perform these same actions from an HTTP request.  To do this one would create a Trigger or a Triggered Rule with either a Local End Point or Cloud End Point.  The endpoint URL given by Rule Machine has this form:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
To run rule actions this URL must be modified to include the list of rules and the action.  The modification takes this form:&lt;br /&gt;
&lt;br /&gt;
`/action=rule1&amp;amp;rule2&amp;amp;rule3`&lt;br /&gt;
&lt;br /&gt;
Where action is the action from the list above and `rule1&amp;amp;rule2&amp;amp;rule3` are the appIds of the rules to run separated by ampersands. &lt;br /&gt;
&lt;br /&gt;
This parameter is inserted in the endpoint URL just before the ? that precedes the access_token, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/stopRuleAct=943&amp;amp;956&amp;amp;10217?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This example would do the same thing as the code example above, where 943&amp;amp;956&amp;amp;10217 are the appIds that were selected by consequence of the input for theseRules, and stopRuleAct is the action to perform.&lt;br /&gt;
&lt;br /&gt;
The appIds are the values selected by the input described above, for example `theseRules`.  The appIds can also be found for a rule by opening the rule and observing its appId in its url, like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/installedapp/configure/10249/mainPage`&lt;br /&gt;
&lt;br /&gt;
The appId for that rule is 10249.&lt;br /&gt;
&lt;br /&gt;
'''Get Rule List'''&lt;br /&gt;
&lt;br /&gt;
To get the list of rules as is returned from `getRuleList()` use this insert for the URL:&lt;br /&gt;
&lt;br /&gt;
`/getRuleList`&lt;br /&gt;
&lt;br /&gt;
for full URL like this:&lt;br /&gt;
&lt;br /&gt;
`http://192.168.0.36/apps/api/10249/trigger/getRuleList?access_token=ecd95469-bbcd-4889-a694-9b05ef80f4db`&lt;br /&gt;
&lt;br /&gt;
This returns a JSON object with appId and rule name pairs.  The other requests return a JSON object with a human readable description of what was done.&lt;br /&gt;
&lt;br /&gt;
'''Set Global Variable'''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be set by an endpoint trigger.  The format for the parameter is this:&lt;br /&gt;
&lt;br /&gt;
`/setGlobalVariable=varName:varString`&lt;br /&gt;
&lt;br /&gt;
The `varString` portion is assumed to be URL encoded, and is URL decoded before being stored into the `varName` global variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------&lt;br /&gt;
'''Note''':  Rule Machine actions Stop Rule Actions, Pause Rule and Resume Rule only work for Rule 2.5 or later.  Rule Machine action Set Global Variable only works for Rule 3.0 or later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;Dedication&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Rule Machine is dedicated to Alan Turing.  He gave us the concept of an abstract machine that could compute, and from that we built small implementations of his vision. Today, we all use them every day of our lives.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;More Information&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [this post](https://community.hubitat.com/t/what-is-the-best-way-to-know-what-hubitat-can-and-cant-do/2143/23) for a mini-tutorial on Rule-Trigger Integration and Private Boolean.&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1949</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1949"/>
		<updated>2019-05-10T19:21:56Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt; actions.&lt;br /&gt;
&lt;br /&gt;
See the Rule Machine Introduction here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1948</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1948"/>
		<updated>2019-05-10T19:21:09Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine actions.&lt;br /&gt;
&lt;br /&gt;
See the Rule Machine Introduction here:  &lt;br /&gt;
*[[Rule Machine]]&amp;lt;sup&amp;gt;®&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1947</id>
		<title>Rule-3.0</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Rule-3.0&amp;diff=1947"/>
		<updated>2019-05-10T19:20:22Z</updated>

		<summary type="html">&lt;p&gt;Bravenel: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;New Version of Rule Machine: Rule 3.0&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We are introducing a new version of Rule Machine, with Rule 3.0.  Rule 3.0 is a new child app for the parent Rule Machine.  Existing child app instances that are installed, Rule and Rule 2.5, will continue to function as before.  New rules that are created will be Rule 3.0.  This release marks the end of development for Rule 2.5, just as its release marked the end of development for Rule.  There is no reason to recreate existing old rules in Rule 3.0, unless you want to.  The author still has a majority of his rules running the original Rule child.&lt;br /&gt;
&lt;br /&gt;
In recent releases of Rule 2.5, a major effort was made to redo the UI for defining Conditions, Trigger Events, and Rules.  In each case, the UI was streamlined and flattened to a single page.  The ability to easily edit Conditions, and redo Rules was introduced.  Rule 3.0 brings this same UI overhaul to Action definition.  The UI is streamlined and flattened, and actions can be easily edited.  But, the changes don't stop there:  Rule 3.0 introduces considerable new power and flexibility to Rule Machine actions.&lt;br /&gt;
&lt;br /&gt;
See the Rule Machine Introduction here:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;New Features&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 represents a complete overhaul of action definition.  There are a number of new concepts and capabilities provided.&lt;br /&gt;
&lt;br /&gt;
'''Actions as ordered script'''&lt;br /&gt;
&lt;br /&gt;
As you define actions you are creating a script of actions to perform when the rule runs.  Instead, for example, of only being able to have a single action for turning on switches in Rule 2.5, you can now have as many actions for each action type as you want.  And these actions can be run in whatever order you want.  No longer is there a predefined order of execution for RM actions -- it's up to you to order the actions however you want.  You can insert a new action anywhere in the list of actions, or at the end of the list.&lt;br /&gt;
&lt;br /&gt;
'''Actions can be edited'''&lt;br /&gt;
&lt;br /&gt;
The UI provides the facility to edit or delete any action you have defined, giving you complete control over your list of actions.&lt;br /&gt;
&lt;br /&gt;
Screen shot:  [https://community.hubitat.com/uploads/default/original/3X/0/1/0168c7cd17a0877a0756834dc24d1476a9231b5c.png]&lt;br /&gt;
&lt;br /&gt;
'''Delay per action and Delay (Pause) all actions'''&lt;br /&gt;
&lt;br /&gt;
There are three types of delays included in Rule 3.0:  &lt;br /&gt;
1. Each individual action can have its own delay, which for Rules may include a cancel-on-truth-change option. &lt;br /&gt;
2. All actions can be delayed, effectively pausing the action execution for some amount of time.&lt;br /&gt;
3. All actions can be delayed for a period of time that depends on the current mode (Delay Actions Per Mode).&lt;br /&gt;
&lt;br /&gt;
These are further described below.&lt;br /&gt;
&lt;br /&gt;
''Delay per action''&lt;br /&gt;
&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
''Delay all actions''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Conditional Actions'''&lt;br /&gt;
&lt;br /&gt;
Each action can have a condition tested to control whether or not it is executed.  These conditions offer the same choices as those used to define rules, but are independent of the Conditions of a Rule.  When such a conditional action is edited, the condition may be edited as well.  This simple condition applies to a single action.&lt;br /&gt;
&lt;br /&gt;
'''IF-THEN-ELSE'''&lt;br /&gt;
&lt;br /&gt;
You can introduce conditional execution of actions using:&lt;br /&gt;
 IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE-IF (condition) THEN &lt;br /&gt;
      some actions...&lt;br /&gt;
 ELSE &lt;br /&gt;
      some actions...&lt;br /&gt;
 ENDIF  &lt;br /&gt;
&lt;br /&gt;
IF-THEN and ELSE-IF both accept a condition as described above.  IF-THEN-ELSE may not be nested.  If the condition on the IF part is true, then those actions following the IF and before any ELSE-IF or ELSE statements are run.  If the condition is false, then those actions are skipped, and the ELSE part or ELSE-IF part are run.  In the case of ELSE-IF, its condition is tested, and the following actions run or not depending.  There can be as many ELSE-IF sections as you want, and both ELSE-IF and ELSE are optional.  ENDIF is also optional, and if omitted means all remaining actions are part of the preceding IF-THEN, ELSE-IF or ELSE. &lt;br /&gt;
&lt;br /&gt;
'''New Repeat Actions'''&lt;br /&gt;
&lt;br /&gt;
Portions, or all of, the script of actions can be repeated, similar to Rule 2.5's Repeat These Actions.  As with Rule 2.5, this supports stopping repetition upon rule truth change for a Rule, and allows for a selected number of iterations.  When a Repeat Actions is introduced to the script, following actions will be repeated.  A new feature, End Repetition, can be placed in the script. When this is done, only those actions between Repeat Actions and End Repetition are repeated.&lt;br /&gt;
&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''While loop - repeat while the condition is true:''&lt;br /&gt;
 IF (condition) Repeat Actions&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''For loop (repeat n times):''&lt;br /&gt;
 Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Conditional For loop (repeat n times if condition is true):''&lt;br /&gt;
 IF (condition) Repeat Actions n times&lt;br /&gt;
      some actions...&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
''Repeat-Until loop:''&lt;br /&gt;
 Repeat Actions&lt;br /&gt;
      some actions&lt;br /&gt;
     IF (condition) Stop **This Rule**&lt;br /&gt;
 End Repetition&lt;br /&gt;
&lt;br /&gt;
Repeat Actions may not be nested.  End Repetition is optional, and if omitted, all actions after Repeat Actions are repeated. Note the &amp;quot;End Repetition&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
'''New Custom Actions'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
'''Global Variable Improvements'''&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
''Global Variables Can Be Used for Level/Color''&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;Number&amp;quot; global variable is allowed, and it is not range checked&lt;br /&gt;
&lt;br /&gt;
''Global Variables can be set by endpoint''&lt;br /&gt;
&lt;br /&gt;
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).  &lt;br /&gt;
&lt;br /&gt;
''Global Variables can be used with parameters for Custom Actions''&lt;br /&gt;
&lt;br /&gt;
A Global Variable can be used with parameters by using %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
''Global Variables in messages''&lt;br /&gt;
&lt;br /&gt;
Unlike Rule 2.5, in Rule 3.0 to include the value of a global variable in a message string (or HTTP request url or body), use %global-variable-name%.&lt;br /&gt;
&lt;br /&gt;
'''Run rule from UI'''&lt;br /&gt;
&lt;br /&gt;
In prior version of Rule Machine, upon hitting Done on the main page of a Rule, that Rule would be evaluated.  This behavior was problematic, as unintended actions would sometimes take place upon that event.  In Rule 3.0 this is no longer the case.  Instead, each Rule, Trigger, Triggered Rule and Actions has a button on the main page to run the rule.  In the case of a Rule or a Triggered Rule the actions run as a consequence of this are determined by the truth of the rule, which is displayed at the bottom of the rule definition and in the app name at the top of the page.  In the case of Trigger and Actions, the actions are simply run.  In each case, hitting Done on the main page does not cause any action, although it does establish event subscriptions and schedules for the rule.&lt;br /&gt;
&lt;br /&gt;
'''Other new features'''&lt;br /&gt;
&lt;br /&gt;
''New HTTP action''&lt;br /&gt;
&lt;br /&gt;
A new HTTP request action is now available:  send an HTTP Post.  This accepts URL and a body, which may be JSON, XML, or form encoded.&lt;br /&gt;
&lt;br /&gt;
''New Siren Actions''&lt;br /&gt;
&lt;br /&gt;
Rule 3.0 now offers actions to control a siren device, with commands siren, strobe, both and off.&lt;br /&gt;
&lt;br /&gt;
''New Dimmer Actions''&lt;br /&gt;
&lt;br /&gt;
Start raising, start lowering, and stop changing dimmer levels added.&lt;br /&gt;
&lt;br /&gt;
''New Color Action''&lt;br /&gt;
&lt;br /&gt;
Color per mode is now available.&lt;br /&gt;
&lt;br /&gt;
''Set Color Temperature''&lt;br /&gt;
&lt;br /&gt;
Set Color Temperature now has option to set the level in same action.&lt;br /&gt;
&lt;br /&gt;
''Shade Actions''&lt;br /&gt;
&lt;br /&gt;
Shade actions now use the Window Shade capability.  Available action are open, close and set position.&lt;br /&gt;
&lt;br /&gt;
''Fan Speed and Fan Actions''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Fan Speed&amp;quot; is now supported for Conditions and Trigger Events.  This uses the Fan Control capability used for fans.  A new action, Set Fan Speed, is available.  The Adjust Fan action is changed from controller of fan-as-dimmer, to using Fan Speed commands: low, medium-low, medium, medium-high, high, on, off and auto.&lt;br /&gt;
&lt;br /&gt;
''Power Source Capability''&lt;br /&gt;
&lt;br /&gt;
Capability &amp;quot;Power Source&amp;quot; is now fully supported for Conditions and Trigger Events.  This supports two states:  mains and battery.&lt;br /&gt;
&lt;br /&gt;
'''Screen Shots'''&lt;br /&gt;
&lt;br /&gt;
Editing Set Global Variable: [https://community.hubitat.com/uploads/default/optimized/3X/e/a/eaf220111902248dfd28534ce5234e58f6537e80_2_1380x882.png]&lt;br /&gt;
&lt;br /&gt;
IF-THEN Example:  [https://community.hubitat.com/uploads/default/optimized/3X/2/d/2d75ae5aee767eefd653aec85df169ce65ef80cb_2_1380x986.png]&lt;/div&gt;</summary>
		<author><name>Bravenel</name></author>
		
	</entry>
</feed>