Skip to content

[Device Support Request] TUYA Smoke _TZE284_rccxox8p #3610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
netdrg opened this issue Dec 13, 2024 · 23 comments · Fixed by #3646
Closed

[Device Support Request] TUYA Smoke _TZE284_rccxox8p #3610

netdrg opened this issue Dec 13, 2024 · 23 comments · Fixed by #3646

Comments

@netdrg
Copy link

netdrg commented Dec 13, 2024

Problem description

Hello,
I bought some Tuya TS601 _TZE284_rccxox8p they are able to pair with ZHA, but no entities just firmware. The Tuya model is same TS601 _TZE200_rccxox8p.
Is it possible for someone to create the quirk? I am not really able to :-(

Thank you!

Solution description

To support the device :-)

Screenshots/Video

Screenshots/Video

[Paste/upload your media here]

Device signature

Device signature
{
  "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_rccxox8p",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

Diagnostic information

Diagnostic information
[Paste the diagnostic information here]

Logs

Logs
[Paste the logs here]

Custom quirk

Custom quirk
[Paste your custom quirk here]

Additional information

No response

@baldisos
Copy link

Same problem here.

Some further Informations:

Nwk: 0xa9ce
{
  "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_rccxox8p",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

@prairiesnpr
Copy link
Collaborator

This is likely the same as the other Tuya smoke detectors. They all seem to use DP 1, if it's functional we can update the existing quirk.

from zhaquirks.tuya.builder import TuyaQuirkBuilder
from zhaquirks.tuya import TuyaLocalCluster
from zigpy.zcl.clusters.security import IasZone


class TuyaIasFire(IasZone, TuyaLocalCluster):
    """Tuya local IAS smoke/fire cluster."""

    _CONSTANT_ATTRIBUTES = {
        IasZone.AttributeDefs.zone_type.id: IasZone.ZoneType.Fire_Sensor
    }

(
    TuyaQuirkBuilder("_TZE284_rccxox8p", "TS0601")
    .tuya_dp(
        dp_id=1,
        TuyaIasFire.ep_attribute,
        IasZone.AttributeDefs.zone_status.name,
        converter=lambda x: IasZone.ZoneStatus.Alarm_1 if x == 0 else 0,
    )
    .adds(TuyaIasFire)
    .skip_configuration()
    .add_to_registry()
)

@baldisos
Copy link

Can you give me a hint on how to test if this works?

@prairiesnpr
Copy link
Collaborator

Can you give me a hint on how to test if this works?

You need to enable custom quirks, see the ZHA documentation. Once enabled, place that code snippet in a file located in the directory configuted as the custom quirk directory, name it tuya_TZE284_rccxox8p.py then restart HA. I think there are some forum posts that have more detail on setting up custom quirks also.

@baldisos
Copy link

Okay, i tried that. But i still don't see any Alarm Entitiy.
Is there a way to see if that Quirk was applied?

I can only see this in the logs:

[0xEB85:1:0x0000] Received ZCL frame: b'\x18\x06\x01\x04\x00\x00B\x10_TZE284_rccxox8p\x05\x00\x00B\x06TS0601'
[0xEB85: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=6, command_id=1, *direction=<Direction.Server_to_Client: 1>)
[0xEB85:1:0x0000] Decoded ZCL frame: Basic:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=4, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='_TZE284_rccxox8p')), ReadAttributeRecord(attrid=5, status=<Status.SUCCESS: 0>, value=TypeValue(type=CharacterString, value='TS0601'))])
[0xeb85] Read model 'TS0601' and manufacturer '_TZE284_rccxox8p' from <Endpoint id=1 in=[groups:0x0004, scenes:0x0005, None:0xEF00, basic:0x0000, None:0xED00] out=[ota:0x0019, time:0x000A] status=<Status.ZDO_INIT: 1>>
[0xeb85] Discovered basic device information for <Device model='TS0601' manuf='_TZE284_rccxox8p' nwk=0xEB85 ieee=a4:c1:38:f0:2a:64:19:b5 is_initialized=True>
Device is initialized <Device model='TS0601' manuf='_TZE284_rccxox8p' nwk=0xEB85 ieee=a4:c1:38:f0:2a:64:19:b5 is_initialized=True>
Emitting event raw_device_initialized with data RawDeviceInitializedEvent(device_info=RawDeviceInitializedDeviceInfo(ieee=a4:c1:38:f0:2a:64:19:b5, nwk=0xEB85, pairing_status=<DevicePairingStatus.INTERVIEW_COMPLETE: 2>, model='TS0601', manufacturer='_TZE284_rccxox8p', signature={'manufacturer': '_TZE284_rccxox8p', '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)
(ZHAGatewayProxy) handling event protocol for event: RawDeviceInitializedEvent(device_info=RawDeviceInitializedDeviceInfo(ieee=a4:c1:38:f0:2a:64:19:b5, nwk=0xEB85, pairing_status=<DevicePairingStatus.INTERVIEW_COMPLETE: 2>, model='TS0601', manufacturer='_TZE284_rccxox8p', signature={'manufacturer': '_TZE284_rccxox8p', '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')
Checking quirks for _TZE284_rccxox8p TS0601 (a4:c1:38:f0:2a:64:19:b5)
Considering <class 'zhaquirks.xbee.xbee_io.XBeeSensor'>
Fail because endpoint list mismatch: {232, 230} {1}
Considering <class 'zhaquirks.xbee.xbee3_io.XBee3Sensor'>
Fail because endpoint list mismatch: {232, 230} {1}
Considering <class 'zhaquirks.tuya.ts0201.MoesTemperatureHumidtySensorWithScreen'>
Fail because device_type mismatch on at least one endpoint
Considering <class 'zhaquirks.smartthings.tag_v4.SmartThingsTagV4'>
Fail because device_type mismatch on at least one endpoint
Considering <class 'zhaquirks.smartthings.multi.SmartthingsMultiPurposeSensor'>
Fail because device_type mismatch on at least one endpoint
Considering <class 'zhaquirks.netvox.z308e3ed.Z308E3ED'>
Fail because device_type mismatch on at least one endpoint
Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
Fail because endpoint list mismatch: {11, 13} {1}
Creating cluster handler for cluster id: 4 class: <class 'zha.zigbee.cluster_handlers.general.GroupsClusterHandler'>
Creating cluster handler for cluster id: 5 class: <class 'zha.zigbee.cluster_handlers.general.ScenesClusterHandler'>
Creating cluster handler for cluster id: 61184 class: <class 'zha.zigbee.cluster_handlers.manufacturerspecific.TuyaClusterHandler'>
Creating cluster handler for cluster id: 0 class: <class 'zha.zigbee.cluster_handlers.general.BasicClusterHandler'>
Creating cluster handler for cluster id: 60672 class: <class 'zha.zigbee.cluster_handlers.ClusterHandler'>
Discovering entities for endpoint: a4:c1:38:f0:2a:64:19:b5-1
'sensor' platform -> 'RSSISensor' using ['basic']
'sensor' platform -> 'LQISensor' using ['basic']
'update' platform -> 'FirmwareUpdateEntity' using ['ota']
Discovering entities for device: a4:c1:38:f0:2a:64:19:b5-_TZE284_rccxox8p TS0601
Attempting to discover quirks v2 entities for device: a4:c1:38:f0:2a:64:19:b5-_TZE284_rccxox8p TS0601
Device: a4:c1:38:f0:2a:64:19:b5-_TZE284_rccxox8p TS0601 is not a quirks v2 device - skipping discover_quirks_v2_entities
device - 0xEB85:a4:c1:38:f0:2a:64:19:b5 entering async_device_initialized - is_new_join: True
device - 0xEB85:a4:c1:38:f0:2a:64:19:b5 has joined the ZHA zigbee network
[0xEB85](TS0601): Update device availability -  device available: True - new availability: True - changed: False

@prairiesnpr
Copy link
Collaborator

prairiesnpr commented Dec 27, 2024

Look at device info, should see the quirk applied. Should look like this.
image

Edit: From the logs, the quirk wasn't applied. Looks like it's not loading it.

@baldisos
Copy link

Nope, nothing there.
grafik

Just to confirm i did everything right, i put this in configuration.yaml:

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

Then in folder /config/zha_custom_quirks i put the file tuya_TZE284_rccxox8p.py with your content.

Looks right to me. I don't see why it's not loading the Quirk tho.

@prairiesnpr
Copy link
Collaborator

So that looks right to me, fair disclosure, I've never actually used custom quirks before, nor set them up, so bit of the blind leading the blind. You might try removing the trailing forward slash in the path.

@baldisos
Copy link

Nope, still nothing. Maybe it's something with the Quirk itself. I don't have the knowledge to go from here, so i just wait for more instructions in case anyone has a clue on this. 😄

@prairiesnpr
Copy link
Collaborator

Just to confirm, you are on the latest HA version?

@baldisos
Copy link

baldisos commented Dec 27, 2024

Yes.

I just got it to work with the help of Github Copilot.

The Quirk looks like this now:

from zhaquirks.tuya.builder import TuyaQuirkBuilder
from zhaquirks.tuya import TuyaLocalCluster
from zigpy.zcl.clusters.security import IasZone


class TuyaIasFire(IasZone, TuyaLocalCluster):
    """Tuya local IAS smoke/fire cluster."""

    _CONSTANT_ATTRIBUTES = {
        IasZone.AttributeDefs.zone_type.id: IasZone.ZoneType.Fire_Sensor
    }

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.endpoint.device.ias_zone = self


# Ensure TuyaQuirkBuilder is correctly configured
(
    TuyaQuirkBuilder("_TZE284_rccxox8p", "TS0601")
    .tuya_dp(
        dp_id=1,
        ep_attribute=TuyaIasFire.ep_attribute,
        attribute_name=IasZone.AttributeDefs.zone_status.name,
        converter=lambda x: IasZone.ZoneStatus.Alarm_1 if x == 0 else 0,
    )
    .adds(TuyaIasFire)
    .skip_configuration()
    .add_to_registry()
)

And confirmation can be seen in this screenshot:
grafik

The history showing smoke detect events and back to normal:
grafik

@prairiesnpr
Copy link
Collaborator

I was going to go add this, but it was already added in #3596. It should work in the beta.

@baldisos
Copy link

Looking through the PR i can't see the "_TZE284_rccxox8p", there's only

.applies_to("_TZE200_rccxox8p", "TS0601")
(Notice the 284, which is mine vs the 200 which is in the PR)

Would this need adaptation?

@prairiesnpr
Copy link
Collaborator

Looking through the PR i can't see the "_TZE284_rccxox8p", there's only

.applies_to("_TZE200_rccxox8p", "TS0601") (Notice the 284, which is mine vs the 200 which is in the PR)

Would this need adaptation?

Whoops, missed that, hang on, new PR incoming.

@baldisos
Copy link

Thank you! That was a really nice experience contributing to this and working together with you!

@kodacy
Copy link

kodacy commented Jan 3, 2025

Can you please confirm what would be the right ts0601_smoke.py Quirk for TS601 _TZE200_rccxox8p that can report fire and battery state? tested a bunch with no success. Thank you.

@prairiesnpr
Copy link
Collaborator

It will be part of the next HA release, 2025.1.

@cosmico89
Copy link

cosmico89 commented Jan 22, 2025

I don't understand, I have HA 2025.1.2 and zigbee2MQTT 2.0.0
I pair the smoker, it detects it but says it is not compatible.
Do I have to do anything else? I think it was integrated
Thanks

edit: I'm so sorry! my mistake...

@prairiesnpr
Copy link
Collaborator

zigbee2MQTT 2.0.0

You are in the wrong place

@mattfox27
Copy link

I can't this to work in HA or at least report the battery

@prairiesnpr
Copy link
Collaborator

I can't this to work in HA or at least report the battery

What exactly can't you get to work? I'd suggest a new issue with more details on what you have and what you are trying to do. This is in HA now, so you shouldn't need to do anything other than delete any custom quirks you may have.

@dcigir
Copy link

dcigir commented Mar 11, 2025

I just installed this smoke detector (TS0601 by _TZE284_rccxox8p) and is showing detection in Home Assistant, but it doesn't show battery state. Can somebody let me know if this can be fixed and how? I use ZHA not Zigbe2MQTT
Thanks

@plasma99new
Copy link

plasma99new commented Mar 27, 2025

Hi,

in another post I found the information that this one should be identical to the PA-44Z is this one suported by ZHA?

The problem I have is, i do only get the smoke entity but no battery live,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants