I think I need to create a ‘quirk’ for my device but I’m not having any luck with that.
In my ‘configuration.yaml’ file I have
zha:
enable_quirks: true
custom_quirks_path: /config/custom_zha_quirks/
database_path: /config/zigbee.db
In the ‘custom_zha_quirks’ folder I’ve created a file called 'weather2_quirk.py" that contains:
""" Custom quirk for the ConMac Weather2 zigbee device"""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zhaquirks.const import
{
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
OUTPUT_CLUSTERS,
PROFILE_ID,
}
from zigpy.zcl.clusters.general import
{
AnalogInput,
AnalogOutput,
Basic,
OnOff,
}
class ConMacWeather2( CustomDevice):
def __init__(self. *args, **kwargs):
"""Init,"""
super().__init__(*args, **kwargs)
signature = {
MODELS_INFO: [("Weather2", "manuforte.org")],
ENDPOINTS: {
# < SimpleDescriptor endpoint=2 profile=0x0104 device_type=0xfff0
# device_version=1
# input_clusters=[0,12]
# output_clusters=[13]>
2: {
PROFILE_ID: 0x0104,
DEVICE_TYPE: 0xfff0,
INPUT_CLUSTERS: [
Basic.cluster_id,
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [
AnalogOutput.cluster_id,
],
},
},
}
replacement = {
SKIP_CONFIGURATION: True,
ENDPOINTS: {
2: {
PROFILE_ID: 0x0104,
DEVICE_TYPE: 0xfff0,
INPUT_CLUSTERS: [
BasicCluster,
OnOff.cluster_id,
AnalogInput.cluster_id,
],
OUTPUT_CLUSTERS: [
AnalogOutput.cluster_id,
],
},
"manufacturer": "ConMac",
}
When I try to connect my device to ZHA, in the log I get:
[0x787c] Read model 'Weather2' and manufacturer 'ConMac' from <Endpoint id=2 in=[basic:0x0000, analog_input:0x000C] out=[analog_output:0x000D] status=<Status.ZDO_INIT: 1>>
[0x787c] Discovered basic device information for <Device model='Weather2' manuf='ConMac' nwk=0x787C ieee=xx:xx:xx:xx:xx:xx is_initialized=True>
Device is initialized <Device model='Weather2' manuf='ConMac' nwk=0x787C ieee=xx:xx:xx:xx:xx:xx is_initialized=True>
Checking quirks for ConMac Weather2 (xx:xx:xx:xx:xx:xx)
Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace2'>
Fail because endpoint list mismatch: {1, 2, 242} {2}
Considering <class 'zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1'>
Fail because endpoint list mismatch: {1, 2, 41, 42, 242, 51, 21, 31} {2}
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {2}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {2}
Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because endpoint list mismatch: {1} {2}
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {2}
Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'>
Creating cluster handler for cluster id: 12 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.AnalogInput'>
Discovering entities for endpoint: 48:31:b7:ff:fe:c0:71:27-2
'sensor' component -> 'RSSISensor' using ['basic']
'sensor' component -> 'LQISensor' using ['basic']
which seems to totally ignore my quirk.
After the device has connected to ZHA, the signature is:
{
"node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.MainsPowered|RxOnWhenIdle|AllocateAddress: 140>, manufacturer_code=4660, maximum_buffer_size=108, maximum_incoming_transfer_size=0, server_mask=11264, maximum_outgoing_transfer_size=0, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=False, *is_security_capable=False)",
"endpoints": {
"2": {
"profile_id": "0x0104",
"device_type": "0xfff0",
"input_clusters": [
"0x0000",
"0x000c"
],
"output_clusters": [
"0x000d"
]
}
},
"manufacturer": "ConMac",
"model": "Weather2",
"class": "zigpy.device.Device"
}
What have I done wrong? What am I missing?
Susan