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
717 stars 665 forks source link

[Device Support Request] Tuya Smoke Alarm #1529

Closed unfurled closed 2 years ago

unfurled commented 2 years ago

Is your feature request related to a problem? Please describe. Device is detected but no other attributes are exposed except for basic_lqi and basic_rssi

Describe the solution you'd like Add support for Tuya Smoke Alarm

Device signature - this can be acquired by clicking on the "Zigbee Device Signature" button in the device settings ``` { "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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE200_vzekyi4c", "model": "TS0601", "class": "zigpy.device.Device" } ```
Diagnostic information - this can be acquired by clicking on the "Download Diagnostics" button in the device settings ``` { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2022.4.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.9.9", "docker": true, "arch": "x86_64", "timezone": "Asia/Singapore", "os_name": "Linux", "os_version": "5.10.108", "supervisor": "2022.04.0", "host_os": "Home Assistant OS 7.6", "docker_version": "20.10.9", "chassis": "vm", "run_as_root": true }, "custom_components": { "xiaomi_miot": { "version": "0.5.7", "requirements": [ "construct==2.10.56", "python-miio>=0.5.6", "micloud>=0.3" ] }, "hacs": { "version": "1.24.5", "requirements": [ "aiogithubapi>=21.11.0" ] }, "hpprinter": { "version": "1.0.7", "requirements": [ "xmltodict==0.12.0" ] }, "smartthinq_sensors": { "version": "0.12.12", "requirements": [ "pycountry>=20.7.3", "xmltodict>=0.12.0" ] }, "sonoff": { "version": "v2.4.7", "requirements": [ "pycryptodome>=3.6.6" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.29.0", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.72", "zigpy-deconz==0.14.0", "zigpy==0.44.2", "zigpy-xbee==0.14.0", "zigpy-zigate==0.7.4", "zigpy-znp==0.7.0" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "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": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" } ], "after_dependencies": [ "usb", "zeroconf" ], "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp" ], "is_built_in": true }, "data": { "ieee": "**REDACTED**", "nwk": 36295, "manufacturer": "_TZE200_vzekyi4c", "model": "TS0601", "name": "_TZE200_vzekyi4c TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4098, "power_source": "Battery or Unknown", "lqi": 255, "rssi": -53, "last_seen": "2022-04-25T14:56:40", "available": true, "device_type": "EndDevice", "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=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": 260, "device_type": "0x0051", "in_clusters": [ "0x0000", "0x0004", "0x0005", "0xef00" ], "out_clusters": [ "0x000a", "0x0019" ] } } }, "entities": [], "neighbors": [], "endpoint_names": [ { "name": "SMART_PLUG" } ], "user_given_name": null, "device_reg_id": "01a3aa2fab5b53d259f12e2e405e2bbc", "area_id": "study_room" } } ```
Additional logs ``` Paste any additional debug logs here. ```

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

javicalle commented 2 years ago

Have you tried to add your device to the TuyaSmokeDetector0601 quirk?

If you are not familiar, there are some guides about it. Maybe the most popular can be:

unfurled commented 2 years ago

Thanks I think I got it working

On Wed, 27 Apr 2022 at 03:41, javicalle @.***> wrote:

Have you tried to add your device to the TuyaSmokeDetector0601 quirk?

If you are not familiar, there are some guides about it. Maybe the most popular can be:

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/1529#issuecomment-1110180235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGY3SPMGBF5GH7SVKOSGJ3VHBBGJANCNFSM5UHSNQVQ . You are receiving this because you authored the thread.Message ID: @.***>

javicalle commented 2 years ago

If device is working you can create the PR to add your device to the mainstream?

Just edit from the web the file content adding your device to the MODELS_INFO and follow the instructions:

This way other users will be able to use the device in ZHA thanks to you!

unfurled commented 2 years ago

Hi,

I mentioned I 'think' I got it working because : I got the smoke detection working in Home Assistant via ZHA, BUT I dont have the battery readings. If thats ok, then I can edit the web file you sent. In fact, I simply added one new line in the signature attribute to recognise the model.

Let me know what you think. Thanks

On Sat, 21 May 2022 at 19:22, javicalle @.***> wrote:

If device is working you can create the PR to add your device to the mainstream?

Just edit from the web the file content adding your device to the MODELS_INFO and follow the instructions:

- https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/tuya/ts0601_smoke.py

This way other users will be able to use the device in ZHA thanks to you!

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/1529#issuecomment-1133602973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGY3SNAK6PX77EFPWLDWZTVLDBPHANCNFSM5UHSNQVQ . You are receiving this because you authored the thread.Message ID: @.***>

javicalle commented 2 years ago

More or less the same has been discused in #1491 Maybe battery status (low, med, high) and tamper device can be reported, but not sure wich way. I'll see if I can spare some time and take a look at it.

But it's fine if you made the PR just for the device model.

unfurled commented 1 year ago

Alright, PR created. Thanks.

On Tue, 24 May 2022 at 02:49, javicalle @.***> wrote:

More or less the same has been discused in #1491 https://github.com/zigpy/zha-device-handlers/issues/1491 Maybe battery status (low, med, high) and tamper device can be reported, but not sure wich way. I'll see if I can spare some time and take a look at it.

But it's fine if you made the PR just for the device model.

— Reply to this email directly, view it on GitHub https://github.com/zigpy/zha-device-handlers/issues/1529#issuecomment-1135022555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGY3SJHGNKT2EPXO3XLFF3VLPHMXANCNFSM5UHSNQVQ . You are receiving this because you authored the thread.Message ID: @.***>