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
757 stars 695 forks source link

[Device Support Request] centechia (and others?) Temperatur/Humidity sensor with display #1724

Closed bsafh closed 2 years ago

bsafh commented 2 years ago

Is your feature request related to a problem? Please describe. The device pairs, and battery, temperature, humidity entities show up as well, but battery level is "unknown", both temperature and humidity are always zero (on several devices of this type)

Describe the solution you'd like I would like to use this sensor for temperature and humidity readings.

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=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": "0x0302", "in_clusters": [ "0x0000", "0x0001", "0x0402", "0x0405" ], "out_clusters": [ "0x000a", "0x0019" ] } }, "manufacturer": "_TZE200_qoy0ekbd", "model": "TS0601", "class": "zigpy.device.Device" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant Supervised", "version": "2022.8.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.5", "docker": true, "arch": "x86_64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "5.10.0-17-amd64", "supervisor": "2022.08.5", "host_os": "Debian GNU/Linux 11 (bullseye)", "docker_version": "20.10.17", "chassis": "vm", "run_as_root": true }, "custom_components": { "hacs": { "version": "1.26.2", "requirements": [ "aiogithubapi>=22.2.4" ] }, "openweathermap_all": { "version": "0.0.1", "requirements": [ "owm2json==0.1.89" ] }, "climate_group": { "version": "0.4.2", "requirements": [] }, "holidays": { "version": "1.8.0", "requirements": [ "python-dateutil>=2.8.2", "holidays>=0.14.2" ] }, "openwrt": { "version": "0.0.1", "requirements": [] }, "homematicip_local": { "version": "1.15.0", "requirements": [ "hahomematic==2022.8.10" ] }, "truenas": { "version": "0.0.0", "requirements": [] }, "nodered": { "version": "1.0.9", "requirements": [] }, "ai_thermostat": { "version": "0.9.3", "requirements": [] }, "browser_mod": { "version": "1.5.3", "requirements": [] }, "better_thermostat": { "version": "1.0.0-beta14", "requirements": [] }, "ferienapidotde": { "version": "0.2.3", "requirements": [ "ferien-api==0.3.6" ] }, "climate_scheduler": { "version": "0.1.0", "requirements": [] }, "webrtc": { "version": "v2.3.1", "requirements": [] }, "gismeteo": { "version": "2.5.0", "requirements": [] }, "frigate": { "version": "2.3", "requirements": [] }, "zha_toolkit": { "version": "v0.8.13", "requirements": [] }, "reversotts": { "version": "1.0.2", "requirements": [ "pyttsreverso==0.4" ] }, "picotts_remote": { "version": "1.0.1", "requirements": [] }, "scheduler": { "version": "v0.0.0", "requirements": [] }, "dwd_weather": { "version": "1.2.22", "requirements": [ "simple_dwd_weatherforecast==1.1.5", "markdownify==0.6.5" ] }, "shelly": { "version": "1.0.1", "requirements": [ "pyShelly==1.0.2", "paho-mqtt==1.6.1", "websocket-client" ] }, "opnsense": { "version": "0.1.0", "requirements": [ "mac-vendor-lookup>=0.1.11" ] }, "dwains_dashboard": { "version": "3.2.0", "requirements": [] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.33.1", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.78", "zigpy-deconz==0.18.0", "zigpy==0.50.2", "zigpy-xbee==0.15.0", "zigpy-zigate==0.9.2", "zigpy-znp==0.8.2" ], "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": "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" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" } ], "after_dependencies": [ "onboarding", "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": 44979, "manufacturer": "_TZE200_qoy0ekbd", "model": "TS0601", "name": "_TZE200_qoy0ekbd TS0601", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "manufacturer_code": 4417, "power_source": "Battery or Unknown", "lqi": 87, "rssi": null, "last_seen": "2022-08-30T17:33:38", "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=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=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": "0x0302", "in_clusters": [ "0x0000", "0x0001", "0x0402", "0x0405" ], "out_clusters": [ "0x000a", "0x0019" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "sensor.tze200_qoy0ekbd_ts0601_battery", "name": "_TZE200_qoy0ekbd TS0601" }, { "entity_id": "sensor.tze200_qoy0ekbd_ts0601_temperature", "name": "_TZE200_qoy0ekbd TS0601" }, { "entity_id": "sensor.tze200_qoy0ekbd_ts0601_humidity", "name": "_TZE200_qoy0ekbd TS0601" } ], "neighbors": [], "endpoint_names": [ { "name": "TEMPERATURE_SENSOR" } ], "user_given_name": null, "device_reg_id": "dbddd3eb88db226c2bda9c58d901da93", "area_id": null, "cluster_details": { "1": { "device_type": { "name": "TEMPERATURE_SENSOR", "id": 770 }, "profile_id": 260, "in_clusters": { "0x0001": { "endpoint_attribute": "power", "attributes": { "0x0020": { "attribute_name": "battery_voltage", "value": 0 }, "0x0021": { "attribute_name": "battery_percentage_remaining", "value": 0 } }, "unsupported_attributes": { "0x0031": { "attribute_name": "battery_size" }, "0x0033": { "attribute_name": "battery_quantity" } } }, "0x0402": { "endpoint_attribute": "temperature", "attributes": { "0x0000": { "attribute_name": "measured_value", "value": 0 } }, "unsupported_attributes": {} }, "0x0405": { "endpoint_attribute": "humidity", "attributes": { "0x0000": { "attribute_name": "measured_value", "value": 0 } }, "unsupported_attributes": {} }, "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": "_TZE200_qoy0ekbd" }, "0x0005": { "attribute_name": "model", "value": "TS0601" } }, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} }, "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
Additional logs ``` 2022-08-30 17:29:53.935 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:29:53.935 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:29:53.938 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:29:53.938 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:29:58.939 INFO (MainThread) [zigpy.application] New device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:03.994 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:03.994 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:03.995 INFO (MainThread) [zigpy.application] Device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:04.000 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:04.000 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:04.000 INFO (MainThread) [zigpy.application] Device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:07.887 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:07.887 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:07.888 INFO (MainThread) [zigpy.application] Device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:07.888 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:07.889 INFO (MainThread) [zigpy_znp.zigbee.application] TC device join: ZDO.TCDevInd.Callback(SrcNwk=0xAFB3, SrcIEEE=a4:c1:38:b8:50:f3:94:56, ParentNwk=0x4D8B) 2022-08-30 17:30:07.889 INFO (MainThread) [zigpy.application] Device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:09.179 DEBUG (MainThread) [zigpy_znp.api] Received command: ZDO.EndDeviceAnnceInd.Callback(Src=0xAFB3, NWK=0xAFB3, IEEE=a4:c1:38:b8:50:f3:94:56, Capabilities=) 2022-08-30 17:30:09.189 INFO (MainThread) [zigpy_znp.zigbee.application] ZDO device announce: nwk=0xAFB3, ieee=a4:c1:38:b8:50:f3:94:56, capabilities=128 2022-08-30 17:30:09.189 INFO (MainThread) [zigpy.application] Device 0xafb3 (a4:c1:38:b8:50:f3:94:56) joined the network 2022-08-30 17:30:09.190 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 0 to ep 0, cluster 19: b'\x1a\xb3\xafV\x94\xf3P\xb88\xc1\xa4\x80' 2022-08-30 17:30:09.191 DEBUG (MainThread) [zigpy.zdo] [0xafb3:zdo] ZDO request ZDOCmd.Device_annce: [0xAFB3, a4:c1:38:b8:50:f3:94:56, 128] 2022-08-30 17:30:11.235 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 1 to ep 1, cluster 61184: b'\x09\x54\x02\x00\x45\x01\x02\x00\x04\x00\x00\x01\x13' 2022-08-30 17:30:11.243 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 0 to ep 0, cluster 32770: b'\x1b\x00\xb3\xaf\x02@\x80A\x11BB\x00\x00*B\x00\x00' 2022-08-30 17:30:12.136 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 1 to ep 1, cluster 61184: b'\x09\x54\x02\x00\x45\x01\x02\x00\x04\x00\x00\x01\x13' 2022-08-30 17:30:12.418 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 0 to ep 0, cluster 32773: b'\x1c\x00\xb3\xaf\x01\x01' 2022-08-30 17:30:12.731 DEBUG (MainThread) [zigpy.application] Received frame on uninitialized device from ep 0 to ep 0, cluster 32772: b'\x1d\x00\xb3\xaf\x14\x01\x04\x01\x02\x03\x01\x04\x01\x00\x02\x04\x05\x04\x00\x00\x02\x19\x00\n\x00' 2022-08-30 17:30:13.099 INFO (MainThread) [zigpy.device] [0xafb3] Discovered basic device information for 2022-08-30 17:30:13.099 DEBUG (MainThread) [zigpy.application] Device is initialized 2022-08-30 17:30:13.099 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for _TZE200_qoy0ekbd TS0601 (a4:c1:38:b8:50:f3:94:56) 2022-08-30 17:30:13.106 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xAFB3:a4:c1:38:b8:50:f3:94:56 entering async_device_initialized - is_new_join: True 2022-08-30 17:30:13.106 DEBUG (MainThread) [homeassistant.components.zha.core.gateway] device - 0xAFB3:a4:c1:38:b8:50:f3:94:56 has joined the ZHA zigbee network 2022-08-30 17:30:13.155 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:b8:50:f3:94:56, 1, 0, 4, '_TZE200_qoy0ekbd') params: FOREIGN KEY constraint failed 2022-08-30 17:30:13.156 DEBUG (MainThread) [zigpy.appdb] Error handling '_save_attribute' event with (a4:c1:38:b8:50:f3:94:56, 1, 0, 5, 'TS0601') params: FOREIGN KEY constraint failed 2022-08-30 17:30:13.352 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09540200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:17.701 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09560200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:18.774 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09560200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:19.979 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09560200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:28.227 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09570200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:29.418 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09570200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:30.624 DEBUG (MainThread) [zigpy.device] Ignoring message (b'09570200450102000400000113') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:34.851 DEBUG (MainThread) [zigpy.device] Ignoring message (b'095802004c0202000400000034') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:36.048 DEBUG (MainThread) [zigpy.device] Ignoring message (b'095802004c0202000400000034') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' 2022-08-30 17:30:37.253 DEBUG (MainThread) [zigpy.device] Ignoring message (b'095802004c0202000400000034') on cluster 61184: unknown endpoint or cluster id: 'No cluster ID 0xef00 on (a4:c1:38:b8:50:f3:94:56, 1)' ```

Additional context available e.g. here: https://de.aliexpress.com/item/1005004301559504.html

tube0013 commented 2 years ago

dupe see https://github.com/zigpy/zha-device-handlers/issues/1670

one thing to look for is to search issues for the manufacturer since they are pretty unique (_TZE200_qoy0ekbd in this case) you will easily see if another issue already exists for the device.

javicalle commented 2 years ago

Duplicate of #1670 May be fixed with #1887