This is the blueprint for the Sonoff Zigbee Wireless Switch (SNZB-01):
Supported actions:
- Single press
- Double press
- Long press (4 seconds)
Get started
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint using the forum topic URL:
blueprint:
name: Zigbee2MQTT - Sonoff SNZB-01 Zigbee Wireless Switch (rdeangel_mod)
description: Automate your Sonoff SNZB-01 Zigbee Wireless Switch via Zigbee2MQTT. (rdeangel_mod)
domain: automation
input:
mode:
name: Automation Modes
description: https://www.home-assistant.io/docs/automation/modes/
default: parallel
selector:
select:
mode: dropdown
options:
- single
- restart
- queued
- parallel
multiple: false
sort: false
custom_value: false
switch:
name: Sonoff SNZB-01 Zigbee Wireless Switch
description: Sonoff SNZB-01 Zigbee Wireless Switch to use
selector:
entity:
integration: mqtt
domain:
- sensor
multiple: false
single_press:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
double_press:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
long_press:
name: Long Press
description: Action to run on long press (4 seconds)
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zigbee2mqtt-sonoff-wireless-switch-snzb-01-rdeangel-mod/663331
mode: !input mode
max_exceeded: silent
trigger:
- platform: state
entity_id: !input switch
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'single' }}"
sequence: !input single_press
- conditions:
- "{{ command == 'double' }}"
sequence: !input double_press
- conditions:
- "{{ command == 'long' }}"
sequence: !input long_press
Please note: This is not a new blueprint, it is just a fix to an existing one posted originally by @Stringer here. The fix I applied was brought up to my attention by @Daveee here in the origina blueprint.
Change Log:
30/12/2023
- added dropdown to choose Automation Mode type (default is “parallel”), see Automation modes - Home Assistant