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.72k stars 30.45k forks source link

ZHA: On TS011F 4-way power strip, switching one socket switches all #77654

Closed Bodge-IT closed 1 year ago

Bodge-IT commented 2 years ago

The problem

I have recently added the device TS011F by _TZ3000_cfnprab5 to my zigbee network. Blackadder compatibility repo reports OOB compatability with HA: https://zigbee.blakadder.com/Xenon_SM-SO306.html

Device is found, 4 sockets + 1 socket usb ports each have switches created for them but when you switch one of them, all 5 switches toggle.

What version of Home Assistant Core has the issue?

2022.8.*, 2022.9.b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

ZHA

Link to integration documentation on our website

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

Diagnostics information

zha-c15117d70da04dab9268baa9e726ecc5-_TZ3000_cfnprab5 TS011F-d66ffa5b25fe9571a634bca7ab9264e5.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

ConbeeII is my main zigbee stick.

here is device registry entry:

        "config_entries": [
          "c15117d70da04dab9268baa9e726ecc5"
        ],
        "connections": [
          [
            "zigbee",
            "00:3c:84:ff:fe:a4:da:db"
          ]
        ],
        "identifiers": [
          [
            "zha",
            "00:3c:84:ff:fe:a4:da:db"
          ]
        ],
        "manufacturer": "_TZ3000_4fjiwweb",
        "model": "TS004F",
        "name": "_TZ3000_4fjiwweb TS004F",
        "sw_version": null,
        "hw_version": null,
        "entry_type": null,
        "id": "6e8f79a5671e30eeef218ad7b7bd8eeb",
        "via_device_id": "d39bb66b531d4429ab39bb81097458a3",
        "area_id": "fd56202c0c00469ab3fd5b84e93108df",
        "name_by_user": "Smart Nub",
        "disabled_by": null,
        "configuration_url": null
      }

here is entity registry entries for two of switches:

        "area_id": null,
        "capabilities": null,
        "config_entry_id": "c15117d70da04dab9268baa9e726ecc5",
        "device_class": null,
        "device_id": "d66ffa5b25fe9571a634bca7ab9264e5",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "switch.tz3000_cfnprab5_ts011f_switch_2",
        "hidden_by": null,
        "icon": null,
        "id": "f33b3fa4bf8b0c20f2f0fb6476044450",
        "has_entity_name": true,
        "name": null,
        "options": {},
        "original_device_class": null,
        "original_icon": null,
        "original_name": "Switch",
        "platform": "zha",
        "supported_features": 0,
        "unique_id": "a4:c1:38:70:05:03:ba:d2-2",
        "unit_of_measurement": null
      },
      {
        "area_id": null,
        "capabilities": null,
        "config_entry_id": "c15117d70da04dab9268baa9e726ecc5",
        "device_class": null,
        "device_id": "d66ffa5b25fe9571a634bca7ab9264e5",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "switch.tz3000_cfnprab5_ts011f_switch_3",
        "hidden_by": null,
        "icon": null,
        "id": "fae28ec2dca3bcd5cc83bc517374d58a",
        "has_entity_name": true,
        "name": null,
        "options": {},
        "original_device_class": null,
        "original_icon": null,
        "original_name": "Switch",
        "platform": "zha",
        "supported_features": 0,
        "unique_id": "a4:c1:38:70:05:03:ba:d2-3",
        "unit_of_measurement": null
      },

Additional information

I have tried removing and re-adding several times accross builds. I have also checked that each switch is allocated a seperate id. In the entity registry, each switch is seemingly allocated a unique 'unique id'

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

zha documentation zha source (message by IssueLinks)

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

Hey there @dmulcahey, @adminiuga, @puddly, 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)

ftreil commented 2 years ago

I have the same issue with the same device .

Try the same removing and re-adding without any success.

It will be great if you can have a look.

Regards.

Bodge-IT commented 2 years ago

Not sure if this helps but the behavior in HA reflects the behavior of the device when the global on/off switch is used on device. So is it possible that the switches in HA are all just tied into the on/off button on the device and not the individual sockets and usb ports?

harveyorg commented 2 years ago

Just started with ZHA and wondering if zibee2mqtt solves any of this. But quickly reading round the ZHA docs it looks like a "Quirk" is needs to be written. I've no idea how to do that at the moment but mentioned somewhere else the actual details maybe embedded in this code for Hubitat

(I have the same problem as of an hour ago with my amazon delivery)

harveyorg commented 2 years ago

looking at logs I see some negotiation which eventually gets to: [zigpy.application] Device is initialized <Device model='TS011F' manuf='_TZ3000_cfnprab5' nwk=0x8F2C ieee=a4:c1:38:05:92:6c:92:19 is_initialized=True>

It then scans for matching quirks [zigpy.quirks.registry] Considering <class 'zhaquirks.tuya.ts011f_plug.Plug_4AC_2USB'> [zigpy.quirks.registry] Fail because input cluster mismatch on at least one endpoint

This looks like a good candidate for what's going wrong - I found the code for that Quirk and there's a whole chat which looks like they have found a fix: https://github.com/zigpy/zha-device-handlers/issues/1632

mischaelschill commented 1 year ago

ZB2MQTT had the same issue and solved it: [https://github.com/Koenkk/zigbee2mqtt/issues/13843] Maybe this fix could be ported?

dmulcahey commented 1 year ago

It already was… someone just needs to PR it. The discussion is in the linked issue in the post above yours.

harveyorg commented 1 year ago

apologies. I've not done that before so was beginning to look up what the process is - and the inconvenience of having a day job... I'll get round to it - but if someone else wants to do it, I'm sure it's not too complicated.

dmulcahey commented 1 year ago

and the inconvenience of having a day job...

This plagues most of us :)

issue-triage-workflows[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 Home Assistant 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.

Bodge-IT commented 1 year ago

If someone can point a direction, I'll try and work through this to get it in. My device just holding the door open right now

Bodge-IT commented 1 year ago

OK, this works after adding the custom_zha_quirks folder to /config and installing the appropriate quirk. See #1632

TheJulianJES commented 1 year ago

It should really be merged into zha-quirks, so you don't have to use a custom quirk. Since the linked issue should be fixed, would you mind opening a new issue in this repo: https://github.com/zigpy/zha-device-handlers/issues/new/choose and provide the device diagnostic information from before (and after) you installed the custom quirk and a link to the GitHub commented that contains the exact custom quirk that you used? (or just upload the custom quirk there) Then we can better track all custom quirks that are used and have yet to be merged.

Bodge-IT commented 1 year ago

Hi @TheJulianJES I should be able to do this over the weekend.

TheJulianJES commented 1 year ago

Awesome, thanks!

Bodge-IT commented 1 year ago

OK, I removed the quirk config, removed the device and restarted. My HA version is now 2023.3.3. I re-added the device and now it still works, no quirks. I don't think that's expected unless the issue has now been resolved?

Looks like this one is baked in.