Thank you very much, it’s a cool Blueprint!
But it’s have a little problem with the default actions handling. I changed little bit the code and fixed it:
---
blueprint:
name: Sonoff Zigbee Button
description: Automate the Sonoff Zigbee WB01
domain: automation
input:
sonoff_button:
name: Sonoff Button
selector:
device:
integration: zha
manufacturer: eWeLink
model: WB01
toggle_action:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
on_action:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
off_action:
name: Long Press
description: Action to run on long press
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input sonoff_button
variables:
toggle_action: !input toggle_action
on_action: !input on_action
off_action: !input off_action
action:
- variables:
command: '{{ trigger.event.data.command }}'
- choose:
- conditions:
- '{{ command == "toggle" }}'
sequence: !input toggle_action
- conditions:
- '{{ command == "on" }}'
sequence: !input on_action
- conditions:
- '{{ command == "off" }}'
sequence: !input off_action
Hi, Thanks for this blueprint. It’s working good. I am a beginner and I just want your help.
For example, when I single press the button, it will switch on my rice cooker. And I want the rice cooker to switch off automatically after 50 mn. For that, I already have an automation with trigger. Here is the code:
platform: state
entity_id: switch.sonoff_cooker
to: 'on'
for: '0:00:50'
I’m really not an expert on automation, but to achieve what you want I would probably do it all in the one action. Turn on the cooker, then set a delay of 50 mins, then turn it off.
I have sonoff zigbee SNZB-01.
I tried adding your blueprint to to the blueprint folder. But when I restart HA, I get automation error, and the whole automation section dissapears unless I delete the blueprint.
HELP!
First, thanks for this blueprint which exactly what i’m looking for.
I have a sonoff switch which seems to be correctly recognize by HA :
But when i try to create an automation with the blueprint, i’m not able to select the switch.
It tells me that i do not have a Sonoff Zigbee Switch :
I think that the reason why i’m not seeing any devices is due to the fact that i’m using Foscom Deconz as an integration and not ZHA.
But i don’t know which label i have to use instead of “zha” for the “integration”.
Problem solved by replacing “ZHA” par “deconz”.
Do I have to have a Sonoff bridge or a Sonoff dongle for the Sonoff Zigbee Switch to work with ZHA or can I use my existing ZHA setup with a Nortek GoControl HUSBZB-1 controller?
Hello GaryKrige, I’m brand new here and have no idea about the whole blueprint topic yet. Is it ok if I use your blueprint as a template for another device because I can not find any suitable template for the “Osram Switch Mini” here. Thanks
I’m using the single press to trigger an automation like the rice cooker one above (turn on, delay, turn off). But it seems like while that action is running (which because of the delay is quite long), the other two modes (double press, long press) don’t work. Is this what’s supposed to happen? And if so, is there any way to change it?
Thank you for this, it works really well.
Do you think it’s possible to make it so that a single button press will change the brightness of a light globe depending on the current brightness/state?
Not sure if it’s a good idea, but I’d like to experiment with 2 control options:
Make it so that a single press turn it ON at 100% brightness if it is currently OFF (toggle mode turns it on at the whatever brightness was set when it was switched off)
make it so that successive button presses will step through ON, 66%, 33%, OFF
I’m having trouble getting my head around the automation in home assistant.