1
1
"""Device handler for Bosch RBSH-RTH0-ZB-EU thermostat."""
2
2
3
+ """
4
+ There are some more undocumented values that have not been figured out what they do.
5
+ In Thermostat cluster:
6
+ 0x4023: Valid values 0-7
7
+ 0x4024: Valid values 0-23
8
+ 0x4025: Valid values 0-100
9
+ 0x4050: Valid values 5-10
10
+ 0x405b: Valid values 0-255
11
+ 0x4063: Valid values 0-3 (turns on display when changed, probably the UFH/Boiler/Radiator setting, but the values are unknown)
12
+
13
+ In UserInterface cluster:
14
+ 0x4032: Valid values 0-15
15
+ 0x406a: Valid values 0-255
16
+ 0x406b: Valid values 0-255
17
+ 0x406c: Valid values 0-255
18
+ 0x406d: Valid values 0-255
19
+ """
20
+
3
21
from zigpy .quirks import CustomCluster
4
22
from zigpy .quirks .v2 import QuirkBuilder
5
23
from zigpy .quirks .v2 .homeassistant import PERCENTAGE , EntityType , UnitOfTemperature
14
32
# Mode of operation with values BoschOperatingMode.
15
33
OPERATING_MODE_ATTR_ID = 0x4007
16
34
17
- # Valve duty cycle: 0% - 100%
35
+ # Valve duty cycle: 0% - 100%.
18
36
VALVE_DUTY_CYCLE_ATTR_ID = 0x4020
19
37
38
+ # Valve state (relay on/off).
39
+ VALVE_STATE_ATTR_ID = 0x4022
40
+
20
41
# Window open switch (changes to a lower target temperature when on).
21
42
WINDOW_OPEN_ATTR_ID = 0x4042
22
43
23
44
# Boost heating preset mode.
24
45
BOOST_HEATING_ATTR_ID = 0x4043
25
46
26
- # Outdoor temperature input
27
- OUTDOOR_TEMP_INPUT_ATTR_ID = 0x4051
47
+ # Outdoor temperature (writing to this adds it to the corner of the screen).
48
+ OUTDOOR_TEMP_ATTR_ID = 0x4051
49
+
50
+ # External sensor (S1/S2 10K NTC) temperature.
51
+ EXTERNAL_SENSOR_TEMP_ATTR_ID = 0x4052
52
+
53
+ # Actuator type setting (NO/NC).
54
+ ACTUATOR_TYPE_ATTR_ID = 0x4060
55
+
56
+ # External sensor connection config.
57
+ SENSOR_CONNECTION_ATTR_ID = 0x4062
28
58
29
59
"""Bosch specific user interface attribute ids."""
30
60
61
+ # Valve status LED config.
62
+ VALVE_STATUS_LED_ATTR_ID = 0x4033
63
+
31
64
# Display on-time (5s - 30s).
32
65
SCREEN_TIMEOUT_ATTR_ID = 0x403A
33
66
@@ -50,6 +83,29 @@ class State(t.enum8):
50
83
On = 0x01
51
84
52
85
86
+ class BoschActuatorType (t .enum8 ):
87
+ """Actuator type: Normally Open or Normally Closed."""
88
+
89
+ NormallyClosed = 0x00
90
+ NormallyOpen = 0x01
91
+
92
+
93
+ class BoschValveStatusLed (t .enum8 ):
94
+ """Valve status LED (dot next to heat/cool icon) functionality"""
95
+
96
+ AlwaysOff = 0x00
97
+ Normal = 0x01
98
+ AlwaysOn = 0x02
99
+
100
+
101
+ class BoschSensorConnection (t .enum8 ):
102
+ """Sensor connection setting (for external 10K NTC sensor on S1/S2)"""
103
+
104
+ NotUsed = 0x00
105
+ WithoutRegulation = 0xb0
106
+ WithRegulation = 0xb1
107
+
108
+
53
109
class BoschThermostatCluster (CustomCluster , Thermostat ):
54
110
"""Bosch thermostat cluster."""
55
111
@@ -91,12 +147,36 @@ class AttributeDefs(Thermostat.AttributeDefs):
91
147
access = "rw" ,
92
148
)
93
149
94
- outdoor_temperature_input = ZCLAttributeDef (
95
- id = OUTDOOR_TEMP_INPUT_ATTR_ID ,
150
+ outdoor_temperature = ZCLAttributeDef (
151
+ id = OUTDOOR_TEMP_ATTR_ID ,
152
+ type = t .int16s ,
153
+ is_manufacturer_specific = True ,
154
+ )
155
+
156
+ external_sensor_temperature = ZCLAttributeDef (
157
+ id = EXTERNAL_SENSOR_TEMP_ATTR_ID ,
96
158
type = t .int16s ,
97
159
is_manufacturer_specific = True ,
98
160
)
99
161
162
+ valve_state = ZCLAttributeDef (
163
+ id = VALVE_STATE_ATTR_ID ,
164
+ type = State ,
165
+ is_manufacturer_specific = True ,
166
+ )
167
+
168
+ actuator_type = ZCLAttributeDef (
169
+ id = ACTUATOR_TYPE_ATTR_ID ,
170
+ type = BoschActuatorType ,
171
+ is_manufacturer_specific = True ,
172
+ )
173
+
174
+ sensor_connection = ZCLAttributeDef (
175
+ id = SENSOR_CONNECTION_ATTR_ID ,
176
+ type = BoschSensorConnection ,
177
+ is_manufacturer_specific = True ,
178
+ )
179
+
100
180
101
181
class BoschUserInterfaceCluster (CustomCluster , UserInterface ):
102
182
"""Bosch UserInterface cluster."""
@@ -118,6 +198,12 @@ class AttributeDefs(UserInterface.AttributeDefs):
118
198
is_manufacturer_specific = True ,
119
199
)
120
200
201
+ valve_status_led = ZCLAttributeDef (
202
+ id = VALVE_STATUS_LED_ATTR_ID ,
203
+ type = BoschValveStatusLed ,
204
+ is_manufacturer_specific = True ,
205
+ )
206
+
121
207
122
208
(
123
209
QuirkBuilder ("Bosch" , "RBSH-RTH0-ZB-EU" )
@@ -133,6 +219,24 @@ class AttributeDefs(UserInterface.AttributeDefs):
133
219
translation_key = "valve_duty_cycle" ,
134
220
fallback_name = "Valve duty cycle" ,
135
221
)
222
+ # Valve state (open/closed).
223
+ .sensor (
224
+ BoschThermostatCluster .AttributeDefs .valve_state .name ,
225
+ BoschThermostatCluster .cluster_id ,
226
+ translation_key = "valve_state" ,
227
+ fallback_name = "Valve state" ,
228
+ )
229
+ # External sensor temperature.
230
+ # You CAN write to this, but it does not make any sense.
231
+ .sensor (
232
+ BoschThermostatCluster .AttributeDefs .external_sensor_temperature .name ,
233
+ BoschThermostatCluster .cluster_id ,
234
+ unit = UnitOfTemperature .CELSIUS ,
235
+ multiplier = 0.01 ,
236
+ device_class = NumberDeviceClass .TEMPERATURE ,
237
+ translation_key = "external_sensor_temperature" ,
238
+ fallback_name = "External sensor temperature" ,
239
+ )
136
240
# Operating mode - On/Pause automatically from HVAC mode, Schedule/Manual configured here.
137
241
.enum (
138
242
BoschThermostatCluster .AttributeDefs .operating_mode .name ,
@@ -142,7 +246,25 @@ class AttributeDefs(UserInterface.AttributeDefs):
142
246
translation_key = "operating_mode" ,
143
247
fallback_name = "Operating mode" ,
144
248
)
145
- # Temperature display type.
249
+ # Actuator type config.
250
+ .enum (
251
+ BoschThermostatCluster .AttributeDefs .actuator_type .name ,
252
+ BoschActuatorType ,
253
+ BoschThermostatCluster .cluster_id ,
254
+ entity_type = EntityType .CONFIG ,
255
+ translation_key = "actuator_type" ,
256
+ fallback_name = "Actuator type" ,
257
+ )
258
+ # External sensor config.
259
+ .enum (
260
+ BoschThermostatCluster .AttributeDefs .sensor_connection .name ,
261
+ BoschSensorConnection ,
262
+ BoschThermostatCluster .cluster_id ,
263
+ entity_type = EntityType .CONFIG ,
264
+ translation_key = "sensor_connection" ,
265
+ fallback_name = "Sensor connection" ,
266
+ )
267
+ # Temperature display mode.
146
268
.enum (
147
269
BoschUserInterfaceCluster .AttributeDefs .temperature_display_mode .name ,
148
270
TemperatureDisplayMode ,
@@ -158,6 +280,33 @@ class AttributeDefs(UserInterface.AttributeDefs):
158
280
translation_key = "boost_heating" ,
159
281
fallback_name = "Boost heating" ,
160
282
)
283
+ # Cooling setpoint limits.
284
+ .number (
285
+ BoschThermostatCluster .AttributeDefs .min_cool_setpoint_limit .name ,
286
+ BoschThermostatCluster .cluster_id ,
287
+ min_value = - 500 ,
288
+ max_value = 3000 ,
289
+ step = 0.5 ,
290
+ unit = UnitOfTemperature .CELSIUS ,
291
+ multiplier = 0.01 ,
292
+ entity_type = EntityType .CONFIG ,
293
+ device_class = NumberDeviceClass .TEMPERATURE ,
294
+ translation_key = "min_cool_setpoint_limit" ,
295
+ fallback_name = "Min cool setpoint limit" ,
296
+ )
297
+ .number (
298
+ BoschThermostatCluster .AttributeDefs .max_cool_setpoint_limit .name ,
299
+ BoschThermostatCluster .cluster_id ,
300
+ min_value = - 500 ,
301
+ max_value = 3000 ,
302
+ step = 0.5 ,
303
+ unit = UnitOfTemperature .CELSIUS ,
304
+ multiplier = 0.01 ,
305
+ entity_type = EntityType .CONFIG ,
306
+ device_class = NumberDeviceClass .TEMPERATURE ,
307
+ translation_key = "max_cool_setpoint_limit" ,
308
+ fallback_name = "Max cool setpoint limit" ,
309
+ )
161
310
# Window open switch: manually set or through an automation.
162
311
.switch (
163
312
BoschThermostatCluster .AttributeDefs .window_open .name ,
@@ -185,19 +334,28 @@ class AttributeDefs(UserInterface.AttributeDefs):
185
334
translation_key = "display_brightness" ,
186
335
fallback_name = "Display brightness" ,
187
336
)
337
+ # Valve status LED config.
338
+ .enum (
339
+ BoschUserInterfaceCluster .AttributeDefs .valve_status_led .name ,
340
+ BoschValveStatusLed ,
341
+ BoschUserInterfaceCluster .cluster_id ,
342
+ entity_type = EntityType .CONFIG ,
343
+ translation_key = "valve_status_led" ,
344
+ fallback_name = "Valve status LED" ,
345
+ )
188
346
# Input for displaying outdoor temperature in the corner of the screen.
189
347
.number (
190
- BoschThermostatCluster .AttributeDefs .outdoor_temperature_input .name ,
348
+ BoschThermostatCluster .AttributeDefs .outdoor_temperature .name ,
191
349
BoschThermostatCluster .cluster_id ,
192
350
min_value = - 32768 ,
193
351
max_value = 32767 ,
194
- step = 1 ,
352
+ step = 0. 1 ,
195
353
unit = UnitOfTemperature .CELSIUS ,
196
354
multiplier = 0.01 ,
197
355
entity_type = EntityType .CONFIG ,
198
356
device_class = NumberDeviceClass .TEMPERATURE ,
199
- translation_key = "outdoor_temperature_input " ,
200
- fallback_name = "Outdoor temperature input " ,
357
+ translation_key = "outdoor_temperature " ,
358
+ fallback_name = "Outdoor temperature" ,
201
359
)
202
360
.add_to_registry ()
203
361
)
0 commit comments