From 4bd52092b2032ffd196737e79cd416f91818d158 Mon Sep 17 00:00:00 2001 From: mano3m Date: Sun, 13 Oct 2024 16:36:43 +0200 Subject: [PATCH] Add EcoDim 05 quirk Inspired by #3362 --- zhaquirks/hzc/doubledimmerswitch.py | 126 ++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 zhaquirks/hzc/doubledimmerswitch.py diff --git a/zhaquirks/hzc/doubledimmerswitch.py b/zhaquirks/hzc/doubledimmerswitch.py new file mode 100644 index 0000000000..d5624e9935 --- /dev/null +++ b/zhaquirks/hzc/doubledimmerswitch.py @@ -0,0 +1,126 @@ +"""Quirk for EcoDim 05 two gang dimmer (e.g. HZC Smart Double Dimmer D686-ZG).""" + +from zigpy.profiles import zgp, zha +from zigpy.quirks import CustomCluster, CustomDevice +from zigpy.zcl.clusters.general import ( + Basic, + GreenPowerProxy, + Groups, + Identify, + LevelControl, + OnOff, + Ota, + Scenes, +) +from zigpy.zcl.clusters.lightlink import LightLink + +from zhaquirks import NoReplyMixin +from zhaquirks.const import ( + DEVICE_TYPE, + ENDPOINTS, + INPUT_CLUSTERS, + MODELS_INFO, + OUTPUT_CLUSTERS, + PROFILE_ID, +) + + +class HzcOnOff(NoReplyMixin, CustomCluster, OnOff): + """HZC On Off Cluster.""" + + void_input_commands = {cmd.id for cmd in OnOff.commands_by_name.values()} + + +class DimmerSwitch(CustomDevice): + """Double Dimmer-Switch-ZB3.0 by EcoDim / HZC / Shyugj.""" + + signature = { + MODELS_INFO: [ + ("EcoDim BV", "EcoDim-Zigbee 3.0"), + ], + ENDPOINTS: { + 1: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + LevelControl.cluster_id, + LightLink.cluster_id, + ], + OUTPUT_CLUSTERS: [Ota.cluster_id], + }, + 2: { + # + PROFILE_ID: zha.PROFILE_ID, + DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, + INPUT_CLUSTERS: [ + Basic.cluster_id, + Identify.cluster_id, + Groups.cluster_id, + Scenes.cluster_id, + OnOff.cluster_id, + LevelControl.cluster_id, + LightLink.cluster_id, + ], + OUTPUT_CLUSTERS: [Ota.cluster_id], + }, + 242: { + #