-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Inovelli switch VZM30-SN (#3689)
- Loading branch information
1 parent
73c9c92
commit 91adfc4
Showing
2 changed files
with
400 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,324 @@ | ||
"""VZM30-SN Switch.""" | ||
|
||
from zigpy.profiles import zgp, zha | ||
from zigpy.profiles.zha import DeviceType | ||
from zigpy.quirks import CustomDevice | ||
from zigpy.zcl.clusters.general import ( | ||
Basic, | ||
GreenPowerProxy, | ||
Groups, | ||
Identify, | ||
LevelControl, | ||
OnOff, | ||
Ota, | ||
Scenes, | ||
) | ||
from zigpy.zcl.clusters.homeautomation import Diagnostic, ElectricalMeasurement | ||
from zigpy.zcl.clusters.measurement import RelativeHumidity, TemperatureMeasurement | ||
from zigpy.zcl.clusters.smartenergy import Metering | ||
|
||
from zhaquirks.const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
from zhaquirks.inovelli import INOVELLI_AUTOMATION_TRIGGERS, InovelliVZM30SNCluster | ||
|
||
INOVELLI_VZM30SN_CLUSTER_ID = 64561 | ||
WWAH_CLUSTER_ID = 64599 | ||
|
||
|
||
class InovelliVZM30SNv1(CustomDevice): | ||
"""VZM30-SN mmWave Dimmer Switch.""" | ||
|
||
signature = { | ||
MODELS_INFO: [("Inovelli", "VZM30-SN")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
Diagnostic.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
WWAH_CLUSTER_ID, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [Basic.cluster_id, Identify.cluster_id], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
], | ||
}, | ||
3: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
], | ||
}, | ||
4: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: 0x0302, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
RelativeHumidity.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
], | ||
}, | ||
242: { | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: 0x0061, | ||
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
Diagnostic.cluster_id, | ||
InovelliVZM30SNCluster, | ||
WWAH_CLUSTER_ID, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Ota.cluster_id, | ||
], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [Basic.cluster_id, Identify.cluster_id], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
InovelliVZM30SNCluster, | ||
], | ||
}, | ||
3: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [Basic.cluster_id, Identify.cluster_id], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
InovelliVZM30SNCluster, | ||
], | ||
}, | ||
4: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: 0x0302, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
RelativeHumidity.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
], | ||
}, | ||
242: { | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: 0x0061, | ||
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], | ||
}, | ||
}, | ||
} | ||
|
||
device_automation_triggers = INOVELLI_AUTOMATION_TRIGGERS | ||
|
||
|
||
class InovelliVZM30SNv2(CustomDevice): | ||
"""VZM30-SN mmWave Dimmer Switch.""" | ||
|
||
signature = { | ||
MODELS_INFO: [("Inovelli", "VZM30-SN")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.ON_OFF_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
Diagnostic.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
WWAH_CLUSTER_ID, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
], | ||
}, | ||
3: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
INOVELLI_VZM30SN_CLUSTER_ID, | ||
], | ||
}, | ||
4: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: 0x0302, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
RelativeHumidity.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
], | ||
}, | ||
242: { | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: 0x0061, | ||
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
Diagnostic.cluster_id, | ||
InovelliVZM30SNCluster, | ||
WWAH_CLUSTER_ID, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Ota.cluster_id, | ||
], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
InovelliVZM30SNCluster, | ||
], | ||
}, | ||
3: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: DeviceType.DIMMER_SWITCH, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
InovelliVZM30SNCluster, | ||
], | ||
}, | ||
4: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: 0x0302, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
RelativeHumidity.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Identify.cluster_id, | ||
], | ||
}, | ||
242: { | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: 0x0061, | ||
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], | ||
}, | ||
}, | ||
} | ||
|
||
device_automation_triggers = INOVELLI_AUTOMATION_TRIGGERS |
Oops, something went wrong.