seamus65
(Thomas Laurenson)
1
Blueprint for the Sonoff SNZB-01.
You can set functions for single press, double press and hold. This allows you to assign, e.g., a scene or anything else.
Blueprint screen:
Blueprint to import:

blueprint:
name: ZHA - Sonoff SNZB-01
description: 'Perform actions with the Sonoff SNZB-01 Button.
You can set functions for single press, double press and hold. This allows you to assign,
e.g., a scene or anything else.'
domain: automation
input:
remote:
name: Remote
description: Sonoff Button to use
selector:
device:
integration: zha
manufacturer: eWeLink
model: WB01
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: {}
hold:
name: Hold
description: Action to run on hold
default: []
selector:
action: {}
source_url: https://gist.github.com/seamus65/2be0f8c665ac8c1e011fbd1a0937f9e1
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions:
- '{{ command == "toggle" }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'single_press'
- conditions:
- '{{ command == "on" }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'double_press'
- conditions:
- '{{ command == "off" }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'hold'
5 Likes
llamafilm
(Elliott Balsley)
2
How can I import this blueprint? It gives an error because the name not end with .YAML
1 Like
rahulpuk
(Rahul)
3
This is what worked for me:
- Copy the above source code
- Follow the steps under the section ‘Keeping blueprints up to date’ on this page Using Automation Blueprints - Home Assistant
- Instead of directly following step 2, create your own folder, then create your own empty yaml file in that folder.
seamus65
(Thomas Laurenson)
4
I have corrected this now.
Sorry, I missed that when I created it.
1 Like
Dutchy-79
(Dutchy 79)
5
I have a Snzb-01 connected through Z2M and when using this blueprint it says no matching devices found.
Any suggestions?
1 Like
seamus65
(Thomas Laurenson)
6
This blueprint is for devices through ZHA, but there shouldn’t be any reason you couldn’t update the blueprint YAML to suit your devices through Z2M.
i dont know what im doing wrong but it doesn’t work at my automation…
alias: ZHA - Sonoff SNZB-01
description: ""
use_blueprint:
path: seamus65/ZHA - Sonoff SNZB-01.yaml
input:
remote: ca1970d941f9f6b6a5faf6a240e104ad
single_press:
- type: toggle
device_id: 18766ba1f1d08ef8059f3f97b2891d03
entity_id: light.signify_netherlands_b_v_lca001_huelight
domain: light
hold: []
blackbeard
(blackbeard)
8
Works perfectly for me!
Thank you for this beautiful Blueprint 
- Core 2023.11.3
- Supervisor 2023.11.6
- Operating System 11.2
patrickmx
(Patrickmx)
9
Hi,
If you’re using Sonofflan, try this :
platform: state
entity_id:
- sensor.sonoff_a44XXXXX #YourSensorID
to: single
This trigger works well for me Home Assistant 2024.3.0 (docker container)
You can use those 3 events:
suityou69
(Only Me)
10
For anyone else like me landing here and getting the no devices found message after running the blueprint the answer is a quick copy and paste into the YAML, with a YAML restart. I followed the guide here : Add Sonoff Zigbee Wireless Switch To Home Assistant - Smart Home Sysadmin.