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
743 stars 679 forks source link

[Device Support Request] Xiaomi WS-USC04 LUMI lumi.switch.b2naus01 #2160

Closed DigitalWarrior closed 1 year ago

DigitalWarrior commented 1 year ago

Is your feature request related to a problem? Please describe. Device state (On/Off) is not updated when the switches are physically pressed. HA is able to turn the switches on and off. https://www.amazon.com/dp/B081ZRBPLC https://www.zigbee2mqtt.io/devices/WS-USC04.html

Describe the solution you'd like Have Home Assistant know the status of switch regardless of how it is flipped.

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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0000", "in_clusters": [ "0x0000", "0x0002", "0x0003", "0x0004", "0x0005", "0x0006", "0x0009", "0x0012", "0x0702", "0xfcc0" ], "out_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x0000", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0012", "0xfcc0" ], "out_clusters": [] }, "21": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x000c" ], "out_clusters": [] }, "31": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x000c" ], "out_clusters": [] }, "41": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "42": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "51": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "61": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "LUMI", "model": "lumi.switch.b2naus01", "class": "zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1" } ```
Diagnostic information ```yaml { "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.1.7", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.7", "docker": true, "arch": "x86_64", "timezone": "America/Denver", "os_name": "Linux", "os_version": "5.15.90", "supervisor": "2023.01.1", "host_os": "Home Assistant OS 9.5", "docker_version": "20.10.22", "chassis": "embedded", "run_as_root": true }, "custom_components": { "nodered": { "version": "0.4.5", "requirements": [] }, "hacs": { "version": "1.30.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "pirateweather": { "version": "1.0.2", "requirements": [ "python-forecastio==1.4.0" ] } }, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zha", "requirements": [ "bellows==0.34.6", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.90", "zigpy-deconz==0.19.2", "zigpy==0.53.0", "zigpy-xbee==0.16.2", "zigpy-zigate==0.10.3", "zigpy-znp==0.9.2" ], "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" ] } ], "codeowners": [ "@dmulcahey", "@adminiuga", "@puddly" ], "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*" } ], "dependencies": [ "file_upload" ], "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": 31653, "manufacturer": "LUMI", "model": "lumi.switch.b2naus01", "name": "LUMI lumi.switch.b2naus01", "quirk_applied": true, "quirk_class": "zhaquirks.xiaomi.aqara.opple_switch.XiaomiOpple2ButtonSwitchFace1", "manufacturer_code": 4447, "power_source": "Mains", "lqi": 232, "rssi": -42, "last_seen": "2023-01-31T19:21:23", "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=4447, maximum_buffer_size=127, maximum_incoming_transfer_size=100, server_mask=11264, maximum_outgoing_transfer_size=100, 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": "0x0000", "in_clusters": [ "0x0000", "0x0002", "0x0003", "0x0004", "0x0005", "0x0006", "0x0009", "0x0012", "0x0702", "0xfcc0" ], "out_clusters": [ "0x000a", "0x0019" ] }, "2": { "profile_id": 260, "device_type": "0x0000", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0012", "0xfcc0" ], "out_clusters": [] }, "21": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x000c" ], "out_clusters": [] }, "31": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x000c" ], "out_clusters": [] }, "41": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "42": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "51": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "61": { "profile_id": 260, "device_type": "0x0100", "in_clusters": [ "0x0012" ], "out_clusters": [] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } } }, "active_coordinator": false, "entities": [ { "entity_id": "button.lumi_lumi_switch_b2naus01_identify", "name": "LUMI lumi.switch.b2naus01" }, { "entity_id": "switch.lumi_lumi_switch_b2naus01_switch", "name": "LUMI lumi.switch.b2naus01" }, { "entity_id": "switch.lumi_lumi_switch_b2naus01_switch_2", "name": "LUMI lumi.switch.b2naus01" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "ON_OFF_SWITCH" }, { "name": "ON_OFF_SWITCH" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "ON_OFF_LIGHT" }, { "name": "unknown 97 device_type of 0xa1e0 profile id" } ], "user_given_name": null, "device_reg_id": "4f708c855f5a9c0bc02747ebf6dae014", "area_id": "master_bath", "cluster_details": { "1": { "device_type": { "name": "ON_OFF_SWITCH", "id": 0 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0001": { "attribute_name": "app_version", "value": 31 }, "0x0004": { "attribute_name": "manufacturer", "value": "LUMI" }, "0x0005": { "attribute_name": "model", "value": "lumi.switch.b2naus01" }, "0x0006": { "attribute_name": "date_code", "value": "12-28-2021" } }, "unsupported_attributes": {} }, "0x0002": { "endpoint_attribute": "device_temperature", "attributes": {}, "unsupported_attributes": { "0x0000": { "attribute_name": "current_temperature" } } }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 1 } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0x0009": { "endpoint_attribute": "alarms", "attributes": {}, "unsupported_attributes": {} }, "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} }, "0x0702": { "endpoint_attribute": "smartenergy_metering", "attributes": {}, "unsupported_attributes": { "0x0300": { "attribute_name": "unit_of_measure" }, "0x0301": { "attribute_name": "multiplier" }, "0x0302": { "attribute_name": "divisor" }, "0x0303": { "attribute_name": "summation_formatting" }, "0x0304": { "attribute_name": "demand_formatting" }, "0x0400": { "attribute_name": "instantaneous_demand" }, "0x0306": { "attribute_name": "metering_device_type" }, "0x0000": { "attribute_name": "current_summ_delivered" }, "0x0200": { "attribute_name": "status" } } }, "0xfcc0": { "endpoint_attribute": "opple_cluster", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x000a": { "endpoint_attribute": "time", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": {}, "unsupported_attributes": {} } } }, "2": { "device_type": { "name": "ON_OFF_SWITCH", "id": 0 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": {}, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 1 } }, "unsupported_attributes": { "0x4003": { "attribute_name": "start_up_on_off" } } }, "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} }, "0xfcc0": { "endpoint_attribute": "opple_cluster", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "21": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x000c": { "endpoint_attribute": "analog_input", "attributes": { "0x0055": { "attribute_name": "present_value", "value": 0.0 } }, "unsupported_attributes": {} } }, "out_clusters": {} }, "31": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x000c": { "endpoint_attribute": "analog_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "41": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "42": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "51": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "61": { "device_type": { "name": "ON_OFF_LIGHT", "id": 256 }, "profile_id": 260, "in_clusters": { "0x0012": { "endpoint_attribute": "multistate_input", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": {} }, "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 I am able to get the correct state of the switch via the Mange Zigbee Device. image Once I do that the state is updated correctly in Home Assistant.

TheJulianJES commented 1 year ago

Can you press the "Reconfigure device" button in the UI and provide a screenshot of what it looks like? Also, what coordinator are you using? If it's a Conbee, on what firmware version is it?

DigitalWarrior commented 1 year ago

Here is the screen shot. image Full table.

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

Cluster | Binding | Reporting |   -- | -- | -- | --   |   | Attribute | min/max/change |   DeviceTemperatureCluster | X | current_temperature: | 30/900/50 |   Identify |   |   |   |   Groups |   |   |   |   Scenes |   |   |   |   OnOffCluster | X | on_off: | 0/900/1 |   Alarms |   |   |   |   MultistateInputCluster |   |   |   |   XiaomiMeteringCluster | x | instantaneous_demand: | 5/900/1 |     |   | current_summ_delivered | 30/900/1 |     |   | current_tier1_summ_delivered: | 30/900/1 |     |   | current_tier2_summ_delivered: | 30/900/1 |     |   | current_tier3_summ_delivered: | 30/900/1 |     |   | current_tier4_summ_delivered: | 30/900/1 |     |   | current_tier5_summ_delivered: | 30/900/1 |     |   | current_tier6_summ_delivered: | 30/900/1 |     |   | status: | 1/900/1 |   OppleSwitchCluster | x |   |   |   Time |   |   |   |   Ota |   |   |   |   AnalogInput |   |   |   |   GreenPowerProxy |   |   |   |  

I used to have the Cronbee II but migrated over to the Skyconnect

image

TheJulianJES commented 1 year ago

I assume the status still doesn't update properly (even after the reconfiguration)?

DigitalWarrior commented 1 year ago

correct

github-actions[bot] commented 1 year 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.

Simon-CR commented 7 months ago

I'm still experiencing the same issue with everything up to date as off today.

ethan-tripp commented 1 month ago

I am also experiencing the same issue as described above.