Scenarios » History » Version 3

Version 2 (Janez Barbic, 13.01.2011 15:39) → Version 3/11 (Janez Barbic, 13.01.2011 15:56)

h1. Scenarios

Scenarios are defined in xml format in scenarios.xml file.

Example for one device:
<pre><code class="xml">
<scenariotree>
<scenario id="ac_01">
<name nam="Air Conditioner"/>
<minvalue minval="18"/>
<maxvalue maxval="27"/>
<optimal_value optVal="23"/>
<tolerance_value tolVal="0.5"/>
<idle_check_interval ici="600"/>
<active_check_interval aci="60"/> aci=&quot;600&quot;/&gt;
<sensors chk_dev1="thermometer_01"/> &lt;checked_devices chk_dev1=&quot;thermometer_01&quot; chk_dev2=&quot;thermometer_01&quot;/&gt;
...additional options, waiting for your input :)
<reaction_function fr="linear"/>
<action act="testAction_1"/>
<param par="testParam_1"/>
</scenario>
</scenariotree>
</code></pre>

Controlled device unique id:
<pre><code class="xml">
<name nam="Air Conditioner"/>
</code></pre>

Device name, for logging purposes only:
<pre><code class="xml">
<name nam="Air Conditioner"/>
</code></pre>

Boundaries which define interval which is used by logics.
<pre><code class="xml">
<minvalue minval="18"/>
<maxvalue maxval="27"/>
</code></pre>

Optimal value of our interval:
<pre><code class="xml">
<optimal_value optVal="23"/>
</code></pre>

Tolerance of optimal value, on both sides (+-). No action should be taken within these boundaries. Tolerance value should not exceed min or max value of interval.
<pre><code class="xml">
<tolerance_value tolVal="0.5"/>
</code></pre>

Frequency of checks preformed by logics if the controlled device is +idle+ (in seconds):
<pre><code class="xml">
<idle_check_interval ici="600"/>
</code></pre>

Frequency of checks preformed by logics if the controlled device is +active+ (in seconds):
<pre><code class="xml">
<active_check_interval aci="600"/>
</code></pre>

Note that some devices have the same value on idle and active status. Typically these are devices, which aren't expected to be active all the time, for example an office computer. It gets turned off or turned only a few times per day.
On the other hand there are some devices which should be checked more frequently if logic took action. For example, window blinds should get more attention during sunrise/sunset or weather changes.

Devices (sensors) (meters) whose readings influence current controlled device:
Caution, these devices (sensors) (meters) should +always+ be defined in +devices.xml+!
<pre><code class="xml">
<sensors &lt;checked_devices chk_dev1="thermometer_01" chk_dev2="dummydevice_01"/> chk_dev2=&quot;thermometer_01&quot;/&gt;
</code></pre>

Function type used by logic to calculate parameter to send to controlled device.
Options are _static (ON/OFF), linear, logarithmic_ ... TBD
<pre><code class="xml">
<reaction_function fr="linear"/>
</code></pre>

Location of action program with additional parameters:
<pre><code class="xml">
<action act="testAction_1"/>
<param par="testParam_1"/>
</code></pre>

Example: -Ignore for now:
ok tole bom na hitro po slovensko napisal, prevod kasneje


ID: ac_01
Name
Air Conditioner
Temperatures: 18 - 27


vzdrzujemo temperaturo 23+-0.5 C

klimo prizigamo na +-3 C, se pravi klima max greje pri 20 C in max hladi pri 26 C. Moc povecujemo/znizujemo linearno.

primer: temperatura 21 C

Optimal temperature: 23 23-20 = 3 C
Tolerance: 0.5
Idle check interval: 10 min (600s)
Active check interval:
21-20 = 1 min (60s) C
Sensors: thermometer_01 1/3 = 0.33
Function type: linear
Action path: ../turnACon
Parameters: none

1. Current buffer average temperature 23.3 - within tolerance boundaries, logic takes no action.
2. In the next 10 minutes, buffer average temperature rises to 25.
Function is linear, logic calculates linear increase in power: 1-(27-23)/(26-23)
1-0.33 = 0.75 (75%)
Logic executes action turnACon with parameter -75
Device ac_10 is active, logic checks its sensors after 1 min.
0.66 =&gt; 100*zaokrozi navzgor(0.66) = 70
3. Current buffer average temperature 22.8 - within tolerance boundaries, logic takes no action.
Device ac_10 is inactive, logic checks its sensors after 10 min.
klima greje na 70%-