Skip to content

Commit 82b6e81

Browse files
committed
Add outdoor temperature input
1 parent bc62e43 commit 82b6e81

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

zhaquirks/bosch/rbsh_rth0_zb_eu.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from zigpy.quirks import CustomCluster
44
from zigpy.quirks.v2 import QuirkBuilder
5-
from zigpy.quirks.v2.homeassistant import PERCENTAGE, EntityType
5+
from zigpy.quirks.v2.homeassistant import PERCENTAGE, EntityType, UnitOfTemperature
6+
from zigpy.quirks.v2.homeassistant.number import NumberDeviceClass
67
from zigpy.quirks.v2.homeassistant.sensor import SensorStateClass
78
import zigpy.types as t
89
from zigpy.zcl.clusters.hvac import TemperatureDisplayMode, Thermostat, UserInterface
@@ -22,6 +23,9 @@
2223
# Boost heating preset mode.
2324
BOOST_HEATING_ATTR_ID = 0x4043
2425

26+
# Outdoor temperature input
27+
OUTDOOR_TEMP_INPUT_ATTR_ID = 0x4051
28+
2529
"""Bosch specific user interface attribute ids."""
2630

2731
# Display on-time (5s - 30s).
@@ -86,6 +90,12 @@ class AttributeDefs(Thermostat.AttributeDefs):
8690
type=TemperatureDisplayMode,
8791
access="rw",
8892
)
93+
94+
outdoor_temperature_input = ZCLAttributeDef(
95+
id=OUTDOOR_TEMP_INPUT_ATTR_ID,
96+
type=t.int16s,
97+
is_manufacturer_specific=True,
98+
)
8999

90100

91101
class BoschUserInterfaceCluster(CustomCluster, UserInterface):
@@ -175,5 +185,19 @@ class AttributeDefs(UserInterface.AttributeDefs):
175185
translation_key="display_brightness",
176186
fallback_name="Display brightness",
177187
)
188+
# Input for displaying outdoor temperature in the corner of the screen.
189+
.number(
190+
BoschThermostatCluster.AttributeDefs.outdoor_temperature_input.name,
191+
BoschThermostatCluster.cluster_id,
192+
min_value=-32768,
193+
max_value=32767,
194+
step=1,
195+
unit=UnitOfTemperature.CELSIUS,
196+
multiplier=0.01,
197+
entity_type=EntityType.CONFIG,
198+
device_class=NumberDeviceClass.TEMPERATURE,
199+
translation_key="outdoor_temperature_input",
200+
fallback_name="Outdoor temperature input",
201+
)
178202
.add_to_registry()
179203
)

0 commit comments

Comments
 (0)