Zha Quirks

I wonder if anyone can help as I have been trying to get this to work for two days without luck!

I bought three Avatto tuya TS0601 _TZE284_o3x45p96 TRV valves for my radiators. These were easy to pair with ZHA but there were no entities. Reading online it became apparent that I needed a ‘quirk’ to enable the entities to be read.
First I added the zha code to the configuration.yaml

zha:
  database_path: /config/zigbee.db 
  enable_quirks: true
  custom_quirks_path: /config/custom_zha_quirks

I created the folder ‘custom_zha_quirks’ in my homeassistant folder.

For the quirk I have found this quirk which is for TRV’s zha-device-handlers/zhaquirks/tuya/ts0601_trv.py at 0a0f6676d870b29ba704e43aeb08e208c086038c · zigpy/zha-device-handlers · GitHub

and added my value on line 575
(“_TZE284_o3x45p96”, “TS0601”),

However after restarting countless time (full and quick) deleting and adding the devices again and every other permutation of this, the quirk does not show up for this device!

The Home Assistant log shows the quirk folder has been read by HA, so this would point to an issue with the quirk?

Loaded custom quirks. Please contribute them to https://github.com/zigpy/zha-device-handlers

Is anyone able to help?

Regards
James

2 Likes

V1 quirks match on the device signature, post the diagnostics from your device with the signature.

Same. I think Avatto started shipping the devices out with this particular manufacturer code recently. Haven’t been able to make the entities appear yet. Following the threads below:

Hi,
I found those Github threads this morning.

The log for one device is

2024-11-27 21:10:13.911 DEBUG (MainThread) [zigpy.application] Device is initialized <Device model='TS0601' manuf='_TZE284_o3x45p96' nwk=0x20D9 ieee=a4:c1:38:a6:75:6d:4b:bd is_initialized=True>
2024-11-27 21:10:13.912 DEBUG (MainThread) [zha] Emitting event raw_device_initialized with data RawDeviceInitializedEvent(device_info=RawDeviceInitializedDeviceInfo(ieee=a4:c1:38:a6:75:6d:4b:bd, nwk=0x20D9, pairing_status=<DevicePairingStatus.INTERVIEW_COMPLETE: 2>, model='TS0601', manufacturer='_TZE284_o3x45p96', signature={'manufacturer': '_TZE284_o3x45p96', 'model': 'TS0601', 'node_desc': {'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.AllocateAddress: 128>, '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>}, 'endpoints': {1: {'profile_id': 260, 'device_type': <DeviceType.SMART_PLUG: 81>, 'input_clusters': [4, 5, 61184, 0, 60672], 'output_clusters': [25, 10]}}}), event_type='zha_gateway_message', event='raw_device_initialized') (1 listeners)
2024-11-27 21:10:13.913 DEBUG (MainThread) [zha] (ZHAGatewayProxy) handling event protocol for event: RawDeviceInitializedEvent(device_info=RawDeviceInitializedDeviceInfo(ieee=a4:c1:38:a6:75:6d:4b:bd, nwk=0x20D9, pairing_status=<DevicePairingStatus.INTERVIEW_COMPLETE: 2>, model='TS0601', manufacturer='_TZE284_o3x45p96', signature={'manufacturer': '_TZE284_o3x45p96', 'model': 'TS0601', 'node_desc': {'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.AllocateAddress: 128>, '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>}, 'endpoints': {1: {'profile_id': 260, 'device_type': <DeviceType.SMART_PLUG: 81>, 'input_clusters': [4, 5, 61184, 0, 60672], 'output_clusters': [25, 10]}}}), event_type='zha_gateway_message', event='raw_device_initialized')
2024-11-27 21:10:13.913 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE284_o3x45p96 TS0601 (a4:c1:38:a6:75:6d:4b:bd)
2024-11-27 21:10:13.920 DEBUG (MainThread) [zha.application.discovery] Discovering entities for endpoint: a4:c1:38:a6:75:6d:4b:bd-1
2024-11-27 21:10:13.924 DEBUG (MainThread) [zha.application.discovery] Discovering entities for device: a4:c1:38:a6:75:6d:4b:bd-_TZE284_o3x45p96 TS0601
2024-11-27 21:10:13.924 DEBUG (MainThread) [zha.application.discovery] Attempting to discover quirks v2 entities for device: a4:c1:38:a6:75:6d:4b:bd-_TZE284_o3x45p96 TS0601
2024-11-27 21:10:13.924 DEBUG (MainThread) [zha.application.discovery] Device: a4:c1:38:a6:75:6d:4b:bd-_TZE284_o3x45p96 TS0601 is not a quirks v2 device - skipping discover_quirks_v2_entities
2024-11-27 21:10:13.925 DEBUG (MainThread) [zha.application.gateway] device - 0x20D9:a4:c1:38:a6:75:6d:4b:bd entering async_device_initialized - is_new_join: True
2024-11-27 21:10:13.925 DEBUG (MainThread) [zha.application.gateway] device - 0x20D9:a4:c1:38:a6:75:6d:4b:bd has joined the ZHA zigbee network
2024-11-27 21:10:13.927 DEBUG (MainThread) [zha] Emitting event zha_channel_configure_reporting with data ClusterConfigureReportingEvent(cluster_name='Basic', cluster_id=0, attributes={}, cluster_handler_unique_id='a4:c1:38:a6:75:6d:4b:bd:1:0x0000', event_type='zha_channel_message', event='zha_channel_configure_reporting') (0 listeners)
2024-11-27 21:10:13.935 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:a6:75:6d:4b:bd, 1, <ClusterType.Server: 0>, 0, 4, '_TZE284_o3x45p96', datetime.datetime(2024, 11, 27, 21, 10, 13, 910586, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed
2024-11-27 21:10:13.937 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:a6:75:6d:4b:bd, 1, <ClusterType.Server: 0>, 0, 5, 'TS0601', datetime.datetime(2024, 11, 27, 21, 10, 13, 910667, tzinfo=datetime.timezone.utc)) params: FOREIGN KEY constraint failed
2024-11-27 21:10:14.256 DEBUG (MainThread) [zha] Emitting event zha_channel_bind with data ClusterBindEvent(cluster_name='Cluster', cluster_id=61184, success=True, cluster_handler_unique_id='a4:c1:38:a6:75:6d:4b:bd:1:0xef00', event_type='zha_channel_message', event='zha_channel_bind') (0 listeners)
2024-11-27 21:10:14.257 DEBUG (MainThread) [zha] Emitting event zha_channel_configure_reporting with data ClusterConfigureReportingEvent(cluster_name='Cluster', cluster_id=61184, attributes={}, cluster_handler_unique_id='a4:c1:38:a6:75:6d:4b:bd:1:0xef00', event_type='zha_channel_message', event='zha_channel_configure_reporting') (0 listeners)
2024-11-27 21:10:14.273 DEBUG (MainThread) [zha] Emitting event zha_channel_cfg_done with data ClusterHandlerConfigurationComplete(device_ieee=a4:c1:38:a6:75:6d:4b:bd, unique_id=a4:c1:38:a6:75:6d:4b:bd, event_type='zha_channel_message', event='zha_channel_cfg_done') (0 listeners)
{
  "node_descriptor": {
    "logical_type": 2,
    "complex_descriptor_available": 0,
    "user_descriptor_available": 0,
    "reserved": 0,
    "aps_flags": 0,
    "frequency_band": 8,
    "mac_capability_flags": 128,
    "manufacturer_code": 4417,
    "maximum_buffer_size": 66,
    "maximum_incoming_transfer_size": 66,
    "server_mask": 10752,
    "maximum_outgoing_transfer_size": 66,
    "descriptor_capability_field": 0
  },
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0051",
      "input_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xed00",
        "0xef00"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZE284_o3x45p96",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

Regards
James

1 Like

You have a extra input cluster that the quirk signature doesn’t match, the manufacturer, model and signature have to match.

1 Like

Thank you, I now understand the issue but it’s beyond my ability to workout how to fix it!
Regards

Hallo,
ich habe das gleiche Problem mit dem Thermostat. Dieser wird zwar nach vielen verbindungsversuchen mittlerweile von Z2M erkannt, sendet aber keine Daten.

I am not sure if this model and signature are new to the market so there isn’t much online about them or if they are just not popular, whatever I can find very little about them.
I am following both Github threads.

Regards

1 Like