Hive heating quirk built with copilot using z2m as a guide #4580
yeti1394
started this conversation in
Show and tell
Replies: 1 comment
-
|
here is the init.py `"""Custom ZHA quirks for Hive heating devices.""" from .hive_quirks import HiveSLR2b, HiveSLT3 all = ["HiveSLR2b", "HiveSLT3"]` |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i have been going from zha to z2m due to some devices working better on one than the other. ZHA was the best for most devices but my heating. thought i would give copilot a run at it and finally got this, Any one else want to test?
`"""Custom ZHA quirks for Computime/Hive SLR2b and SLT3b with extended features."""
from zigpy.zcl import Cluster
from zigpy.zcl.clusters.general import Basic, Identify, Alarms, Time, PowerConfiguration
from zigpy.zcl.clusters.hvac import Thermostat, UserInterface
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zhaquirks import CustomDevice
class HiveManufacturerCluster(Cluster):
"""Hive manufacturer-specific cluster exposing boost/hot water/schedule enable."""
cluster_id = 0xFD00
name = "HiveManufacturerCluster"
ep_attribute = "hive_manufacturer"
class HiveThermostatCluster(Thermostat):
"""Extend thermostat cluster to add Auto hvac_mode and Z2M-like preset modes."""
@Property
def supported_hvac_modes(self):
return ["off", "heat", "auto"]
class HivePowerConfiguration(PowerConfiguration):
"""Convert battery_voltage (0x0020) to battery_percentage_remaining (0x0021)."""
def _update_attribute(self, attrid, value):
if attrid == 0x0020: # battery_voltage
percent = int((value - 2.5) / 0.5 * 100)
super()._update_attribute(0x0021, max(0, min(100, percent)))
else:
super()._update_attribute(attrid, value)
class HiveSLR2b(CustomDevice):
"""Computime/Hive SLR2b heating receiver."""
signature = {
"models_info": [("Computime", "SLR2b")],
"endpoints": {
5: {
"profile_id": 0x0104,
"device_type": 0x0301,
"input_clusters": [0x0000, 0x0003, 0x0009, 0x000A, 0x0201, 0xFD00],
"output_clusters": [0x0000, 0x000A, 0x0019, 0x0402, 0xFD00],
},
6: {"profile_id": 0x0104, "device_type": 0x0301, "input_clusters": [0x0201], "output_clusters": []},
7: {"profile_id": 0x0104, "device_type": 0x0301, "input_clusters": [0x0402], "output_clusters": []},
8: {"profile_id": 0x0104, "device_type": 0x0301, "input_clusters": [0x0402], "output_clusters": []},
},
}
class HiveSLT3b(CustomDevice):
"""Computime/Hive SLT3b thermostat."""
signature = {
"models_info": [("Computime", "SLT3b")],
"endpoints": {
9: {
"profile_id": 0x0104,
"device_type": 0x0302,
"input_clusters": [
0x0000, # Basic
0x0001, # PowerConfiguration
0x0003, # Identify
0x0009, # Alarms
0x000A, # Time
0x0020, # PollControl
0x0201, # Thermostat
0x0204, # UserInterface
0x0402, # TemperatureMeasurement
0xFD00, # Manufacturer specific
],
"output_clusters": [
0x0000, # Basic
0x0003, # Identify
0x000A, # Time
0x0019, # OTA
0x0201, # Thermostat
0xFD00,
],
},
},
}
Beta Was this translation helpful? Give feedback.
All reactions