-
Notifications
You must be signed in to change notification settings - Fork 0
/
fhem_mobotix.cfg
104 lines (91 loc) · 4.02 KB
/
fhem_mobotix.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
###############################################################################
# #
# fhem_mobotix.cfg Wolfram Plettscher 05/2019 #
# included into fhem_main.cfg #
# #
# configure Mobotix devices #
# #
###############################################################################
###############################################################################
### Haustuer Klingel
define MbxHaustuer_Klingel dummy
attr MbxHaustuer_Klingel group Alarm
attr MbxHaustuer_Klingel room AussenFront,Eingang
attr MbxHaustuer_Klingel webCmd on
# on
define actOn_MbxHaustuer_Klingel notify MbxHaustuer_Klingel:on { \
if (Value("OutOfHome") eq "on") { \
# barking dogs as we are not at home \
fhem "set MP3Gong_Sound playTone 2";;\
} elsif (($month == 12) && (($mday > 5) && ($mday < 27))) { \
# jinglebells for Christmas \
fhem "set MP3Gong_Sound playTone 3";;\
} else {\
# regular bell sound \
fhem "set MP3Gong_Sound playTone 0";;\
}\
}
###############################################################################
### Haustuer Licht
define MbxHaustuer_Licht dummy
attr MbxHaustuer_Licht group Alarm
attr MbxHaustuer_Licht room AussenFront,Eingang
attr MbxHaustuer_Licht webCmd on
# on
define actOn_MbxHaustuer_Licht notify MbxHaustuer_Licht:on { \
fhem "set MP3Gong_Sound playTone 0";;\
}
###############################################################################
### Haustuer Motion
define MbxHaustuer_Motion dummy
attr MbxHaustuer_Motion group Alarm
attr MbxHaustuer_Motion room AussenFront,Eingang
attr MbxHaustuer_Motion webCmd on
### Bewegungsmelder dummy zur Anzeige im Floorplan
### Alarm, danach 5 Min Alarm aufgehoben, danach o.k.
define MotionDmy_Haustuer dummy
attr MotionDmy_Haustuer webCmd motion:noMotion:off
attr MotionDmy_Haustuer room Sensors
attr MotionDmy_Haustuer group Sensors
attr MotionDmy_Haustuer fp_vorgarten 566,618,0, 
attr MotionDmy_Haustuer fp_homecontrol 267,1007,0, 
attr MotionDmy_Haustuer devStateIcon off:people_sensor@white motion:people_sensor@red .*:people_sensor@yellow
set MotionDmy_Haustuer off
define actOn_MbxHaustuer_Motion notify MbxHaustuer_Motion:on { \
### only at night and when switch "AutoVorgarten" is turned into "motion" \
if ((Value ("hmStatus_Led_08") eq "red") && \
(Value ("AutoVorgarten") eq "motion")) { \
\
### light is turned off and motion detector activates all lights \
if (Value ("MotionDmy_Haustuer") eq "off") {\
fhem "set MotionDmy_Haustuer motion";;\
fhem "set hmStatus_Led_15 led red";;\
fhem "set BaeumeVorgarten on";;\
fhem "defmod t_MbxHaustuer_Motion1 at +00:05:00 set MotionDmy_Haustuer noMotion";;\
};; \
\
### new motion detection, so reset timer to another 5 mins \
if (Value ("MotionDmy_Haustuer") eq "motion") {\
fhem "defmod t_MbxHaustuer_Motion1 at +00:05:00 set MotionDmy_Haustuer noMotion";;\
} \
} \
}
### prevent motion detector to turn on lights, when they get turned off - yellow state
define actOn_MotionDmy_Haustuer_noMotion notify MotionDmy_Haustuer:noMotion { \
if ((Value ("hmStatus_Led_08") eq "red") && \
(Value ("AutoVorgarten") eq "motion")) { \
fhem "defmod t_MotionDmy_Haustuer_noMotion at +00:00:10 set MotionDmy_Haustuer off";;\
fhem "set hmStatus_Led_15 led orange";;\
fhem "set BaeumeVorgarten off";;\
} \
}
### light is turned off and motion detector can be enabled again
define actOn_MotionDmy_Haustuer_off notify MotionDmy_Haustuer:off { \
fhem "set hmStatus_Led_15 led green";;\
}
###############################################################################
### Frontcam Motion
define MbxFrontcam dummy
attr MbxFrontcam group Alarm
attr MbxFrontcam room AussenFront,Eingang
attr MbxFrontcam webCmd on