<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Rules introduction]]></title><description><![CDATA[<p dir="auto"><code>Rules</code> are used to trigger set of <code>Operations</code> when a condition met the specification. MyController supports multiple conditions.</p>
<h5>Conditions type:</h5>
<ul>
<li>Compare</li>
<li>State</li>
<li>Script</li>
<li>String</li>
<li>Threshold</li>
<li>Threshold range</li>
</ul>
<p dir="auto">To add new <code>Rule</code>, Navigate to <code>Resources</code> &gt;&gt;  <code>Rules</code> &gt;&gt; <code>Add rule</code>.</p>
<p dir="auto"><img src="/uploads/files/1461341571011-rules-conditions.png" alt="0_1461341569745_rules-conditions.png" class=" img-fluid img-markdown" /></p>
<h3>Condition - <code>Compare</code></h3>
<p dir="auto">We can compare <code>Sensor variable1</code> with <code>Sensor variable2</code>.<br />
<em>Example:</em> Hall-temperature &gt;= 20% outside-temperature</p>
<p dir="auto"><img src="/uploads/files/1461342035411-rules-compare.png" alt="0_1461342034928_rules-compare.png" class=" img-fluid img-markdown" /></p>
<h3>Condition - <code>State</code></h3>
<p dir="auto">With this condition we con monitor state of <code>Binary</code> type sensor variables, <code>Node</code>, <code>Gateway</code> and <code>Resources group</code>.<br />
<em>Example for <code>Sensor variable</code></em></p>
<p dir="auto"><img src="/uploads/files/1461342238887-rules-state1.png" alt="0_1461342238160_rules-state1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Example for <code>Node</code></em></p>
<p dir="auto"><img src="/uploads/files/1461342300380-rules-state2.png" alt="0_1461342300016_rules-state2.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Example for <code>Gateway</code></em></p>
<p dir="auto"><img src="/uploads/files/1461342418818-rules-state3.png" alt="0_1461342418518_rules-state3.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Example for <code>Resources group</code></em></p>
<p dir="auto"><img src="/uploads/files/1461342479983-rules-state4.png" alt="0_1461342479583_rules-state4.png" class=" img-fluid img-markdown" /></p>
<h3>Condition - <code>Threshold</code></h3>
<p dir="auto">With this condition we can monitor <code>Sensor variable</code> values with a static value or with another <code>Sensor variable</code> value</p>
<p dir="auto"><em>Example with static value:</em></p>
<p dir="auto"><img src="/uploads/files/1461342745061-rules-threshold-1.png" alt="0_1461342743069_rules-threshold-1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Example with another Sensor variable:</em></p>
<p dir="auto"><img src="/uploads/files/1461342837501-rules-threshold-2.png" alt="0_1461342836405_rules-threshold-2.png" class=" img-fluid img-markdown" /></p>
<h3>Condition - <code>Threshold range</code></h3>
<p dir="auto">With this condition we can monitor <code>Sensor variable</code> value <em>Is in range?</em> or <em>Is in outside range?</em></p>
<ul>
<li><code>Threshold value low</code> (1) - low value of threshold</li>
<li><code>Threshold value high</code> (2) - high value of threshold</li>
<li><code>Include threshold low</code> - When we check this field included (1) in boundary</li>
<li><code>Include threshold high</code> - When we check this field included (2) in boundary</li>
<li><code>In range</code> - When you check this box will be act as <code>In range</code> check, otherwise <code>Out side range</code> check</li>
</ul>
<p dir="auto"><em>Example:</em> X inside [10,56], X outside [45, 200]</p>
<p dir="auto"><em>Example for <code>In range</code>:</em></p>
<p dir="auto"><img src="/uploads/files/1461343409808-rules-thresholdrange-1.png" alt="0_1461343409580_rules-thresholdrange-1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Example for <code>Out side range</code>:</em></p>
<p dir="auto"><img src="/uploads/files/1461343454462-rules-thresholdrange-2.png" alt="0_1461343454204_rules-thresholdrange-2.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.mycontroller.org/topic/24/rules-introduction</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 13:02:14 GMT</lastBuildDate><atom:link href="http://forum.mycontroller.org/topic/24.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Apr 2016 16:12:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rules introduction on Mon, 07 Nov 2016 21:33:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jkandasa" aria-label="Profile: jkandasa">@<bdi>jkandasa</bdi></a> Thanks for the hint. I'v created following script and it works <img src="http://forum.mycontroller.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f604.png?v=8fd4e6bd354" class="not-responsive emoji emoji-android emoji--smile" style="height:23px;width:auto;vertical-align:middle" title=":smile:" alt="😄" /></p>
<p dir="auto"><em>var dimCree = mcApi.uidTag().getByUid("dimm_cree_uid");<br />
var dimCob = mcApi.uidTag().getByUid("dimm_cob_uid");<br />
( dimCree.sensorVariable.value == 0  &amp;&amp; dimCob.sensorVariable.value == 0  )</em></p>
<p dir="auto">Thanks for all the effort,<br />
Marek</p>
]]></description><link>http://forum.mycontroller.org/post/299</link><guid isPermaLink="true">http://forum.mycontroller.org/post/299</guid><dc:creator><![CDATA[Marek]]></dc:creator><pubDate>Mon, 07 Nov 2016 21:33:39 GMT</pubDate></item><item><title><![CDATA[Reply to Rules introduction on Tue, 08 Nov 2016 01:13:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marek" aria-label="Profile: Marek">@<bdi>Marek</bdi></a> from UI you cannot compare two sensors. However you can writer simple script for condition. and return <code>true</code> or <code>false</code>. If you need help to write script let me know I will show some example.</p>
]]></description><link>http://forum.mycontroller.org/post/259</link><guid isPermaLink="true">http://forum.mycontroller.org/post/259</guid><dc:creator><![CDATA[jkandasa]]></dc:creator><pubDate>Tue, 08 Nov 2016 01:13:56 GMT</pubDate></item><item><title><![CDATA[Reply to Rules introduction on Thu, 03 Nov 2016 23:01:23 GMT]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I would like to execute some operation when data from two sensors meet some condition.<br />
For example:  if (sensor1 == 0 AND sensor2 == 0) then turn_off_power.</p>
<p dir="auto">Is there a way how to do it?</p>
<p dir="auto">Thank You,<br />
Marek</p>
]]></description><link>http://forum.mycontroller.org/post/258</link><guid isPermaLink="true">http://forum.mycontroller.org/post/258</guid><dc:creator><![CDATA[Marek]]></dc:creator><pubDate>Thu, 03 Nov 2016 23:01:23 GMT</pubDate></item></channel></rss>