Scenarios » History » Version 2
Janez Barbic, 13.01.2011 15:39
1 | 1 | Janez Barbic | h1. Scenarios |
---|---|---|---|
2 | |||
3 | 2 | Janez Barbic | Scenarios are defined in xml format in scenarios.xml file. |
4 | |||
5 | Example for one device: |
||
6 | <pre><code class="xml"> |
||
7 | <scenariotree> |
||
8 | <scenario id="ac_01"> |
||
9 | <name nam="Air Conditioner"/> |
||
10 | <minvalue minval="18"/> |
||
11 | <maxvalue maxval="27"/> |
||
12 | <optimal_value optVal="23"/> |
||
13 | <tolerance_value tolVal="0.5"/> |
||
14 | <idle_check_interval ici="600"/> |
||
15 | <active_check_interval aci="600"/> |
||
16 | <checked_devices chk_dev1="thermometer_01" chk_dev2="thermometer_01"/> |
||
17 | ...additional options, waiting for your input :) |
||
18 | <reaction_function fr="linear"/> |
||
19 | <action act="testAction_1"/> |
||
20 | <param par="testParam_1"/> |
||
21 | </scenario> |
||
22 | </scenariotree> |
||
23 | </code></pre> |
||
24 | |||
25 | Controlled device unique id: |
||
26 | <pre><code class="xml"> |
||
27 | <name nam="Air Conditioner"/> |
||
28 | </code></pre> |
||
29 | |||
30 | Device name, for logging purposes only: |
||
31 | <pre><code class="xml"> |
||
32 | <name nam="Air Conditioner"/> |
||
33 | </code></pre> |
||
34 | |||
35 | Boundaries which define interval which is used by logics. |
||
36 | <pre><code class="xml"> |
||
37 | <minvalue minval="18"/> |
||
38 | <maxvalue maxval="27"/> |
||
39 | </code></pre> |
||
40 | |||
41 | Optimal value of our interval: |
||
42 | <pre><code class="xml"> |
||
43 | <optimal_value optVal="23"/> |
||
44 | </code></pre> |
||
45 | |||
46 | 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. |
||
47 | <pre><code class="xml"> |
||
48 | <tolerance_value tolVal="0.5"/> |
||
49 | </code></pre> |
||
50 | |||
51 | Frequency of checks preformed by logics if the controlled device is +idle+ (in seconds): |
||
52 | <pre><code class="xml"> |
||
53 | <idle_check_interval ici="600"/> |
||
54 | </code></pre> |
||
55 | |||
56 | Frequency of checks preformed by logics if the controlled device is +active+ (in seconds): |
||
57 | <pre><code class="xml"> |
||
58 | <active_check_interval aci="600"/> |
||
59 | </code></pre> |
||
60 | |||
61 | 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. |
||
62 | 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. |
||
63 | |||
64 | Devices (meters) whose readings influence current controlled device: |
||
65 | Caution, these devices (meters) should +always+ be defined in +devices.xml+! |
||
66 | <pre><code class="xml"> |
||
67 | <checked_devices chk_dev1="thermometer_01" chk_dev2="thermometer_01"/> |
||
68 | </code></pre> |
||
69 | |||
70 | Function type used by logic to calculate parameter to send to controlled device. |
||
71 | Options are _static (ON/OFF), linear, logarithmic_ ... TBD |
||
72 | <pre><code class="xml"> |
||
73 | <reaction_function fr="linear"/> |
||
74 | </code></pre> |
||
75 | |||
76 | Location of action program with additional parameters: |
||
77 | <pre><code class="xml"> |
||
78 | <action act="testAction_1"/> |
||
79 | <param par="testParam_1"/> |
||
80 | </code></pre> |
||
81 | |||
82 | |||
83 | |||
84 | -Ignore for now: |
||
85 | 1 | Janez Barbic | ok tole bom na hitro po slovensko napisal, prevod kasneje |
86 | |||
87 | Air Conditioner |
||
88 | |||
89 | vzdrzujemo temperaturo 23+-0.5 C |
||
90 | |||
91 | klimo prizigamo na +-3 C, se pravi klima max greje pri 20 C in max hladi pri 26 C. Moc povecujemo/znizujemo linearno. |
||
92 | |||
93 | primer: temperatura 21 C |
||
94 | 23-20 = 3 C |
||
95 | 21-20 = 1 C |
||
96 | 1/3 = 0.33 |
||
97 | 1-0.33 = 0.66 => 100*zaokrozi navzgor(0.66) = 70 |
||
98 | 2 | Janez Barbic | klima greje na 70%- |