-
Notifications
You must be signed in to change notification settings - Fork 0
/
fhem_plc_dimmer.cfg
489 lines (454 loc) · 17.2 KB
/
fhem_plc_dimmer.cfg
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
###############################################################################
# #
# fhem_plc_dimmer.cfg Wolfram Plettscher 09/2020 #
# included into fhem_main.cfg #
# #
# communicate with Wago PLC dimmer devices #
# #
###############################################################################
###############################################################################
### Dimmer Spiegel Bad
define Dimmer_Spiegel_Bad dummy
attr Dimmer_Spiegel_Bad room Licht,Bad,SPS
attr Dimmer_Spiegel_Bad group Licht
attr Dimmer_Spiegel_Bad userattr plcflag
attr Dimmer_Spiegel_Bad plcflag false
attr Dimmer_Spiegel_Bad webCmd 0:25:50:85
attr Dimmer_Spiegel_Bad fp_obergeschoss 653,1145,0,Spiegel_Bad
attr Dimmer_Spiegel_Bad devStateIcon 0:light_mirror@green:85 85:light_mirror@red:0 .*:light_mirror@yellow:0
# react on Dimmer_Spiegel_Bad
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_SpiegelBad_Val notify Dimmer_Spiegel_Bad.* {\
if (AttrVal ("Dimmer_Spiegel_Bad", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Spiegel_Bad reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Spiegel_Bad plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Spiegel_Bad event $EVENT -->\n");;\
fhem (" \
set Wago880 spiegelbad_trigger 0;; \
set Wago880 spiegelbad_data $EVENT;; \
set Wago880 spiegelbad_trigger 1;; \
sleep 3;; set Wago880 spiegelbad_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Luftraum
define Dimmer_Luftraum dummy
attr Dimmer_Luftraum room Licht,Eingang,SPS
attr Dimmer_Luftraum group Licht
attr Dimmer_Luftraum webCmd 0:25:50:65
attr Dimmer_Luftraum fp_erdgeschoss 520,1043,0,Luftraum
attr Dimmer_Luftraum fp_obergeschoss 489,1123,0,Luftraum
attr Dimmer_Luftraum devStateIcon 0:off@white:65 65:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Luftraum userattr plcflag
attr Dimmer_Luftraum plcflag false
# react on Dimmer_Luftraum
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Luftraum_Val notify Dimmer_Luftraum.* {\
if (AttrVal ("Dimmer_Luftraum", "plcflag", "true") eq "true") { \
fhem (" \
attr Dimmer_Luftraum plcflag false \
") \
} else { \
fhem (" \
set Wago880 luftraum_trigger 0;; \
set Wago880 luftraum_data $EVENT;; \
set Wago880 luftraum_trigger 1;; \
sleep 3;; set Wago880 luftraum_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Gast Schlafzimmer
define Dimmer_GastSchlaf dummy
attr Dimmer_GastSchlaf room Licht,Gast,SPS
attr Dimmer_GastSchlaf group Licht
attr Dimmer_GastSchlaf webCmd 0:25:50:80
attr Dimmer_GastSchlaf fp_erdgeschoss 876,966,0,Gast
attr Dimmer_GastSchlaf devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_GastSchlaf userattr plcflag
attr Dimmer_GastSchlaf plcflag false
# react on Dimmer_Gast
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_GastSchlaf_Val notify Dimmer_GastSchlaf.* {\
Log 1, "--> Dimmer_GastSchlaf $EVENT -->";; \
if (AttrVal ("Dimmer_GastSchlaf", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_GastSchlaf reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_GastSchlaf plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_GastSchlaf event $EVENT -->\n");;\
fhem (" \
set Wago880 gast_trigger 0;; \
set Wago880 gast_data $EVENT;; \
set Wago880 gast_trigger 1;; \
sleep 3;; set Wago880 gast_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Buero
define Dimmer_Buero dummy
attr Dimmer_Buero room Licht,Buero,SPS
attr Dimmer_Buero group Licht
attr Dimmer_Buero webCmd 0:25:50:80
attr Dimmer_Buero fp_obergeschoss 275,539,0,Buero
attr Dimmer_Buero devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Buero userattr plcflag
attr Dimmer_Buero plcflag false
# react on Dimmer_Buero
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Buero_Val notify Dimmer_Buero.* {\
Log 1, "--> Dimmer_Buero $EVENT -->";; \
if (AttrVal ("Dimmer_Buero", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Buero reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Buero plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Buero event $EVENT -->\n");;\
fhem (" \
set Wago880 buero_trigger 0;;\
set Wago880 buero_data $EVENT;;\
set Wago880 buero_trigger 1;;\
sleep 0.1;;\
set Wago880 buero_trigger 0\
") \
} \
}
###############################################################################
### Dimmer LEDHaustuer
define Dimmer_LEDHaustuer dummy
attr Dimmer_LEDHaustuer room Licht,AussenFront,SPS
attr Dimmer_LEDHaustuer group Licht
attr Dimmer_LEDHaustuer webCmd 0:20:40
attr Dimmer_LEDHaustuer fp_erdgeschoss 613,1217,0,LEDHaustuer
attr Dimmer_LEDHaustuer fp_vorgarten 596,803,0,LEDHaustuer
attr Dimmer_LEDHaustuer devStateIcon 0:off@white:20 20:on@red:0 .*:dim50%@yellow:0
attr Dimmer_LEDHaustuer userattr plcflag
attr Dimmer_LEDHaustuer plcflag false
# react on Dimmer_LEDHaustuer
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_LEDHaustuer_Val notify Dimmer_LEDHaustuer.* {\
Log 1, "--> Dimmer_LEDHaustuer $EVENT -->";; \
if (AttrVal ("Dimmer_LEDHaustuer", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_LEDHaustuer reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_LEDHaustuer plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_LEDHaustuer event $EVENT -->\n");;\
fhem (" \
set Wago880 ledhaustuer_trigger 0;;\
set Wago880 ledhaustuer_data $EVENT;;\
set Wago880 ledhaustuer_trigger 1;;\
sleep 0.1;;\
set Wago880 ledhaustuer_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Kueche Mittelblock
define Dimmer_KuecheMB dummy
attr Dimmer_KuecheMB room Licht,Kueche,SPS
attr Dimmer_KuecheMB group Licht
attr Dimmer_KuecheMB webCmd 0:25:50:80
attr Dimmer_KuecheMB fp_erdgeschoss 738,549,0,Mittelblock
attr Dimmer_KuecheMB devStateIcon 0:off@green:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_KuecheMB userattr plcflag
attr Dimmer_KuecheMB plcflag false
# react on Dimmer_KuecheMB
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_KuecheMB notify Dimmer_KuecheMB.* {\
Log 1, "--> Dimmer_KuecheMB $EVENT -->";; \
if (AttrVal ("Dimmer_KuecheMB", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_KuecheMB reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_KuecheMB plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_KuecheMB event $EVENT -->\n");;\
fhem (" \
set Wago880 kuechemb_trigger 0;;\
set Wago880 kuechemb_data $EVENT;;\
set Wago880 kuechemb_trigger 1;;\
sleep 0.1;;\
set Wago880 kuechemb_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Kuechenzeile
define Dimmer_Kuechenzeile dummy
attr Dimmer_Kuechenzeile room Licht,Kueche,SPS
attr Dimmer_Kuechenzeile group Licht
attr Dimmer_Kuechenzeile webCmd 0:25:50:80
attr Dimmer_Kuechenzeile fp_erdgeschoss 765,415,0,Kueche
attr Dimmer_Kuechenzeile devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Kuechenzeile userattr plcflag
attr Dimmer_Kuechenzeile plcflag false
# react on Dimmer_Kuechenzeile
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Kueche notify Dimmer_Kuechenzeile {\
Log 1, "--> Dimmer_Kuechenzeile $EVENT -->";; \
if (AttrVal ("Dimmer_Kuechenzeile", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Kuechenzeile reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Kuechenzeile plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Kuechenzeile event $EVENT -->\n");;\
fhem (" \
set Wago880 kueche_trigger 0;;\
set Wago880 kueche_data $EVENT;;\
set Wago880 kueche_trigger 1;;\
sleep 0.1;;\
set Wago880 kueche_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Galerie
define Dimmer_Galerie dummy
attr Dimmer_Galerie room Licht,Eingang,SPS
attr Dimmer_Galerie group Licht
attr Dimmer_Galerie webCmd 0:50:80
attr Dimmer_Galerie fp_obergeschoss 510,861,0,Galerie
attr Dimmer_Galerie devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Galerie userattr plcflag
attr Dimmer_Galerie plcflag false
# react on Dimmer_Galerie
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Galerie notify Dimmer_Galerie {\
Log 1, "--> Dimmer_Galerie $EVENT -->";; \
if (AttrVal ("Dimmer_Galerie", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Galerie reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Galerie plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Galerie event $EVENT -->\n");;\
fhem (" \
set Wago880 galerie_trigger 0;;\
set Wago880 galerie_data $EVENT;;\
set Wago880 galerie_trigger 1;;\
sleep 0.1;;\
set Wago880 galerie_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Esszimmertisch
define Dimmer_Esstisch dummy
attr Dimmer_Esstisch room Licht,Kueche,Wohnzimmer,SPS
attr Dimmer_Esstisch group Licht
attr Dimmer_Esstisch webCmd 0:50:80
attr Dimmer_Esstisch fp_erdgeschoss 566,347,0,Esstisch
attr Dimmer_Esstisch devStateIcon 0:off@green:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Esstisch userattr plcflag
attr Dimmer_Esstisch plcflag false
# react on Dimmer_Esszimmertisch
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Esstisch notify Dimmer_Esstisch {\
Log 1, "--> Dimmer_Esstisch $EVENT -->";; \
if (AttrVal ("Dimmer_Esstisch", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Esstisch reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Esstisch plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Esstisch event $EVENT -->\n");;\
fhem (" \
set Wago880 essztisch_trigger 0;;\
set Wago880 essztisch_data $EVENT;;\
set Wago880 essztisch_trigger 1;;\
sleep 0.1;;\
set Wago880 essztisch_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Wohnzimmer
define Dimmer_Wohnzimmer dummy
attr Dimmer_Wohnzimmer room Licht,Kueche,Wohnzimmer,SPS
attr Dimmer_Wohnzimmer group Licht
attr Dimmer_Wohnzimmer webCmd 0:50:80
attr Dimmer_Wohnzimmer fp_erdgeschoss 184,653,0,Wohnzimmer
attr Dimmer_Wohnzimmer devStateIcon 0:off@green:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Wohnzimmer userattr plcflag
attr Dimmer_Wohnzimmer plcflag false
# react on Dimmer_Wohnzimmer
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Wohnzimmer notify Dimmer_Wohnzimmer {\
Log 1, "--> Dimmer_Wohnzimmer $EVENT -->";; \
if (AttrVal ("Dimmer_Wohnzimmer", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Wohnzimmer reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Wohnzimmer plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Wohnzimmer event $EVENT -->\n");;\
fhem (" \
set Wago880 wohnzimmer_trigger 0;;\
set Wago880 wohnzimmer_data $EVENT;;\
set Wago880 wohnzimmer_trigger 1;;\
sleep 0.1;;\
set Wago880 wohnzimmer_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Treppe
define Dimmer_Treppe dummy
attr Dimmer_Treppe room Licht,Eingang,Wohnzimmer,Kueche,SPS
attr Dimmer_Treppe group Licht
attr Dimmer_Treppe webCmd 0:50:80
attr Dimmer_Treppe fp_erdgeschoss 248,850,0,Treppe
attr Dimmer_Treppe fp_obergeschoss 145,834,0,Treppe
attr Dimmer_Treppe devStateIcon 0:off@green:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Treppe userattr plcflag
attr Dimmer_Treppe plcflag false
# react on Dimmer_Treppe
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Treppe notify Dimmer_Treppe {\
Log 1, "--> Dimmer_Treppe $EVENT -->";; \
if (AttrVal ("Dimmer_Treppe", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Treppe reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Treppe plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Treppe event $EVENT -->\n");;\
fhem (" \
set Wago880 treppe_trigger 0;;\
set Wago880 treppe_data $EVENT;;\
set Wago880 treppe_trigger 1;;\
sleep 0.1;;\
set Wago880 treppe_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Einfahrt
define Dimmer_Einfahrt dummy
attr Dimmer_Einfahrt room Licht,Vorgarten,SPS
attr Dimmer_Einfahrt group Licht
attr Dimmer_Einfahrt webCmd 0:10:20
attr Dimmer_Einfahrt fp_vorgarten 983,1132,0,Einfahrt
attr Dimmer_Einfahrt devStateIcon 0:off@white:10 10:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Einfahrt userattr plcflag
attr Dimmer_Einfahrt plcflag false
# react on Dimmer_Einfahrt
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Einfahrt notify Dimmer_Einfahrt {\
Log 1, "--> Dimmer_Einfahrt $EVENT -->";; \
if (AttrVal ("Dimmer_Einfahrt", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Einfahrt reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Einfahrt plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Einfahrt event $EVENT -->\n");;\
fhem (" \
set Wago880 einfahrt_trigger 0;;\
set Wago880 einfahrt_data $EVENT;;\
set Wago880 einfahrt_trigger 1;;\
sleep 0.1;;\
set Wago880 einfahrt_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Schlafzimmer
define Dimmer_Schlaf dummy
attr Dimmer_Schlaf room Licht,Schlafzimmer,SPS
attr Dimmer_Schlaf group Licht
attr Dimmer_Schlaf webCmd 0:50:80
attr Dimmer_Schlaf fp_obergeschoss 579,511,0,Dimmer_Schlaf
attr Dimmer_Schlaf devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Schlaf userattr plcflag
attr Dimmer_Schlaf plcflag false
# react on Dimmer_Schlaf
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Schlaf notify Dimmer_Schlaf {\
Log 1, "--> Dimmer_Schlaf $EVENT -->";; \
if (AttrVal ("Dimmer_Schlaf", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Schlaf reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Schlaf plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Schlaf event $EVENT -->\n");;\
fhem (" \
set Wago880 schlaf_trigger 0;;\
set Wago880 schlaf_data $EVENT;;\
set Wago880 schlaf_trigger 1;;\
sleep 0.1;;\
set Wago880 schlaf_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Ankleide
define Dimmer_Ankl dummy
attr Dimmer_Ankl room Licht,Schlafzimmer,SPS
attr Dimmer_Ankl group Licht
attr Dimmer_Ankl webCmd 0:50:80
attr Dimmer_Ankl fp_obergeschoss 845,811,0,Dimmer_Ankl
attr Dimmer_Ankl devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Ankl userattr plcflag
attr Dimmer_Ankl plcflag false
# react on Dimmer_Ankl
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Ankl notify Dimmer_Ankl {\
Log 1, "--> Dimmer_Ankl $EVENT -->";; \
if (AttrVal ("Dimmer_Ankl", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Ankl reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Ankl plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Ankl event $EVENT -->\n");;\
fhem (" \
set Wago880 ankleide_trigger 0;;\
set Wago880 ankleide_data $EVENT;;\
set Wago880 ankleide_trigger 1;;\
sleep 0.1;;\
set Wago880 ankleide_trigger 0\
") \
} \
}
###############################################################################
### Dimmer Terrasse
define Dimmer_Terrasse dummy
attr Dimmer_Terrasse room Licht,Garten,SPS
attr Dimmer_Terrasse group Licht
attr Dimmer_Terrasse webCmd 0:50:80
attr Dimmer_Terrasse fp_garten 619,528,0,Dimmer_Terrasse
attr Dimmer_Terrasse devStateIcon 0:off@white:50 50:on@red:0 .*:dim50%@yellow:0
attr Dimmer_Terrasse userattr plcflag
attr Dimmer_Terrasse plcflag false
# react on Dimmer_Terrasse
# only transmit status to PLC, if PLC is not origin of change (plcflag)
define actOn_Terrasse notify Dimmer_Terrasse {\
Log 1, "--> Dimmer_Terrasse $EVENT -->";; \
if (AttrVal ("Dimmer_Terrasse", "plcflag", "true") eq "true") { \
Log 1, ("<-- Dimmer_Terrasse reset plcflag $EVENT -->\n");;\
fhem (" \
attr Dimmer_Terrasse plcflag false \
") \
} else { \
Log 1, ("<-- Dimmer_Terrasse event $EVENT -->\n");;\
fhem (" \
set Wago880 terrasse_trigger 0;;\
set Wago880 terrasse_data $EVENT;;\
set Wago880 terrasse_trigger 1;;\
sleep 0.1;;\
set Wago880 terrasse_trigger 0\
") \
} \
}