Unable to pair Sonoff Zigbee SNZB-01/WB-01 Buttons

You do realise a button press is not an entity, its an event?

In the case of the ZB01 it appears that a short press is a toggle, two press in short succession gives ON and a long press gives us OFF

Use ZHA Event in Automation as a trigger.if you do not want to use third party app.

- id: '1597858866707'
  alias: ZHA Button
  description: ''
  trigger:
  - event_data:
      command: toggle
      device_ieee: 00:12:4b:00:1f:91:92:1f
    event_type: zha_event
    platform: event
  condition: []
  action:
  - data: {}
    entity_id: switch.ceiling_lights
    service: switch.toggle
  mode: single
4 Likes

Knowing the device_ieee value is there a way to configure the events so that they can be picked by the UI or even modify the device yaml to define them there (that would be best IMHO)

For a HA beginner like myself it is not 100% clear where this automation definition would go, sorry.

M

Ah well, automations.yaml would be the place it seems in case someone else is hunting.

Seems to work, in my case for a Sengled light, but still feels like a hack.

If somebody needs it: If you want to add it on the web interface you can do it by adding an automation and adding the trigger the following way:

device_ieee can be found out by listening to the zha_event in Developer Tools - Events

5 Likes

Tibu, thank you for your solution :ok_hand: , it is the right one for me.
I’m using SONOFF SNZB-01 with Conbee II.
I’m listening for the zha_event in automation:

  • toggle event (single click) toggle the wardrobe light
  • double click toggle the wardrobe light and bedroom light
    Crucial, for the beginner as me, your suggestion on how build it using device_ieee
    :vulcan_salute:

Maybe this blueprint can help simplify this a bit for you: Sonoff Zigbee Button Actions

3 Likes

Hi,

I just received a sonoff button but I can’t get it connected via the solutions above.

I tried:

  • Connecting it trough ZHA (Tasmotized ZBBridge). Connects perfectly but obviously only as a battery entitiy.

  • Listening to zha_event while clicking. Nothing. It only changes state when it goes offline when I reset the button.

  • Tried to add it trough EventSensor but no luck either.

As the zha_event doesn’t change, I guess the button doesn’t send any signal. Should the LED on the button blink when you press the button? Mine doesn’t do anything.

I’ve been investing waaaaaaay too much time in setting up a simple button here so I hope someone might have a solution for this issue! :slight_smile:

Thanks!

I am having this issue as well. I got it paired okay but when I sub to zha_event on the dev tool page and press the button, no messages are transpiring :frowning:

Hopefully this will help you guys. I managed to get it working by creating an automation and then taking a look at the code created by the automation.

If you’re not able to do that then here’s what you can do:

Go to the Zigbee switch you’ve paired to Home Assistant. Select the 3 dots next to Reconfigure Device, then select download diagnostics. In that file you’ll find a section that says “device_reg_id”, that’s what you need to fill in below like in my 3 examples.

Screenshot 2022-08-31 0006021

Here’s for the Single, Double and Long button presses.

  - alias: button test short
    description: ''
    trigger:
    - device_id: ccyrjekwklwlwlwlwlwlwlwlwkjskdjd
      domain: zha
      platform: device
      type: remote_button_short_press
      subtype: button
    condition: []
    action:
    - service: switch.toggle
      data: {}
      target:
        entity_id: switch.bedside_light
    mode: single
    
  - alias: button test long
    description: ''
    trigger:
    - device_id: ccyrjekwklwlwlwlwlwlwlwlwkjskdjd
      domain: zha
      platform: device
      type: remote_button_long_press
      subtype: button
    condition: []
    action:
    - service: switch.toggle
      data: {}
      target:
        entity_id: switch.bedside_light
    mode: single
 
  - alias: button test double
    description: ''
    trigger:
    - device_id: ccyrjekwklwlwlwlwlwlwlwlwkjskdjd
      domain: zha
      platform: device
      type: remote_button_double_press
      subtype: button
    condition: []
    action:
    - service: switch.toggle
      data: {}
      target:
        entity_id: switch.bedside_light
    mode: single
1 Like

I’m also having trouble with this. I understand the SN-ZB01 is an event, not an entity. But how do you get it paired in the first place so that HA can receive its events? I’m using Conbee II with ZHA. I tried putting it into pairing mode by holding the rest button for 5 seconds, then the red light flashes 3 times, but the ZHA “searching for Zigbee devices” page never finds it. I’ve tried holding the reset button continuously for a minute too.
I tried listening for zha_event on the developer tools page but when I press this button nothing happens — presumably because it hasn’t been paired yet.

any luck? i just got my buttons only to discover this thread! :frowning:

I got one of mine to pair with a brand new battery

I tried again on a more recent version of Home Assistant, and this time ZHA pairing worked fine. I just had to hold the reset button for 10 seconds with a paperclip.

Can confirm, this worked for me (using eWelink WB01, Sonoff Wireless Switch), simplest solution so far. Thanx!!!