Quirk seemingly ignored despite MODELS_INFO matches ... why?

I just unboxed a CO monitor which is recognized as

TS0601
by _TZE200_7bztmfm1 

so I put the quirk that matches its signature (I believe)
ts0601_co.py
I have deleted and reconfigured the device several times adding it to my Zigbee (ConbeeII) and I never see the quirk being considered in Zigbee info.

I have previously added

zha:
  enable_quirks: true
  custom_quirks_path: /home/homeassistant/.homeassistant/custom/custom_zha_quirks/

and put the file in :~/.homeassistant/custom/custom_zha_quirks and I do even see that in the __pycache__ folder there is a corresponding ts0601_co.cpython-312.pyc. I am quite puzzled why the quirk is not recognized as valid …

I have another working quirk for a month now for a IR blaster ts1201.py so I am quite puzzled why this quirk does not work … what is not matching if the device is recognized as _TZE200_7bztmfm1 and _TZE200_7bztmfm1 is in the MODELS_INFO of the quirk ?

EDIT: I read others have a similar problem and it is sometimes related to the signature not being compatible. This is the signature of my device as from the diagnostics:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.FullFunctionDevice|MainsPowered|RxOnWhenIdle|AllocateAddress: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": "0xa1e0",
      "device_type": "0x0061",
      "input_clusters": [],
      "output_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE200_7bztmfm1",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

I figured how to see the logs. Quirks are attempted and indeed not found.

2024-08-05 16:07:00.286 DEBUG (MainThread) [zigpy.zcl] [0x26EC:1:0x0000] Received ZCL frame: b'\x18\x05\x01\x04\x00\x00B\x10_TZE200_7bztmfm1\x05\x00\x00B\x06TS0601'
2024-08-05 16:07:00.288 DEBUG (MainThread) [zigpy.zcl] [0x26EC:1:0x0000] Decoded ZCL frame header: ZCLHeader(frame_control=FrameControl<0x18>(frame_type=<FrameType.GLOBAL_COMMAND: 0>, is_manufacturer_specific=0, direction=<Direction.Server_to_Client: 1>, disable_default_response=1,
 reserved=0, *is_cluster=False, *is_general=True), tsn=5, command_id=1, *direction=<Direction.Server_to_Client: 1>)
2024-08-05 16:07:00.293 DEBUG (MainThread) [zigpy.zcl] [0x26EC:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0004, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='_TZE200_7bztmfm1')), ReadAttributeRecord
(attrid=0x0005, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='TS0601'))])
2024-08-05 16:07:00.297 INFO (MainThread) [zigpy.device] [0x26ec] Read model 'TS0601' and manufacturer '_TZE200_7bztmfm1' from <Endpoint id=1 in=[groups:0x0004, scenes:0x0005, None:0xEF00, basic:0x0000] out=[ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>>
2024-08-05 16:07:00.298 INFO (MainThread) [zigpy.device] [0x26ec] Discovered basic device information for <Device model='TS0601' manuf='_TZE200_7bztmfm1' nwk=0x26EC ieee=a4:c1:38:f2:10:0f:34:bd is_initialized=True>
2024-08-05 16:07:00.299 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='TS0601' manuf='_TZE200_7bztmfm1' nwk=0x26EC ieee=a4:c1:38:f2:10:0f:34:bd is_initialized=True>
2024-08-05 16:07:00.308 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_7bztmfm1 TS0601 (a4:c1:38:f2:10:0f:34:bd)
2024-08-05 16:07:00.309 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts0601_co.TuyaCOSensor'>
2024-08-05 16:07:00.309 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {1} {1, 242}
2024-08-05 16:07:00.310 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
2024-08-05 16:07:00.310 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {232, 230} {1, 242}
2024-08-05 16:07:00.310 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
2024-08-05 16:07:00.311 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {232, 230} {1, 242}
2024-08-05 16:07:00.311 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'>
2024-08-05 16:07:00.312 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {1} {1, 242}
2024-08-05 16:07:00.312 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
2024-08-05 16:07:00.313 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {1} {1, 242}
2024-08-05 16:07:00.314 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
2024-08-05 16:07:00.314 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {1} {1, 242}
2024-08-05 16:07:00.315 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
2024-08-05 16:07:00.315 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {1} {1, 242}
2024-08-05 16:07:00.316 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
2024-08-05 16:07:00.316 DEBUG (MainThread) [zigpy.quirks] Fail because endpoint list mismatch: {11, 13} {1, 242}
2024-08-05 16:07:00.317 DEBUG (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 4 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.GroupsClusterHandler'>
2024-08-05 16:07:00.318 DEBUG (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 5 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.ScenesClusterHandler'>
2024-08-05 16:07:00.319 DEBUG (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 61184 class: <class 'homeassistant.components.zha.core.cluster_handlers.manufacturerspecific.TuyaClusterHandler'>
2024-08-05 16:07:00.320 DEBUG (MainThread) [homeassistant.components.zha.core.endpoint] Creating cluster handler for cluster id: 0 class: <class 'homeassistant.components.zha.core.cluster_handlers.general.BasicClusterHandler'>
2024-08-05 16:07:00.321 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: a4:c1:38:f2:10:0f:34:bd-1
2024-08-05 16:07:00.330 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' platform -> 'RSSISensor' using ['basic']
2024-08-05 16:07:00.330 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'sensor' platform -> 'LQISensor' using ['basic']
2024-08-05 16:07:00.349 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] 'update' platform -> 'ZHAFirmwareUpdateEntity' using ['ota']
2024-08-05 16:07:00.350 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for endpoint: a4:c1:38:f2:10:0f:34:bd-242
2024-08-05 16:07:00.376 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x26EC](TS0601): starting availability checks - interval: 67
2024-08-05 16:07:00.377 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Discovering entities for device: a4:c1:38:f2:10:0f:34:bd-_TZE200_7bztmfm1 TS0601
2024-08-05 16:07:00.378 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Attempting to discover quirks v2 entities for device: a4:c1:38:f2:10:0f:34:bd-_TZE200_7bztmfm1 TS0601
2024-08-05 16:07:00.378 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Attempting to discover quirks v2 entities for device: a4:c1:38:f2:10:0f:34:bd-_TZE200_7bztmfm1 TS0601
2024-08-05 16:07:00.378 DEBUG (MainThread) [homeassistant.components.zha.core.discovery] Device: a4:c1:38:f2:10:0f:34:bd-_TZE200_7bztmfm1 TS0601 is not a quirks v2 device - skipping discover_quirks_v2_entities
2024-08-05 16:07:00.387 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x26EC:a4:c1:38:f2:10:0f:34:bd entering async_device_initialized - is_new_join: True
2024-08-05 16:07:00.387 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0x26EC:a4:c1:38:f2:10:0f:34:bd has joined the ZHA zigbee network
2024-08-05 16:07:00.389 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x26EC](TS0601): started configuration
2024-08-05 16:07:00.390 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:ZDO](TS0601): 'async_configure' stage succeeded
2024-08-05 16:07:00.392 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0ec6000700a600
2024-08-05 16:07:00.393 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.device_state_changed{'status': <Status.SUCCESS: 0>, 'frame_length': 7, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_CONFIRM|
APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE|32: 41>), 'reserved': 0} (seq 198)
2024-08-05 16:07:00.394 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0000]: Configuring cluster attribute reporting
2024-08-05 16:07:00.395 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0000]: finished cluster handler configuration
2024-08-05 16:07:00.396 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0xef00]: Performing cluster binding
2024-08-05 16:07:00.400 DEBUG (MainThread) [zigpy_deconz.zigbee.application] Sending packet: ZigbeePacket(timestamp=datetime.datetime(2024, 8, 5, 14, 7, 0, 399952, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), src_ep=0, dst=AddrMod
eAddress(addr_mode=<AddrMode.NWK: 2>, address=0x26EC), dst_ep=0, source_route=None, extended_timeout=False, tsn=6, profile_id=0, cluster_id=<ZDOCmd.Bind_req: 0x0021>, data=Serialized[b'\x06\xbd4\x0f\x10\xf28\xc1\xa4\x01\x00\xef\x03f\xc4\x07\xff\xff.!\x00\x01'], tx_options=<Transmit
Options.NONE: 0>, radius=0, non_member_radius=0, lqi=None, rssi=None)
2024-08-05 16:07:00.402 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.aps_data_request{'request_id': 128, 'flags': <DeconzSendDataFlags.NONE: 0>, 'dst': DeconzAddressEndpoint(address_mode=<AddressMode.NWK: 2>, address=0x26EC, endpoint=0), 'profile_id': 0, 'cluster_id': <Z
DOCmd.Bind_req: 0x0021>, 'src_ep': 0, 'asdu': b'\x06\xbd4\x0f\x10\xf28\xc1\xa4\x01\x00\xef\x03f\xc4\x07\xff\xff.!\x00\x01', 'tx_options': <DeconzTransmitOptions.USE_NWK_KEY_SECURITY: 2>, 'radius': 0, 'relays': None} (seq=198)
2024-08-05 16:07:00.403 DEBUG (MainThread) [zigpy_deconz.uart] Send: 12c6002c002500800002ec26000000210000160006bd340f10f238c1a40100ef0366c407ffff2e2100010200
2024-08-05 16:07:00.404 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0019]: finished cluster handler configuration
2024-08-05 16:07:00.405 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0019]: finished cluster handler configuration
2024-08-05 16:07:00.409 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x12c600090002002680
2024-08-05 16:07:00.410 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.aps_data_request{'status': <Status.SUCCESS: 0>, 'frame_length': 9, 'payload_length': 2, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.AP
SDE_DATA_CONFIRM|APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE: 9>), 'request_id': 128} (seq 198)
2024-08-05 16:07:00.413 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:f2:10:0f:34:bd, 1, <ClusterType.Server: 0>, 0, 4, '_TZE200_7bztmfm1', datetime.datetime(2024, 8, 5, 14, 7, 0, 296859, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY co
nstraint failed
2024-08-05 16:07:00.415 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.aps_data_confirm{} (seq=199)
2024-08-05 16:07:00.416 DEBUG (MainThread) [zigpy_deconz.uart] Send: 04c70007000000
2024-08-05 16:07:00.420 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:f2:10:0f:34:bd, 1, <ClusterType.Server: 0>, 0, 5, 'TS0601', datetime.datetime(2024, 8, 5, 14, 7, 0, 296994, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint f
ailed
2024-08-05 16:07:00.422 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0ec7000700a600
2024-08-05 16:07:00.424 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.device_state_changed{'status': <Status.SUCCESS: 0>, 'frame_length': 7, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_CONFIRM|APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE|32: 41>), 'reserved': 0} (seq 199)
2024-08-05 16:07:00.424 DEBUG (MainThread) [zigpy_deconz.api] Mismatched response, triggering error in 0.50s
2024-08-05 16:07:00.425 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x04c70013000c00267802fb1e01010000000000
2024-08-05 16:07:00.427 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.aps_data_confirm{'status': <Status.SUCCESS: 0>, 'frame_length': 19, 'payload_length': 12, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_CONFIRM|APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE: 9>), 'request_id': 120, 'dst_addr': DeconzAddressEndpoint(address_mode=<AddressMode.NWK: 2>, address=0x1EFB, endpoint=1), 'src_ep': 1, 'confirm_status': <TXStatus.SUCCESS: 0>, 'reserved1': 0, 'reserved2': 0, 'reserved3': 0, 'reserved4': 0} (seq 199)
2024-08-05 16:07:00.429 DEBUG (MainThread) [zigpy_deconz.api] Clearing existing mismatched response timer
2024-08-05 16:07:00.430 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.aps_data_confirm{} (seq=200)
2024-08-05 16:07:00.430 DEBUG (MainThread) [zigpy_deconz.uart] Send: 04c80007000000
2024-08-05 16:07:00.435 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x04c80013000c00228002ec2600000000000000
2024-08-05 16:07:00.437 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.aps_data_confirm{'status': <Status.SUCCESS: 0>, 'frame_length': 19, 'payload_length': 12, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE: 8>), 'request_id': 128, 'dst_addr': DeconzAddressEndpoint(address_mode=<AddressMode.NWK: 2>, address=0x26EC, endpoint=0), 'src_ep': 0, 'confirm_status': <TXStatus.SUCCESS: 0>, 'reserved1': 0, 'reserved2': 0, 'reserved3': 0, 'reserved4': 0} (seq 200)
2024-08-05 16:07:00.454 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0ec9000700aa00
2024-08-05 16:07:00.456 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.device_state_changed{'status': <Status.SUCCESS: 0>, 'frame_length': 7, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_INDICATION|APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE|32: 42>), 'reserved': 0} (seq 201)
2024-08-05 16:07:00.457 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.aps_data_indication{'flags': <DataIndicationFlags.Always_Use_NWK_Source_Addr: 1>} (seq=201)
2024-08-05 16:07:00.458 DEBUG (MainThread) [zigpy_deconz.uart] Send: 17c9000800010001
2024-08-05 16:07:00.461 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x17c90020001900220200000002ec2600000021800200060000afff849cb700c2
2024-08-05 16:07:00.463 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.aps_data_indication{'status': <Status.SUCCESS: 0>, 'frame_length': 32, 'payload_length': 25, 'device_state': DeviceState(network_state=<NetworkState2.CONNECTED: 2>, device_state=<DeviceStateFlags.APSDE_DATA_REQUEST_FREE_SLOTS_AVAILABLE: 8>), 'dst_addr': DeconzAddress(address_mode=<AddressMode.NWK: 2>, address=0x0000), 'dst_ep': 0, 'src_addr': DeconzAddress(address_mode=<AddressMode.NWK: 2>, address=0x26EC), 'src_ep': 0, 'profile_id': 0, 'cluster_id': 32801, 'asdu': b'\x06\x00', 'reserved1': 0, 'reserved2': 175, 'lqi': 255, 'reserved3': 132, 'reserved4': 156, 'reserved5': 183, 'reserved6': 0, 'rssi': -62} (seq 201)
2024-08-05 16:07:00.466 DEBUG (MainThread) [zigpy.application] Received a packet: ZigbeePacket(timestamp=datetime.datetime(2024, 8, 5, 14, 7, 0, 466228, tzinfo=datetime.timezone.utc), src=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x26EC), src_ep=0, dst=AddrModeAddress(addr_mode=<AddrMode.NWK: 2>, address=0x0000), dst_ep=0, source_route=None, extended_timeout=False, tsn=None, profile_id=0, cluster_id=32801, data=Serialized[b'\x06\x00'], tx_options=<TransmitOptions.NONE: 0>, radius=0, non_member_radius=0, lqi=255, rssi=-62)
2024-08-05 16:07:00.469 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0xef00]: bound 'None' cluster: Status.SUCCESS
2024-08-05 16:07:00.469 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0xef00]: Configuring cluster attribute reporting
2024-08-05 16:07:00.470 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0xef00]: finished cluster handler configuration
2024-08-05 16:07:00.474 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0000]: 'async_configure' stage succeeded
2024-08-05 16:07:00.475 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0xef00]: 'async_configure' stage succeeded
2024-08-05 16:07:00.476 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0019]: 'async_configure' stage succeeded
2024-08-05 16:07:00.477 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0019]: 'async_configure' stage succeeded
2024-08-05 16:07:00.478 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x26EC](TS0601): completed configuration
2024-08-05 16:07:00.479 DEBUG (MainThread) [homeassistant.components.zha.core.device] [0x26EC](TS0601): started initialization
2024-08-05 16:07:00.480 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:ZDO](TS0601): 'async_initialize' stage succeeded
2024-08-05 16:07:00.480 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0000]: initializing cluster handler: from_cache: False
2024-08-05 16:07:00.481 DEBUG (MainThread) [homeassistant.components.zha.core.cluster_handlers] [0x26EC:1:0x0000]: finished cluster handler initialization

MODELS_INFO is not enough for a quirk to match a device.
The endpoint definitions must also match before the quirk will be adopted by a device.

As you have said, if the signature does not match in full, it won’t work.
I suggest you need to find a revised quirk, as even if you do get the right signature match, it doesn’t mean the rest of the quirk will work (although it might).

EDIT, re-reading your post, I think your issue might be the path to your custom quirks folder. this is mine:-

zha:
  custom_quirks_path: /config/custom_zha_quirks/

Thanks for chiming in. I am puzzled by this being potentially an issue. I think there is evidence it is not,. In fact other quirks are loaded fine. For instance the one for a IR blaster.

The __pycache__ gets populated with the pyc files so I’d say these quirk python files are compiled by something …

In any case, I have changed the path to /config/custom_zha_quirks/ and it does not even start on my system

Aug 05 18:46:45 downpi hass[6727]: 2024-08-05 18:46:45.655 ERROR (MainThread) [homeassistant.config] Invalid config for 'zha' at configuration.yaml, line 198: not a directory for dictionary value 'zha->custom_quirks_path', got '/custom/custom_zha_quirks/', please check the docs at>

You have a typo in your path. You put in custom/custom_zha_quirks instead of config/custom_zha_quirks

I am using a subfolder named custom why should I write config in my YAML?

$ tree -L 1 .
.
├── automations.yaml
├── blueprints
├── configuration.yaml
├── custom
├── customize.yaml
├── deps
├── fridge_H.csv
├── fridge_T.csv
├── fridge_T_H.csv
├── groups.yaml
├── home-assistant.log
├── home-assistant.log.1
├── home-assistant.log.fault
├── home-assistant_v2.db
├── home-assistant_v2.db-shm
├── home-assistant_v2.db-wal
├── python_scripts
├── scenes.yaml
├── scripts.yaml
├── secrets.yaml
├── tts
├── zigbee.db
├── zigbee.db-shm
└── zigbee.db-wal

In any case, I tried it and still gives the same error

Aug 05 23:05:44 downpi hass[23010]: 2024-08-05 23:05:44.072 ERROR (MainThread) [homeassistant.setup] Setup failed for 'zha': Invalid config.```

FYI I have also tried making a new folder config but using that kind of relative-like path it does not work.

Invalid config for 'zha' at configuration.yaml, line 198: not a directory for dictionary value 'zha->custom_quirks_path', got '/config/custom_zha_quirks/', please check the doc
~/.homeassistant $ tree -L 2 .
.
├── automations.yaml
├── blueprints
│   ├── automation
│   └── script
├── config
│   └── custom_zha_quirks
├── configuration.yaml
├── custom
│   └── custom_zha_quirks
├── customize.yaml
├── deps
├── fridge_H.csv
├── fridge_T.csv
├── fridge_T_H.csv
├── groups.yaml
├── home-assistant.log
├── home-assistant.log.1
├── home-assistant.log.fault
├── home-assistant_v2.db
├── home-assistant_v2.db-shm
├── home-assistant_v2.db-wal
├── python_scripts
│   └── hello_world.py
├── scenes.yaml
├── scripts.yaml
├── secrets.yaml
├── tts
├── zigbee.db
├── zigbee.db-shm
└── zigbee.db-wal

10 directories, 20 files

If I insist on giving the full path works again in this new config folder. Maybe it matters that I launch homeassistant as a service which effectively gives the command

/srv/homeassistant/bin/python3.12 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant that uses full absolute paths throughout?

I get your point about other quirks loading, its just the path looked odd to me.
I’m not sure if there is anything inside HA that means it has to be a subfolder of the config folder, but given you are loading other quirks, I guess not.

All I can say then is that the endpoints must be different. Have you tried getting yours out of your ZHA diagnostic file ?

That might give you some clues as to whats missing/changed.

The signature I posted originally comes from the diagnostics I obtained as you shown. I had not mentioned it, but that’s where it comes from.

For full disclosure I tried to fake the signatures in a new quirk, but HA did not eat the bait … maybe I have to get deeper.

The json of my device for “endpoints” has two keys. “endpoints”[1] and “endpoints”[242]. The one in the quirk ts0601_co.py (which has the same MODELS_INFO: [("_TZE200_7bztmfm1", "TS0601")]) has a different “shape”, as it has one “endpoints”[1] and posses a “output_clusters”, which is not there in my device diagnostics.
That said I am clueless as of what to get a quirk of the right “shape” …

I’m still very much an amateur in these things, but the next place I would look is here:-

PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,

I’d change these in the quirk to this:-

PROFILE_ID:  0x0104,
DEVICE_TYPE: 0x0051,

Its possible 0x0051 doesn’t map to zha.DeviceType.SMART_PLUG