home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.23k stars 30.24k forks source link

Zigbee "groups" not consistently updating parent entity with correct state #53735

Closed smartqasa closed 3 years ago

smartqasa commented 3 years ago

The problem

The ZHA integration includes a function under the "Configure" panel that allows for the grouping of Zigbee devices under a single entity. When all of the Zigbee devices in a group are off, the parent entity should be turned off by the integration.

I am observing two separate but related issues:

  1. Substantial delays (30 seconds or more) in the updating of the parent entity when all child devices are turned off; and
  2. Failure to update the parent entity when all child devices are turned off.

I have tested this on small groups (4 bulbs) and large groups (16 bulbs). The issue appears to be independent of the number of devices in a group.

What is version of Home Assistant Core has the issue?

core-2021.7.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Zigbee Home Automation

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

My Home Assistant instance is running on an Intel NUC 10 (i7) with 32 GB of RAM and 256BG of SSD.

I am using the Nortek GoControl QuickStick Combo Model HUSBZB-1 (Z-Wave & Zigbee Ember 3581 USB Adapter) and I applied the EmberZNet NCP application firmware update as recommended. It is current configured to use channel 11.

probot-home-assistant[bot] commented 3 years ago

Hey there @dmulcahey, @adminiuga, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

MattWestb commented 3 years ago

One question is your light normal zigbee that is doing OK reporting or no standard (like Philips HUE that is not reporting the status back to the coordinator) one ?

smartqasa commented 3 years ago

I have mostly Phillips Hue lighting (~40 devices).

An addition observation... When placing a "turn_off" service call to the group entity, the physical lights in the group all turn off (as expeceted); however, the group's parent entity turns back on. A second turn_off call to the parent entity seems to "stick".

MattWestb commented 3 years ago

"Normal" zigbee light (as the standard is moderate) is reporting to the coordinator then there attribute is changed like on/off or brightness is being changed.

Philips HUE is not supporting this behavior and the coordinator must pulling (requesting the devices status) in some short interval for updating the host systems status.

I dont knowing the time interval ZHA is using but it normally working but not so fast and i have decommissioning me last HUE light and remote in my production system then they is doing too much bad things.

I think its better that some with more experience of Philips HUE light in ZHA is explaining it deeper how the timing is working then i have not digging in that.

Its being some change in ZHA how it doing the group status in the last commits but i dont knowing how and wot is doing but i think the devs is knowing it better.

Adminiuga commented 3 years ago

HUE lights (older versions) do not report attributes. ZHA tries to poll the group after a change, but depending on what coordinator you use, channel, number of lights and interference, that is not always successful. General sentiment, HUE lights experience is the best with HUE integration.

smartqasa commented 3 years ago

I have the 5/6 inch recessed color lights (5996611U55) and the 4 inch recessed color lights (5996511U5). They are all recent purchases and, I believe, are "newer" models.

smartqasa commented 3 years ago

It probably makes sense to publish an advisory in the ZHA documentation about this issue/limitation. As the documentation stands today, there is a section detailing how to link Philips Hue bulbs to ZHA. A recommendation against this approach seems appropriate.

Of course, my feeling is that someone should look at the ZHA code and see if this situation can be addressed in some manner; especially given the popularity of Philips Hue products.

MattWestb commented 3 years ago

Philips was using Atmel chips from the beginning and the SDK was having that "future" and then changing to other chips (Silabs EFR32MG) Philips looks being implanting the same "bug" for not braking its compatibility with there old products then looking in the Z2M code implementation:

        // When the bound devices/members of group have the following manufacturerIDs
        manufacturerIDs: [
            ZigbeeHerdsman.Zcl.ManufacturerCode.Philips,
            ZigbeeHerdsman.Zcl.ManufacturerCode.ATMEL,
            ZigbeeHerdsman.Zcl.ManufacturerCode.GLEDOPTO_CO_LTD,
            ZigbeeHerdsman.Zcl.ManufacturerCode.MUELLER_LICHT_INT,

Its looks Müller and Gledopto have doing the same no standard implementation (how can they getting there device certificated ?).

One more "HUE future" https://github.com/zigpy/zigpy/discussions/714 = way i have moving all HUE lights from my production system and they is only $$.

@Adminiuga do you knowing the pull interval ZHA is using for devices that is not doing attribute reporting ?

Edit: Wiki https://github.com/zigpy/zigpy/wiki/Philips-HUE---Signify

Adminiuga commented 3 years ago

I have the 5/6 inch recessed color lights (5996611U55) and the 4 inch recessed color lights (5996511U5). They are all recent purchases and, I believe, are "newer" models.

Post zigbee device signatures for those

smartqasa commented 3 years ago

While attempting to better understand the underlying issues with using Hue bulbs with ZHA, I came across this...

"Products released prior to 2019 use the Zigbee Light Link protocol, a compatible subset of Zigbee 3.0, to communicate, while lighting products released after 2019 use either Bluetooth, or Zigbee 3.0. Smart switches, motion detectors, and other accessory devices e.g. Hue HDMI sync, used the Zigbee Home Automation protocol but now also use Zigbee 3.0."

MattWestb commented 3 years ago

Booth Philips HUE and IKEA Tradfr was / is using Zigbee Light Link (aka ZLL) and both hubs is certified as ZLL devices.

IKEA have upgrading nearly all devices to Zigbee 3 with touch link paring enabled (the old motion sensor and the old CWS (RGBW) have not getting ZB3) and having doing one good implantation of Zigbee 3.

Philips HUE have also upgraded many devices to Zogbee 3 with touch link or Bluetooth pairing but have for not braking backward comparability they implanted some not standard things like not reporting attribute changes (that is moderate in Zigbee lights 3) and therefor the coordinator need pulling the status from the device (that ZHA is doing).

The devs was asking one question https://github.com/home-assistant/core/issues/53735#issuecomment-890056576.

Trufax commented 3 years ago

Just switched from my HUE Bridge to ConBee 2 + ZHA and had the exact same issue. Groups are not updating properly. i tried zigbee groups, Light groups or simply an entity list with a header toggle. All of them behave the same.

I have a mix of older and newer Hue bulbs. Is there maybe a way to increase the speed of the polling if this is required for HUE (since they seem to be out of standard)?

Iam happy to test if there is anything i can do to improve this.

Adminiuga commented 3 years ago

What channel is your ZigBee network on? Do you use usb extension cable for conbee?

smartqasa commented 3 years ago

@Adminiuga

Here is the signature for the 5/6 inch recessed color lights (5996611U55):

{ "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4107, maximum_buffer_size=82, maximum_incoming_transfer_size=128, server_mask=11264, maximum_outgoing_transfer_size=128, descriptor_capability_field=<DescriptorCapability.NONE: 0>, 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": { "11": { "profile_id": 260, "device_type": "0x010d", "in_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x0300", "0x1000", "0xfc01", "0xfc02" ], "out_clusters": [ "0x0019" ] }, "242": { "profile_id": 41440, "device_type": "0x0061", "in_clusters": [], "out_clusters": [ "0x0021" ] } }, "manufacturer": "Signify Netherlands B.V.", "model": "LCD002", "class": "zigpy.device.Device" }

Here is the signature for the 4 inch recessed color lights (5996511U5):