Help with Adding Xsky 2-Button Dimmer Switch to ZHA for Automation Triggers

Hi all,

I’m currently using an Xsky 2-Button Dimmer Switch with Zigbee2MQTT, and everything works great when it comes to automations. I can use the switch’s on/off, dim up, dim down, and move to level actions as input triggers in my automations without any issues.

However, I’ve been facing a challenge when I try to integrate the same dimmer switch with ZHA (Zigbee Home Automation). Despite the switch working properly in Zigbee2MQTT, I’m unable to use the same behaviors (like on/off, dim up, dim down, move to level) as automation triggers in ZHA.

Here’s what I’ve tried:

  • I checked the ZHA integration in Home Assistant, but unlike Zigbee2MQTT, the switch’s actions don’t show up in the automation triggers.
  • I’ve already tried using the ZHA event listener in Developer Tools to capture zha_event, but I don’t see the expected behavior being triggered when I use the switch.

My setup:

  • I’m using a Sonoff Zigbee 3.0 USB Dongle.
  • The dimmer switch is working fine with Zigbee2MQTT, where I can easily trigger automation events like on, off, dim up, dim down, and move to level.

What I need help with:

  1. How can I get the Xsky 2-Button Dimmer Switch to trigger automation actions in ZHA?
  2. Is there something specific I need to configure in the ZHA integration to support these actions, or do I need to write custom quirks for the device?
  3. Is it possible to add support for this dimmer switch in ZHA using Home Assistant’s native functionality, or do I need to rely on Zigbee2MQTT for this?

I’d appreciate any guidance or suggestions from the community on how to make this work in ZHA, or if anyone has successfully managed to use a similar dimmer switch in their ZHA setup.

Thank you in advance!

First day on HA so forgive me if I’m messing up the names for everything. I’ve got the exact same setup as you and I’m able to see the zha_events for all of the button presses and create automations from those events. Did you put “*” in the “listen to events” box on the developer-tools/event page? The top button shows up as :

event_type: zha_event
event_data:
  device_id: c4084d303ff26e3a82782e5288c69ade
  command: "off"

and

event_type: zha_event
event_data:
  device_id: c4084d303ff26e3a82782e5288c69ade
  command: "on"

The bottom button shows up as :

event_type: zha_event
event_data:
  device_id: c4084d303ff26e3a82782e5288c69ade
  command: "move_to_level"
    args:
      - 102
      - 6

Note that the first arg changes but I’ve only been able to get 10, 102, 254.

I also noticed that if the switch gets out of range of the Zigbee dongle then it stops publishing any events at all until you remove the battery, so maybe that’s what happened to you.

I can confirm that the issue is not related to signal strength, as my switch is only 2-3 meters away from the Sonoff dongle. However, I cannot seem to see the event displays you mentioned above. Are you sure you’re using the Xsky dimmer switch, and that it can listen to events from zha_event without any additional configuration, with the button triggers showing up in HA automations automatically? I’ve been trying for a long time and compared it to the HUE Dimmer Switch, which indeed listens to events and shows triggers like single-click, double-click, etc. in HA automation. So, if it’s not a signal issue, where could the problem be?