-
Notifications
You must be signed in to change notification settings - Fork 3
/
widget_homematic.html
executable file
·252 lines (239 loc) · 11 KB
/
widget_homematic.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/**
* -----------------------------------------------------------------------------
* @package smartVISU Homematic widgets
* @author Bernd Gewehr
* @copyright 2014
* @license GPL [http://www.gnu.com]
/**
* Standard blind HM-LC-Bl1PBU-FM
*
* @param unique id for this widget
* @param name of the blind
* @param a gad/item for the up- and down- movement
* @param a gad/item for stopping the movement (optional, sends 'stop')
* @param a gad/item for the actual absolute position of the blinds
* @param a gad/item for increase- and decreace- of the blade (optional)
* @param a gad/item for the actual absolute angle of the blade (optional)
* @param the minimum value for close (optional, default 0)
* @param the maximum value for open (optional, default 255)
* @param step between two values (optional, default 5)
*
* @info inspired by Frank Berlenz
*/
{% macro hmbl(id, txt, gad_move, gad_stop, gad_pos, gad_shift, gad_angle, min, max, step) %}
{% import "basic.html" as basic %}
{% set uid = uid(page, id) %}
<div class="blind">
<table align="center" cellpadding="0">
<tr>
<td valign="top">
<div class="set">{{ basic.button(id~'up', gad_move, '', 'arrow-u', 'off') }}</div>
</td>
<td rowspan="3" align="left" class="pos">
{{ basic.slider(id~'pos', gad_pos, min, max, step, 'vertical') }}</td>
<td rowspan="2" valign="bottom">
{{ txt }}
</td>
</tr>
<tr>
<td>
{% if gad_stop %}
<div class="set">{{ basic.button(id~'stop', gad_stop, '', 'delete', 'stop') }}</div> {% endif %}</td>
</tr>
<tr>
<td valign="bottom">
<div class="set">{{ basic.button(id~'down', gad_move, '', 'arrow-d', 'on') }}</div>
</td>
<td valign="bottom">
{% if gad_shift %}
<div class="set">
<span style="float: left;">{{ basic.button(id~'minus', gad_shift, '', 'minus', 0) }}</span>
<span style="float: right;">{{ basic.button(id~'plus', gad_shift, '', 'plus', 1) }}</span>
</div>
{% endif %}
</td>
</tr>
</table>
</div>
{% endmacro %}
/**
* Standard dimmer with switching and dimming function
*
* @param unique id for this widget
* @param name of the dimmer
* @param a gad/item for switching
* @param a gad/item for dimming
* @param the minimum value if the slider is moved to total left (optional, default 0)
* @param the maximum value if the slider is moved to total right (optional, default 255)
* @param step between two values (optional, default 5)
*/
{% macro dimmer(id, txt, gad_switch, gad_value, min, max, step) %}
{% import "basic.html" as basic %}
<div class="dimmer">
{{ basic.switch(id~'switch', gad_switch, icon1~'light_light.png', icon0~'light_light.png') }}
<p>{{ txt|e }}</p>
{{ basic.slider(id~'slider', gad_value, min, max, step) }}
</div>
{% endmacro %}
/**
* Homematic HM-TC Wandthermostat
*
* @param unique id for this widget
* @param name of the rtr
* @param a gad/item for the actual temperature
* @param a gad/item for the set temperature
* @param a gad/item for auto / manual
* @param a gad/item for boost
* @param a gad/item for battery
* @param a gad/item for the current state of the actor
* @param a gad/item for a text (for boost-time), (optional)
* @param step for plus/minus buttons (optional, default 0.5)
*/
{% macro hmtc(id, txt, gad_actual, gad_set, gad_controlmode, gad_daytemp, gad_nighttemp, gad_window, gad_battery, gad_state, gad_txt, step, gad_valve, gad_humidity) %}
{% import "basic.html" as basic %}
{% import "icon.html" as icon %}
<div id="{{ uid(page, id) }}" data-widget="device.rtr" data-step="{{ step|default(0.5) }}"
class="rtr">
<div class="actual">
<div class="temp">
{{ basic.symbol(id~'windowopen', gad_window, '', icon1~'fts_window_2w_open.png','open') }}
{{ basic.symbol(id~'windowclose', gad_window, '', icon0~'fts_window_2w.png','closed') }}
{{ basic.float(id~'actual', gad_actual, '°' ) }}
{{ icon.battery(id~'battery', '', gad_battery, '2.2', '3') }}
</div>
{% if gad_humidity %}<div style="font-size:0.8em">Luftfeuchte: {{ basic.value(id~'humidity', gad_humidity) }}%</div>{% endif %}
{% if gad_valve %}<div style="font-size:0.8em">Ventil: {{ basic.value(id~'valve', gad_valve) }}%</div>{% endif %}
<div class="text">
{{ txt }} {{ basic.value(id~'controlmode', gad_controlmode) }} {% if gad_txt %} {{ basic.value(id~'txt', gad_txt) }} {% endif %}
</div>
</div>
{% if gad_set %}
<div class="set">
<a data-role="button" data-icon="minus" data-inline="true" data-iconpos="notext" class="ui-mini"></a>
<div class="temp">{{ basic.float(id~'set', gad_set, '°' ) }}</div>
<a data-role="button" data-icon="plus" data-inline="true" data-iconpos="notext" class="ui-mini"></a>
</div>
{% endif %}
<div class="control" style="width: 250px;">
<table align="center" cellpadding="0">
<tr>
<td>{{ basic.switch(id~'manauto', gad_controlmode, icon1~'sani_heating_automatic.png', icon0~'sani_heating_manual.png', 'auto', 'manual') }}</td>
<td>{{ basic.switch(id~'boost', gad_controlmode, icon1~'sani_heating_boost.png', icon0~'sani_heating_boost.png', 'boost', 'auto') }}</td>
<td>{{ basic.switch(id~'night', gad_set, icon1~'scene_night.png', icon0~'scene_night.png', '17', '21') }}</td>
<td>{{ basic.switch(id~'day', gad_set, icon1~'scene_day.png', icon0~'scene_day.png', '21', '17') }}</td>
{% if gad_state %}<td>{{ basic.switch(id~'state', gad_state, icon1~'sani_heating.png', icon0~'sani_heating.png') }}</td>{% endif %}
</tr>
</table>
</div>
</div>
{% endmacro %}
/**
* Homematic HM-TC, HM-CC Wand- und Heizkörperthermostat Timer
*
* @param unique id for this widget
* @param name of the rtr
* @param a gad/item for the actual Program (prog1, prog2, prog3)
* @param a gad/item for the P1_0_tempListSat
* @param a gad/item for the P1_1_tempListSun
* @param a gad/item for the P1_2_tempListMon
* @param a gad/item for the P1_3_tempListTue
* @param a gad/item for the P1_4_tempListWed
* @param a gad/item for the P1_5_tempListThu
* @param a gad/item for the P1_6_tempListFri
*/
{% macro hmtctimer(id, txt, gad_prog, gad_p1_sat, gad_p1_sun, gad_p1_mon, gad_p1_tue, gad_p1_wed, gad_p1_thu, gad_p1_fri, gad_init, gad_save, gad_restore, gad_p2_sat, gad_p2_sun, gad_p2_mon, gad_p2_tue, gad_p2_wed, gad_p2_thu, gad_p2_fri, gad_p3_sat, gad_p3_sun, gad_p3_mon, gad_p3_tue, gad_p3_wed, gad_p3_thu, gad_p3_fri) %}
{% import "basic.html" as basic %}
{% import "basic2.html" as basic2 %}
<div id="{{ uid(page, id) }}" style="font-size:0.8em">
<table width="100%" style="text-align:left">
<tr><td width="80px">Programm:</td>
<td style="float:left width:50%">{% if gad_prog %}{{ basic2.selectmenu(id~'prog', gad_prog, '', 'prog1', 'prog2', 'prog3') }}{% endif %}</td>
<td style="width:50% float:right">
<span data-role="controlgroup" data-type="horizontal" style="float:right;">
{% if gad_init %}{{ basic.button(id~'init', gad_init, ' init ', '' ) }}{% endif %}
{% if gad_save %}{{ basic.button(id~'save', gad_save, ' save ', '') }}{% endif %}
{% if gad_restore %}{{ basic.button(id~'restore', gad_restore, 'restore', '') }}{% endif %}
</span>
</td></tr></table>
{% if gad_prog %}{{ basic2.pager('pager123', gad_prog, 'prog1') }}{% endif %}
<div id="pages" style="position:relative">
<div id="prog1" style="visibility:visible; position:absolute; top:0; width:100%">
{{ basic2.textinput(id~'p1_mon', gad_p1_mon, 'Montag:') }}
{{ basic2.textinput(id~'p1_tue', gad_p1_tue, 'Dienstag:') }}
{{ basic2.textinput(id~'p1_wed', gad_p1_wed, 'Mittwoch:') }}
{{ basic2.textinput(id~'p1_thu', gad_p1_thu, 'Donnerstag:') }}
{{ basic2.textinput(id~'p1_fri', gad_p1_fri, 'Freitag:') }}
{{ basic2.textinput(id~'p1_sat', gad_p1_sat, 'Samstag:') }}
{{ basic2.textinput(id~'p1_sun', gad_p1_sun, 'Sonntag:') }}
</div>
<div id="prog2" style="visibility:hidden; position:absolute; top:0; width:100%">
{{ basic2.textinput(id~'p2_mon', gad_p2_mon, 'Montag:') }}
{{ basic2.textinput(id~'p2_tue', gad_p2_tue, 'Dienstag:') }}
{{ basic2.textinput(id~'p2_wed', gad_p2_wed, 'Mittwoch:') }}
{{ basic2.textinput(id~'p2_thu', gad_p2_thu, 'Donnerstag:') }}
{{ basic2.textinput(id~'p2_fri', gad_p2_fri, 'Freitag:') }}
{{ basic2.textinput(id~'p2_sat', gad_p2_sat, 'Samstag:') }}
{{ basic2.textinput(id~'p2_sun', gad_p2_sun, 'Sonntag:') }}
</div>
<div id="prog3" style="visibility:hidden; position:absolute; top:0; width:100%">
{{ basic2.textinput(id~'p3_mon', gad_p3_mon, 'Montag:') }}
{{ basic2.textinput(id~'p3_tue', gad_p3_tue, 'Dienstag:') }}
{{ basic2.textinput(id~'p3_wed', gad_p3_wed, 'Mittwoch:') }}
{{ basic2.textinput(id~'p3_thu', gad_p3_thu, 'Donnerstag:') }}
{{ basic2.textinput(id~'p3_fri', gad_p3_fri, 'Freitag:') }}
{{ basic2.textinput(id~'p3_sat', gad_p3_sat, 'Samstag:') }}
{{ basic2.textinput(id~'p3_sun', gad_p3_sun, 'Sonntag:') }}
</div>
</div>
</div>
{% endmacro %}
/**
* Standard shutter
*
* @param unique id for this widget
* @param name of the shutter
* @param a gad/item for the up- and down- movement
* @param a gad/item for stopping the movement (optional)
* @param a gad/item for the actual absolute position of the blinds
* @param a gad/item for increase- and decreace- of the blade (optional, for future use)
* @param a gad/item for the actual absolute angle of the blade (optional)
* @param a gad/item for some saved positions (optional)
* @param the minimum value for close (optional, default 0)
* @param the maximum value for open (optional, default 255)
* @param step between two values (optional, default 5)
* @param the mode: 'half' blade turns from -1 to +1, or 'full' blade turns from 0 to +1 (optional, default 'half')
*
* @info inspired by Jörg Gutowski
*/
{% macro shutter(id, txt, gad_move, gad_stop, gad_pos, gad_shift, gad_angle, gad_saved, min, max, step, mode) %}
{% import "basic.html" as basic %}
{% set uid = uid(page, id) %}
<div class="blind">
<table align="center" cellpadding="0">
<tr>
<td valign="top">
<div class="set">{{ basic.button(id~'up', gad_move, '', 'arrow-u', 'off') }}</div>
</td>
<td rowspan="3" align="center" class="pos">
{{ basic.shutter(id, gad_pos, gad_angle, min, max, step, mode) }}</td>
<td valign="top">
{% if gad_saved %}
<div>{{ basic.button(id~'saved1', gad_saved, 'Pos1', 'grid', 0) }} </div>{% endif %}</td>
</tr>
<tr>
<td valign="center">
{% if gad_stop %}
<div class="set">{{ basic.button(id~'stop', gad_stop, '', 'delete', 'stop') }}</div> {% endif %}</td>
<td valign="center">{{ txt }}</td>
</tr>
<tr>
<td valign="bottom">
<div class="set">{{ basic.button(id~'down', gad_move, '', 'arrow-d', 'on') }}</div>
</td>
<td valign="bottom">
{% if gad_saved %}
<div>{{ basic.button(id~'saved2', gad_saved, 'Pos2', 'grid', 1) }} </div>{% endif %}</td>
</tr>
</table>
</div>
{% endmacro %}