ZHA event trigger for automations stopped working in 2022.4.0 [SOLVED]

Hiya,

After upgrading to 2022.4.0 my automations triggered by ZHA events, specifically the IKEA Tradfri 5 button remote events, stopped triggering. Recreating them from scratch didn’t work. Here’s the automation YAML and the event, anyone experienced anything similar? All help appreciated!

Automation:

- id: '1637252889679'
  alias: Bedroom Remote
  description: ''
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
      device_ieee: 00:0b:57:ff:fe:32:8a:3d
      unique_id: 00:0b:57:ff:fe:32:8a:3d:1:0x0006
      device_id: b0b2a3fc2644043a8b85e25b1798a985
      endpoint_id: 1
      cluster_id: 6
      command: toggle
      args: []
  condition: []
  action:
  - scene: scene.good_night
  mode: restart

Event:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:0b:57:ff:fe:32:8a:3d",
        "unique_id": "00:0b:57:ff:fe:32:8a:3d:1:0x0006",
        "device_id": "b0b2a3fc2644043a8b85e25b1798a985",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "toggle",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2022-04-07T08:59:46.315197+00:00",
    "context": {
        "id": "c9d4d55e929951568dc6428b99936e51",
        "parent_id": null,
        "user_id": null
    }
}

Thanks!

Try to delete the linie – args: [] — the actual release 2022.04 seems to have a problem with interpreting args.

KR

1 Like

See https://github.com/home-assistant/core/issues/69375

Sounds as if quirk will need to be updated now that zigpy was made fully compliant with ZCL R7/R8

https://www.home-assistant.io/integrations/zha#zha-exception-and-deviation-handling

https://github.com/zigpy/zha-device-handlers

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

Worked like a charm. Removing the args from event data solved the issue - and that also explains why automations triggered by other devices’ ZHA events worked fine, those did not have args in event data.

I’m lucky to be using only one button on that remote, but I’ve noticed that due to this bug it’s not possible to use the two ‘arrow’ buttons on that device - those button presses differ only by one arg value, so both are unusable, at least for now.

Thanks,

Marcin

After upgrading to 2022.4.1 all automations work correctly, even those where trigger event data contains the args.

Seems to have been solved fully now.

Apparently it does maybe not fix all issues

FYI, the backstory is that they missed to mention it in the many PR for ZHA that went into the Home Assistant 2022.4.0 release but there actually a few relatively huge updates/changes to both ZHA and its dependencies (zigpy and zha-quirks/ zha-device-handlers Zigbee libraries used by ZHA) for Home Assistant 2022.4.0 release that was not supposed to break anything but it did.

Among other things behind the scene, zigpy got a very large update to the very latest official Zigbee Cluster Library specification (to make it fully compatible with the Zigbee Cluster Library Specification Revision 7 and Revision 8 by the Zigbee Alliance), which should greatly improve device interoperability in the long run, meaning that fewer devices will need quirks in the future. But that was a very large change so there is no real surprise that things broke in the first Home Assistant 2022.4.0 release.

Once all those things that broke are found and fixed it should make ZHA more stable than ever and work out-of-the-box with more new Zigbee devices without the need for as many custom quirks.

The best thing if not wanting to actively help developers troubleshoot what broke is to restore a backup.

So either downgrade to Home Assistant 2022.3.x release and wait for a fix or help devs troubleshoot it:

https://github.com/home-assistant/core/issues/69375

If want to help, report issues with other devices so ZHA in Home Assistant core and quirks can be fixed:

https://www.home-assistant.io/integrations/zha#reporting-issues

to

https://github.com/home-assistant/core/issues

Most likely both zha-quirks (or zigpy) and a few individual device quirks need to be fixed to solve this:

https://github.com/zigpy/zha-device-handlers/

You can report issues with specific Zigbee devices so the quirk can be fixed in ZHA Device Handlers:

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

Tip is never upgrade to the first revisions of any new releases if you for stability want to avoid breakage.

If you are not looking to actively help developers troubleshoot then wait until a xxxx.x.6 releases or so.

1 Like

that probably at least partially explains why my move to a new sonoff dongle and ZHA (from a cc2531 and zigbee2mqtt) has been an absolute nightmare of failing automations and massively inconsistent zigbee performance.

I’m keeping with it, and don’t get me wrong really appreciate all the hard work, but the past 4 days have been my worst ever experiences with HA.

Roll on the fixes :slight_smile:

2 Likes

Again all issues with the IKEA Trådfri device quirks are not fully fixed yet, so not solved for everyone.

FYI, those curious can other than Home Assistant core issue #69375 also track ongoing work here:

https://github.com/home-assistant/core/pulls?q=is%3Apr+zha+created%3A%3E2022-04-06+

and

https://github.com/zigpy/zha-device-handlers/pulls?q=is%3Apr+created%3A%3E2022-04-06

and

https://github.com/zigpy/zigpy/pulls?q=is%3Apr+created%3A%3E2022-04-06

Most of the open and merged pull requests there from the 6th of April 2022 and on are related to this.

1 Like

This still doesn’t appear to be working properly in Home Assistant 2022.4.3 - still testing but the trigger “Turn on” button continuously pressed doesn’t appear to work at all. not sure about other long presses yet.

1 Like

If it is the IKEA 5 button remote then maybe ask in the issue for it if that should be reopened or if you should create a new issue for yours → https://github.com/home-assistant/core/issues/69375

1 Like

added comment - cheers @Hedda

@epmatt Are you looking at updating your Awesome HA Blueprints for IKEA Controllers to be compatible with new ZHA events as per https://github.com/home-assistant/core/issues/69375 ?