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