Project

General

Profile

Actions

Scenarios » History » Revision 5

« Previous | Revision 5/11 (diff) | Next »
Janez Barbic, 13.01.2011 18:59


Scenarios

(XML - values are in attributes just because of some issues with XML parser, should be fixed in future)

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

Example for one device:

<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"/>
    <sensors chk_dev1="thermometer_01"/>
    ...additional options, waiting for your input :)
    <reaction_function fr="linear"/>
        <action act="testAction_1"/>
        <param par="testParam_1"/>
    </scenario>
</scenariotree>

Controlled device unique id:

<name nam="Air Conditioner"/>

Device name, for logging purposes only:


<name nam="Air Conditioner"/>

Boundaries which define interval which is used by logics.

<minvalue minval="18"/>
<maxvalue maxval="27"/>

Optimal value of our interval:

<optimal_value optVal="23"/>

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.

<tolerance_value tolVal="0.5"/>

Frequency of checks preformed by logics if the controlled device is idle (in seconds):

<idle_check_interval ici="600"/>

Frequency of checks preformed by logics if the controlled device is active (in seconds):

<active_check_interval aci="600"/>

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) whose readings influence current controlled device:
Caution, these devices (sensors) should always be defined in devices.xml!

<sensors chk_dev1="thermometer_01" chk_dev2="dummydevice_01"/>

Function type used by logic to calculate parameter to send to controlled device.
Options are static (ON/OFF), linear, logarithmic ... TBD

<reaction_function fr="linear"/>

Location of action program with additional parameters:

<action act="testAction_1"/>
<param par="testParam_1"/>

Example:

ID: ac_01
Name Air Conditioner
Temperatures: 18 - 27
Optimal temperature: 23
Tolerance: 0.5
Idle check interval: 10 min (600s)
Active check interval: 1 min (60s)
Sensors: thermometer_01
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) = 0.75 (75%); power = 1-(maxT - optimalT)/(currT-optimalT)
Logic executes action turnACon with parameter -75
Device ac_10 is active, logic checks its sensors after 1 min.
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.

Updated by Janez Barbic almost 14 years ago · 5 revisions