Skip to content

Commit 70f2e70

Browse files
Expose Sonoff TRVZB attributes for 1.3 firmware (#3909)
Co-authored-by: TheJulianJES <[email protected]>
1 parent a941a89 commit 70f2e70

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

zhaquirks/sonoff/trvzb.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Sonoff TRVZB - Zigbee Thermostatic Radiator Valve."""
22

33
from zigpy.quirks import CustomCluster
4-
from zigpy.quirks.v2 import QuirkBuilder
4+
from zigpy.quirks.v2 import NumberDeviceClass, QuirkBuilder
55
from zigpy.quirks.v2.homeassistant import UnitOfTemperature
66
import zigpy.types as t
77
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
@@ -70,6 +70,21 @@ class AttributeDefs(BaseAttributeDefs):
7070
type=t.uint8_t,
7171
)
7272

73+
external_temperature_sensor_enable = ZCLAttributeDef(
74+
id=0x600E,
75+
type=t.uint8_t,
76+
)
77+
78+
external_temperature_sensor_value = ZCLAttributeDef(
79+
id=0x600D,
80+
type=t.int16s,
81+
)
82+
83+
temperature_control_accuracy = ZCLAttributeDef(
84+
id=0x6011,
85+
type=t.int16s,
86+
)
87+
7388
@property
7489
def _is_manuf_specific(self):
7590
return False
@@ -121,5 +136,35 @@ def _is_manuf_specific(self):
121136
fallback_name="Valve closing degree",
122137
initially_disabled=True,
123138
)
139+
.number(
140+
CustomSonoffCluster.AttributeDefs.temperature_control_accuracy.name,
141+
CustomSonoffCluster.cluster_id,
142+
min_value=-1.0,
143+
max_value=-0.2,
144+
step=0.2,
145+
device_class=NumberDeviceClass.TEMPERATURE,
146+
unit=UnitOfTemperature.CELSIUS,
147+
multiplier=0.01,
148+
translation_key="temperature_control_accuracy",
149+
fallback_name="Temperature control accuracy",
150+
)
151+
.switch(
152+
CustomSonoffCluster.AttributeDefs.external_temperature_sensor_enable.name,
153+
CustomSonoffCluster.cluster_id,
154+
translation_key="external_temperature_sensor",
155+
fallback_name="External temperature sensor",
156+
)
157+
.number(
158+
CustomSonoffCluster.AttributeDefs.external_temperature_sensor_value.name,
159+
CustomSonoffCluster.cluster_id,
160+
min_value=0.0,
161+
max_value=99.9,
162+
step=0.1,
163+
device_class=NumberDeviceClass.TEMPERATURE,
164+
unit=UnitOfTemperature.CELSIUS,
165+
multiplier=0.01,
166+
translation_key="external_temperature_sensor_value",
167+
fallback_name="External temperature sensor value",
168+
)
124169
.add_to_registry()
125170
)

0 commit comments

Comments
 (0)