|
@@ -34,12 +34,14 @@ class first_floor_east_floor(room):
|
34
|
34
|
# Device initialisation
|
35
|
35
|
#
|
36
|
36
|
# http://shelly1l-3C6105E4E629
|
|
37
|
+ # main light
|
37
|
38
|
self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY)
|
38
|
39
|
super().__init__(mqtt_client)
|
39
|
40
|
|
40
|
41
|
#
|
41
|
42
|
# Virtual Device Interface
|
42
|
43
|
#
|
|
44
|
+ # main light
|
43
|
45
|
self.main_light = videv_switching(
|
44
|
46
|
mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_VIDEV,
|
45
|
47
|
self.main_light_shelly, devices.shelly.KEY_OUTPUT_0
|
|
@@ -52,8 +54,10 @@ class first_floor_east_kitchen(room):
|
52
|
54
|
# Device initialisation
|
53
|
55
|
#
|
54
|
56
|
# http://shelly1l-8CAAB5616C01
|
|
57
|
+ # main light
|
55
|
58
|
self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_KITCHEN_MAIN_LIGHT_SHELLY)
|
56
|
59
|
# http://shelly1-e89f6d85a466/
|
|
60
|
+ # circulation pump
|
57
|
61
|
self.circulation_pump_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_SHELLY)
|
58
|
62
|
|
59
|
63
|
super().__init__(mqtt_client)
|
|
@@ -61,16 +65,19 @@ class first_floor_east_kitchen(room):
|
61
|
65
|
#
|
62
|
66
|
# Functionality initialisation
|
63
|
67
|
#
|
|
68
|
+ # circulation pump
|
64
|
69
|
self.circulation_pump = timer_on_activation(self.circulation_pump_shelly, devices.shelly.KEY_OUTPUT_0, 10*60)
|
65
|
70
|
self.circulation_pump_shelly.add_callback(devices.shelly.KEY_OUTPUT_0, True, self.main_light_shelly.flash_0_mcb, True)
|
66
|
71
|
|
67
|
72
|
#
|
68
|
73
|
# Virtual Device Interface
|
69
|
74
|
#
|
|
75
|
+ # main light
|
70
|
76
|
self.main_light_videv = videv_switching(
|
71
|
77
|
mqtt_client, config.TOPIC_FFE_KITCHEN_MAIN_LIGHT_VIDEV,
|
72
|
78
|
self.main_light_shelly, devices.shelly.KEY_OUTPUT_0
|
73
|
79
|
)
|
|
80
|
+ # circulation pump
|
74
|
81
|
self.circulation_pump_videv = videv_switching_timer(
|
75
|
82
|
mqtt_client, config.TOPIC_FFE_KITCHEN_CIRCULATION_PUMP_VIDEV,
|
76
|
83
|
self.circulation_pump_shelly, devices.shelly.KEY_OUTPUT_0,
|
|
@@ -86,8 +93,13 @@ class first_floor_east_dining(room):
|
86
|
93
|
self.day_events = day_event((6, 0), (22, 0), 30, -30)
|
87
|
94
|
|
88
|
95
|
# http://shelly1l-84CCA8ADD055
|
|
96
|
+ # main light
|
89
|
97
|
self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_DININGROOM_MAIN_LIGHT_SHELLY)
|
|
98
|
+ # floor lamp
|
90
|
99
|
self.floorlamp_powerplug = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_DININGROOM_FLOOR_LAMP_POWERPLUG)
|
|
100
|
+ # heating function
|
|
101
|
+ self.heating_valve = devices.brennenstuhl_heatingvalve(mqtt_client, config.TOPIC_FFE_DININGROOM_HEATING_VALVE_ZIGBEE)
|
|
102
|
+ # garland
|
91
|
103
|
if config.CHRISTMAS:
|
92
|
104
|
self.garland_powerplug = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_DININGROOM_GARLAND_POWERPLUG)
|
93
|
105
|
super().__init__(mqtt_client)
|
|
@@ -97,19 +109,36 @@ class first_floor_east_dining(room):
|
97
|
109
|
#
|
98
|
110
|
self.day_events.add_callback(None, True, self.__day_events__, True)
|
99
|
111
|
|
|
112
|
+ # main light
|
100
|
113
|
self.main_light_shelly.add_callback(devices.shelly.KEY_OUTPUT_0, None, self.floorlamp_powerplug.set_output_0_mcb, True)
|
101
|
114
|
|
|
115
|
+ # heating function
|
|
116
|
+ self.heating_function = heating_function(
|
|
117
|
+ self.heating_valve,
|
|
118
|
+ config.DEFAULT_TEMPERATURE[self.heating_valve.topic],
|
|
119
|
+ **get_radiator_data(self.heating_valve.topic)
|
|
120
|
+ )
|
|
121
|
+ self.heating_function.add_callback(None, None, set_radiator_data, True)
|
|
122
|
+
|
102
|
123
|
#
|
103
|
124
|
# Virtual Device Interface
|
104
|
125
|
#
|
|
126
|
+ # main light
|
105
|
127
|
self.main_light_videv = videv_switching(
|
106
|
128
|
mqtt_client, config.TOPIC_FFE_DININGROOM_MAIN_LIGHT_VIDEV,
|
107
|
129
|
self.main_light_shelly, devices.shelly.KEY_OUTPUT_0
|
108
|
130
|
)
|
|
131
|
+ # floor lamp
|
109
|
132
|
self.floorlamp_videv = videv_switching(
|
110
|
133
|
mqtt_client, config.TOPIC_FFE_DININGROOM_FLOOR_LAMP_VIDEV,
|
111
|
134
|
self.floorlamp_powerplug, devices.silvercrest_powerplug.KEY_OUTPUT_0
|
112
|
135
|
)
|
|
136
|
+ # heating function
|
|
137
|
+ self.heating_function_videv = videv_heating(
|
|
138
|
+ mqtt_client, config.TOPIC_FFE_DININGROOM_HEATING_VALVE_VIDEV,
|
|
139
|
+ self.heating_function
|
|
140
|
+ )
|
|
141
|
+ # garland
|
113
|
142
|
if config.CHRISTMAS:
|
114
|
143
|
self.garland_videv = videv_switching(
|
115
|
144
|
mqtt_client, config.TOPIC_FFE_DININGROOM_GARLAND_VIDEV,
|
|
@@ -131,11 +160,15 @@ class first_floor_east_sleep(room):
|
131
|
160
|
# Device initialisation
|
132
|
161
|
#
|
133
|
162
|
# http://shelly1l-E8DB84A254C7
|
|
163
|
+ # main light
|
134
|
164
|
self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_SHELLY)
|
135
|
165
|
self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_ZIGBEE)
|
|
166
|
+ # bed light
|
136
|
167
|
self.bed_light_di_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE)
|
137
|
168
|
self.bed_light_ma_powerplug = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_POWERPLUG)
|
|
169
|
+ # heating function
|
138
|
170
|
self.heating_valve = devices.brennenstuhl_heatingvalve(mqtt_client, config.TOPIC_FFE_SLEEP_HEATING_VALVE_ZIGBEE)
|
|
171
|
+ # button
|
139
|
172
|
self.button_tradfri = devices.tradfri_button(mqtt_client, config.TOPIC_FFE_SLEEP_INPUT_DEVICE)
|
140
|
173
|
|
141
|
174
|
super().__init__(mqtt_client)
|
|
@@ -147,7 +180,6 @@ class first_floor_east_sleep(room):
|
147
|
180
|
self.brightness_functions = brightness_choose_n_action(self.button_tradfri)
|
148
|
181
|
self.brightness_functions.add(self.main_light_tradfri, self.main_light_shelly, devices.shelly.KEY_OUTPUT_0)
|
149
|
182
|
self.brightness_functions.add(self.bed_light_di_tradfri, self.bed_light_di_tradfri, devices.tradfri_light.KEY_OUTPUT_0)
|
150
|
|
-
|
151
|
183
|
# button / main light
|
152
|
184
|
self.button_tradfri.add_callback(devices.tradfri_button.KEY_ACTION, devices.tradfri_button.ACTION_TOGGLE,
|
153
|
185
|
self.main_light_shelly.toggle_output_0_mcb)
|
|
@@ -168,12 +200,14 @@ class first_floor_east_sleep(room):
|
168
|
200
|
#
|
169
|
201
|
# Virtual Device Interface
|
170
|
202
|
#
|
|
203
|
+ # main light
|
171
|
204
|
self.main_light_videv = videv_switch_brightness_color_temp(
|
172
|
205
|
mqtt_client, config.TOPIC_FFE_SLEEP_MAIN_LIGHT_VIDEV,
|
173
|
206
|
self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
|
174
|
207
|
self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
|
175
|
208
|
self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
|
176
|
209
|
)
|
|
210
|
+ # bed light
|
177
|
211
|
self.bed_light_di_videv = videv_switch_brightness(
|
178
|
212
|
mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_VIDEV,
|
179
|
213
|
self.bed_light_di_tradfri, devices.tradfri_light.KEY_OUTPUT_0,
|
|
@@ -183,10 +217,12 @@ class first_floor_east_sleep(room):
|
183
|
217
|
mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_VIDEV,
|
184
|
218
|
self.bed_light_ma_powerplug, devices.silvercrest_powerplug.KEY_OUTPUT_0
|
185
|
219
|
)
|
|
220
|
+ # heating function
|
186
|
221
|
self.heating_function_videv = videv_heating(
|
187
|
222
|
mqtt_client, config.TOPIC_FFE_SLEEP_HEATING_VALVE_VIDEV,
|
188
|
223
|
self.heating_function
|
189
|
224
|
)
|
|
225
|
+ # button
|
190
|
226
|
self.brightness_functions_device_videv = videv_multistate(
|
191
|
227
|
mqtt_client, config.TOPIC_FFE_SLEEP_ACTIVE_BRIGHTNESS_DEVICE_VIDEV,
|
192
|
228
|
brightness_choose_n_action.KEY_ACTIVE_DEVICE, self.brightness_functions, 2
|
|
@@ -199,10 +235,13 @@ class first_floor_east_living(room):
|
199
|
235
|
# Device initialisation
|
200
|
236
|
#
|
201
|
237
|
# http://shelly1l-3C6105E3F910
|
|
238
|
+ # main light
|
202
|
239
|
self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_SHELLY)
|
203
|
240
|
self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_ZIGBEE)
|
|
241
|
+ # floor lamp
|
204
|
242
|
self.floorlamp_tradfri = devices.group(
|
205
|
243
|
*[devices.tradfri_light(mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_ZIGBEE % i) for i in range(1, 7)])
|
|
244
|
+ # xmas tree
|
206
|
245
|
if config.CHRISTMAS:
|
207
|
246
|
self.powerplug_xmas_tree = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_TREE_POWERPLUG)
|
208
|
247
|
self.powerplug_xmas_star = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_STAR_POWERPLUG)
|
|
@@ -218,18 +257,21 @@ class first_floor_east_living(room):
|
218
|
257
|
#
|
219
|
258
|
# Virtual Device Interface
|
220
|
259
|
#
|
|
260
|
+ # main light
|
221
|
261
|
self.main_light_videv = videv_switch_brightness_color_temp(
|
222
|
262
|
mqtt_client, config.TOPIC_FFE_LIVINGROOM_MAIN_LIGHT_VIDEV,
|
223
|
263
|
self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
|
224
|
264
|
self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
|
225
|
265
|
self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
|
226
|
266
|
)
|
|
267
|
+ # floor lamp
|
227
|
268
|
self.floorlamp_videv = videv_switch_brightness_color_temp(
|
228
|
269
|
mqtt_client, config.TOPIC_FFE_LIVINGROOM_FLOOR_LAMP_VIDEV,
|
229
|
270
|
self.floorlamp_tradfri, devices.tradfri_light.KEY_OUTPUT_0,
|
230
|
271
|
self.floorlamp_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
|
231
|
272
|
self.floorlamp_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
|
232
|
273
|
)
|
|
274
|
+ # xmas tree
|
233
|
275
|
if config.CHRISTMAS:
|
234
|
276
|
self.xmas_tree_videv = videv_switching(
|
235
|
277
|
mqtt_client, config.TOPIC_FFE_LIVINGROOM_XMAS_TREE_VIDEV,
|