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
71.89k stars 30.12k forks source link

Zigbee ZHA IKEA 4 button, left & right hold has the same event and cannot be distinguished #65676

Closed magiva closed 2 years ago

magiva commented 2 years ago

The problem

Zigbee Home Automation, entity created for the IKEA N2 4 button remote, creates 1 entity, none for the buttons. If i monitor the event (in NodeRed), the events for left and right (HOLD) buttons are identicial and cannot be separated for actions

Right press image

Left press image

Initially i thought i could use the args array as i see 256 for right and 257 for left but these values are only for single press and are replace with other values that cannot be used such as length of hold time. so, technically single press can be identitied but a held press cannot.

What version of Home Assistant Core has the issue?

core-2022.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Zigbee Home Automation

Link to integration documentation on our website

No response

Example YAML snippet

none

Anything in the logs that might be useful for us?

none

Additional information

none

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, 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)

odtgit commented 2 years ago

Same issue, would be nice to get the full N2 remote capabilities into ZHA

MattWestb commented 2 years ago

Light controllers / remotes dont have states and HA is not making any state object like one switch for one light that can being in on or off state. Light controllers is sending events and left long press is sending:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:5f:89:0e",
        "unique_id": "84:2e:14:ff:fe:5f:89:0e:1:0x0005",
        "device_id": "aa42725b886f32ed46f7d33aedadb25d",
        "endpoint_id": 1,
        "cluster_id": 5,
        "command": "hold",
        "args": [
            3329,
            0
        ]
    },

And right:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "84:2e:14:ff:fe:5f:89:0e",
        "unique_id": "84:2e:14:ff:fe:5f:89:0e:1:0x0005",
        "device_id": "aa42725b886f32ed46f7d33aedadb25d",
        "endpoint_id": 1,
        "cluster_id": 5,
        "command": "hold",
        "args": [
            3328,
            0
        ]
    },

= both unique and always sending the same command.

If you using the device automation it shall working OK but its one light controller and the function its sending then long pressing the left and right button is one reset cycle for IKEA lights scenes so its many command sent that can making problems if not triggering on the right event.

Adminiuga commented 2 years ago

what firmware version is running on the button? Provide debug logs with incoming traffic from the remote.

The ZHA events are based purely on the data sent by the remote. If the remote does not send distinctive commands for long presses, there nothing ZHA could do to correct that. But you could try upgrading the firmware on the button.

magiva commented 2 years ago

Upon reading the note about using args 3328,3329. I went back to repeat my findings before logging this issue. When i initially tested, i was getting what looked like random numbers in args 0,1 and 2. the random numbers looked like time-held, which is why i logged the issue as i couldnt see anything to use as an identity when held.

Today, when i test, i get exactly as you describe, 3328 and 3329, no other arguments.... for "hold" the whole process of press and hold is as shown here image So the only specific ID is for holding, not for release and is different on press when that leads to hold (shows arg 2)

A single press and release (for right arrrow) is identified differently as arg 256 image

In one sense this is great but in another, i dont like that it changed without reason? did you update something ?.
I know ive updated the minor HA versions x.x.2 It would be nice if it was identifiable throughout the whole hold process, identifying release would have to be assumed and of course why isnt it "stop" as it is for on-hold, which also serves nodered functions such as loops that stop when a stop is received.

MattWestb commented 2 years ago

The last change of the quirk is in the end of October and it was working then i was testing it for the PR.

The remote is one spammer and we cant doing anything about it the the long press is for resting / syncing IKEA light in the bounded group.

Its some commands that have random values sent but i dont remember if it was the release of left / right or if its way On/Off dimming commands.

Glad you have getting it working OK so you can using the remote.

github-actions[bot] commented 2 years 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.