Skip to content

Commit aee8ecb

Browse files
committed
Add more missing features
1 parent 7c86595 commit aee8ecb

File tree

1 file changed

+168
-10
lines changed

1 file changed

+168
-10
lines changed

zhaquirks/bosch/rbsh_rth0_zb_eu.py

Lines changed: 168 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
"""Device handler for Bosch RBSH-RTH0-ZB-EU thermostat."""
22

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+
321
from zigpy.quirks import CustomCluster
422
from zigpy.quirks.v2 import QuirkBuilder
523
from zigpy.quirks.v2.homeassistant import PERCENTAGE, EntityType, UnitOfTemperature
@@ -14,20 +32,35 @@
1432
# Mode of operation with values BoschOperatingMode.
1533
OPERATING_MODE_ATTR_ID = 0x4007
1634

17-
# Valve duty cycle: 0% - 100%
35+
# Valve duty cycle: 0% - 100%.
1836
VALVE_DUTY_CYCLE_ATTR_ID = 0x4020
1937

38+
# Valve state (relay on/off).
39+
VALVE_STATE_ATTR_ID = 0x4022
40+
2041
# Window open switch (changes to a lower target temperature when on).
2142
WINDOW_OPEN_ATTR_ID = 0x4042
2243

2344
# Boost heating preset mode.
2445
BOOST_HEATING_ATTR_ID = 0x4043
2546

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
2858

2959
"""Bosch specific user interface attribute ids."""
3060

61+
# Valve status LED config.
62+
VALVE_STATUS_LED_ATTR_ID = 0x4033
63+
3164
# Display on-time (5s - 30s).
3265
SCREEN_TIMEOUT_ATTR_ID = 0x403A
3366

@@ -50,6 +83,29 @@ class State(t.enum8):
5083
On = 0x01
5184

5285

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+
53109
class BoschThermostatCluster(CustomCluster, Thermostat):
54110
"""Bosch thermostat cluster."""
55111

@@ -91,12 +147,36 @@ class AttributeDefs(Thermostat.AttributeDefs):
91147
access="rw",
92148
)
93149

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,
96158
type=t.int16s,
97159
is_manufacturer_specific=True,
98160
)
99161

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+
100180

101181
class BoschUserInterfaceCluster(CustomCluster, UserInterface):
102182
"""Bosch UserInterface cluster."""
@@ -118,6 +198,12 @@ class AttributeDefs(UserInterface.AttributeDefs):
118198
is_manufacturer_specific=True,
119199
)
120200

201+
valve_status_led = ZCLAttributeDef(
202+
id=VALVE_STATUS_LED_ATTR_ID,
203+
type=BoschValveStatusLed,
204+
is_manufacturer_specific=True,
205+
)
206+
121207

122208
(
123209
QuirkBuilder("Bosch", "RBSH-RTH0-ZB-EU")
@@ -133,6 +219,24 @@ class AttributeDefs(UserInterface.AttributeDefs):
133219
translation_key="valve_duty_cycle",
134220
fallback_name="Valve duty cycle",
135221
)
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+
)
136240
# Operating mode - On/Pause automatically from HVAC mode, Schedule/Manual configured here.
137241
.enum(
138242
BoschThermostatCluster.AttributeDefs.operating_mode.name,
@@ -142,7 +246,25 @@ class AttributeDefs(UserInterface.AttributeDefs):
142246
translation_key="operating_mode",
143247
fallback_name="Operating mode",
144248
)
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.
146268
.enum(
147269
BoschUserInterfaceCluster.AttributeDefs.temperature_display_mode.name,
148270
TemperatureDisplayMode,
@@ -158,6 +280,33 @@ class AttributeDefs(UserInterface.AttributeDefs):
158280
translation_key="boost_heating",
159281
fallback_name="Boost heating",
160282
)
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+
)
161310
# Window open switch: manually set or through an automation.
162311
.switch(
163312
BoschThermostatCluster.AttributeDefs.window_open.name,
@@ -185,19 +334,28 @@ class AttributeDefs(UserInterface.AttributeDefs):
185334
translation_key="display_brightness",
186335
fallback_name="Display brightness",
187336
)
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+
)
188346
# Input for displaying outdoor temperature in the corner of the screen.
189347
.number(
190-
BoschThermostatCluster.AttributeDefs.outdoor_temperature_input.name,
348+
BoschThermostatCluster.AttributeDefs.outdoor_temperature.name,
191349
BoschThermostatCluster.cluster_id,
192350
min_value=-32768,
193351
max_value=32767,
194-
step=1,
352+
step=0.1,
195353
unit=UnitOfTemperature.CELSIUS,
196354
multiplier=0.01,
197355
entity_type=EntityType.CONFIG,
198356
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",
201359
)
202360
.add_to_registry()
203361
)

0 commit comments

Comments
 (0)