Sonoff SNZB-01 – Zigbee Wireless Switch

Buy Sonoff SNZB-01

This is another small and usefull device from Sonoff, and with the Zigbee protocol if fully compatible with Home Assistant using a ConBee II USB Stich and Zigbee2mqttcomponent.

But the integration with Home Assistant doesn’t create an entity as usual for a sensor or a switch, instead the button press is treated as an event.

Let’s see how to use this event on Home Assistant trough an Automation.

  • Open the back of your device and long press the RESET button until you see a led blink
  • Open Zigbee2mqtt control panel
  • Click Permit join (All)
  • Once the pairing is completed a new device SNZB-01 will be listed
  • Copy the Friendly name, we will need it later
  • From main Home Assistant menu click Configuration Automation
  • Click Add Automation
  • Click Edit in YAML from top right corner menu
  • Copy & Paste following code
  • Replace the mqtt topic device id with your own device Friendly name (from Zigbee2mqtt Control Panel)
  • Replace the action with what you want to do, for example turn on a light
alias: Sonoff Button
description: ''
  - platform: mqtt
    topic: zigbee2mqtt/0x00124b00232088b4
  - condition: template
    value_template: '{{ "single" == trigger.payload_json.action }}'
  - type: turn_on
    device_id: e6a2f5d32c80dc2af2d1f42aad3eb96c
    entity_id: light.dimmer_switch_4
    domain: light
mode: restart
  • Click Save
  • Now a single click on your Zigbee button to see light on!