zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
749 stars 687 forks source link

[Device Support Request] TuyaSiren _TZE204_t1blo2bj #2300

Open donaldwpage opened 1 year ago

donaldwpage commented 1 year ago

TuyaSiren _ZTE204_t1blo2bj appears only as an on/off switch and is missing the other end points. It appears to be because it is using quirk: zhaquicks.tuya.ts0601.siren.TuyaSirenGPP_NoSensors

I expect it to use quirk TuyaSiren2 as that signature describes a similar set of end points and output clusters

Device signature ```yaml { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *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": 260, "device_type": "0x0403", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "_TZE204_t1blo2bj", "model": "TS0601", "class": "zhaquirks.tuya.ts0601_siren.TuyaSirenGPP_NoSensors" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.3.6", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.10", "docker": true, "arch": "aarch64", "timezone": "Europe/London", "os_name": "Linux", "os_version": "5.15.84-v8", "supervisor": "2023.03.2", "host_os": "Home Assistant OS 9.5", "docker_version": "20.10.22", "chassis": "embedded", "run_as_root": true }, "custom_components": { "hildebrand_glow_ihd": { "version": "1.1.0", "requirements": [] }, "hacs": { "version": "1.31.0", "requirements": [ "aiogithubapi>=22.10.1" ] }, "hildebrandglow_dcc": { "version": "1.0.3", "requirements": [ "pyglowmarkt==0.5.5" ] }, "cleverspa": { "version": "1.0.0", "requirements": [ "pyrebase" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "requirements": [ "bellows==0.34.10", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.94", "zigpy-deconz==0.19.2", "zigpy==0.53.2", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.3" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 23174, "manufacturer": "_TZE204_t1blo2bj", "model": "TS0601", "name": "_TZE204_t1blo2bj TS0601", "quirk_applied": true, "quirk_class": "zhaquirks.tuya.ts0601_siren.TuyaSirenGPP_NoSensors", "manufacturer_code": 4417, "power_source": "Mains", "lqi": 48, "rssi": null, "last_seen": "2023-03-25T14:59:48", "available": true, "device_type": "Router", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=, *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": 260, "device_type": "0x0403", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0x0006", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "switch.tze204_t1blo2bj_ts0601_switch", "name": "_TZE204_t1blo2bj TS0601" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "IAS_WARNING_DEVICE" }, { "name": "unknown 97 device_type of 0xa1e0 profile id" } ], "user_given_name": null, "device_reg_id": "dc0f3757428ce8e6aac3a6804f7883bc", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "IAS_WARNING_DEVICE", "id": 1027 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 74 } }, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0xef00": { "endpoint_attribute": "tuya_manufacturer", "attributes": { "0xef00": { "attribute_name": "mcu_version", "value": "1.0.3" } }, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x020f": { "attribute_name": "battery", "value": 100 }, "0x0267": { "attribute_name": "alarm_duration", "value": 10 }, "0x0466": { "attribute_name": "melody", "value": 5 }, "0x0474": { "attribute_name": "volume", "value": 2 } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } }, "242": { "device_type": { "name": "unknown", "id": 97 }, "profile_id": 41440, "in_clusters": {}, "out_clusters": { "0x0021": { "endpoint_attribute": "green_power", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
Additional logs ``` Paste any additional debug logs here. Don't remove the extra line breaks outside the ``` marks. ```

Additional context Add any other context or screenshots about the feature request here.

kfriedenberger commented 1 year ago

+1; same request from me!

kfriedenberger commented 1 year ago

@donaldwpage solved: https://github.com/zigpy/zha-device-handlers/issues/1379

donaldwpage commented 1 year ago

yes this is the quirk I believe it should be using, but it isn't and for reasons that I don't understand, when I tried to make it do so, it still chose to use the NoSensors quirk

kfriedenberger commented 1 year ago

check your logs? one of the imports in this quirk needed to be upgraded given some HA library changes. i had to move "TuyaDPType" to import from zhaquirks.tuya, not zhaquirks.tuya.mcu

See section below...

from zhaquirks.tuya import ATTR_ON_OFF, TuyaManufCluster, TuyaManufClusterAttributes, TuyaDPType from zhaquirks.tuya.mcu import ( TUYA_MCU_COMMAND, DPToAttributeMapping, TuyaAttributesCluster, TuyaClusterData, TuyaMCUCluster, )

javicalle commented 1 year ago

It seems that you are using a local quirk for your devices. Do any of you mind to create a PR to update the mainstream? If not doing next change in quirks can broke ir again.

Thanks in advanced.

Juju-no-dev commented 1 year ago

Good morning,

I also just bought this mermaid and I have the same problem as you @donaldwpage

I have been using Home Aassistant for 2 months, mainly with Sonoff and AQARA devices.

@kfriedenberger This is the first time I've encountered a difficulty, I didn't really understand how quirks. can you tell me which file I need to copy to the home assistant?

Thx

Raspberry Pi3: Home assistant 2023.3.6 Sonoff Zigbee 3.0 USB

asdkjasdfla commented 1 year ago

Did you find out how to fix this. I am in the same situation

donaldwpage commented 1 year ago

Unfortunately not and I haven't had time recently to investigate further. Maybe this week

asdkjasdfla commented 1 year ago

Unfortunately not and I haven't had time recently to investigate further. Maybe this week

Thanks.

donaldwpage commented 1 year ago

So I revisited this device today, removing all ZHA quirks and running the latest HASS 2023.5.4 Pairing is fine but it still appears only as a switch. Manually managing it via the device info page, Manage Zigbee Device, I can change the volume and melody via the TuyaMCUSiren cluster. Having done this, the on off setting works to play the selected melody. It still doesn't appear in the Siren section of Services but it is good enough for me to switch it on and sound an alarm via automations.

donaldwpage commented 1 year ago

Minor addition to the above, I installed the Switch As X integration and used that to turn it into a Siren

pabsi commented 11 months ago

Minor addition to the above, I installed the Switch As X integration and used that to turn it into a Siren

Hey @donaldwpage could you share the code to make this work? I have exactly _TZE204_t1blo2bj and as you say, I can change melody etc via "Manage Zigbee device - > Clusters -> TuyaMCUSiren" cluster, "melody" attribute, but still being seen as a switch only (no access to volume, melody, etc via the UI).

I'd appreciate the help, or any pointer.

Thank you! :pray:

pabsi commented 11 months ago

Nevermind...just found this out: image

Changed it to a siren and as you say, at least I can now use the siren automations.

Now, the default alarm sound is not really scary for possible thiefs though (Mozart's Rondo Alla Turca).... :sweat_smile:

pabsi commented 11 months ago

I am curiours: is this going to be looked at or in any sort of roadmap? I only have the siren entity and also only after I changed the device type of the switch...it'd be super convenient to have the battery level being reported (I already run out of the batteries shipped with the alarm and found out by surprise).. I rather not have zigbee2mqtt just for this one device.

Happy to try custom quirks or whatever myself with some help. I am OK with Python, just never did anything around HA integrations etc. Just need an initial pointer.

Thanks!

masi commented 8 months ago

Does ZHA really support manufacturer specific clusters and attributes? From what I have seen in the UI so far only clusters and attributes described by the ZCL are show.

dmulcahey commented 8 months ago

Does ZHA really support manufacturer specific clusters and attributes? From what I have seen in the UI so far only clusters and attributes described by the ZCL are show.

There are plenty of examples in this repo of this. Here is an example: https://github.com/zigpy/zha-device-handlers/blob/2a39c07e48a2f3cd1956fffac009ec0c64b0f783/zhaquirks/inovelli/__init__.py#L87

is there something in particular that you have an issue with?

masi commented 8 months ago

I want to see the attributes in a user-friendly way (eg drop-downs) in the UI. So I can select the melody without having to fiddle with the attribute value. If I hadn't googled a lot I wouldn't even have known that I have to go into the "manage Zigbee device" dialogue.

And ideally I had them as entities so I could do everything with them in HA as I want to.

But this is outside the scope of this is issue.

What would be nice though is as @pabsi wrote that the device came by default with a Siren instead of a Switch.

Other than that I assume the quirks implements everything what can be done. Except maybe that the device could have a battery entity. Currently it is being reported as mains powered, but it has a battery as backup.

masi commented 8 months ago

Even more awesome would be if the siren entity had the available tones set.

https://www.home-assistant.io/integrations/siren/ https://zigbee.blakadder.com/Neo_NAS-AB02B2.html

github-actions[bot] commented 2 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

masi commented 2 months ago

How is the new Zigbee quirks v2 API progressing? Is it possible for non-ZHA-devs to give a shot at a quirk for this device.

MatejKovacic commented 1 month ago

I also have the same device. Mine is called Neo NAS-AB02 and has ID TS0601 by _TZE204_t1blo2bj.

I bought it from Aliexpress, unfortunately when you buy it, you can not see the exact model

What is the most simple way to change volume and melody?