Skip to content

Instantly share code, notes, and snippets.

@mdeweerd
Created December 4, 2022 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdeweerd/f4649f4746404b26533aae90e4f8328c to your computer and use it in GitHub Desktop.
Save mdeweerd/f4649f4746404b26533aae90e4f8328c to your computer and use it in GitHub Desktop.
Local ZHA quirk for Lixee v12
# A ajouter au répertoire de quirks défini dans la configuration (configuration.yaml):
# zha:
# enable_quirks: true
# custom_quirks_path: /config/zha_quirks
from zhaquirks.lixee.zlinky import *
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Identify, Ota, PowerConfiguration
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement, MeterIdentification
from zigpy.zcl.clusters.manufacturer_specific import ManufacturerSpecificCluster
from zigpy.zcl.clusters.smartenergy import Metering
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.lixee import LIXEE, ZLINKY_MANUFACTURER_CLUSTER_ID
class MyZLinkyTIC(ZLinkyTIC):
"""Modified ZLinky_TIC from LiXee."""
signature = {
MODELS_INFO: [(LIXEE, "ZLinky_TIC")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.METER_INTERFACE,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
Identify.cluster_id,
Metering.cluster_id,
MeterIdentification.cluster_id,
ElectricalMeasurement.cluster_id,
ZLinkyTICManufacturerCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 0x0061,
INPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.METER_INTERFACE,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
Identify.cluster_id,
ZLinkyTICMetering,
MeterIdentification.cluster_id,
ElectricalMeasurement.cluster_id,
ZLinkyTICManufacturerCluster,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 0x0061,
INPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment