I recommend that you try Node Red, - it’s very much easier.
Jim
Hi, Installed the Integration from Hacs but unsure about configuration
I selected any other for integration firing events to listen for.
This is my log from hza_event
Event 1 fired 5:22:
{
"event_type": "zha_event",
"data": {
"device_ieee": "00:12:4b:00:1f:91:92:1f",
"unique_id": "00:12:4b:00:1f:91:92:1f:1:0x0006",
"endpoint_id": 1,
"cluster_id": 6,
"command": "toggle",
"args": []
},
"origin": "LOCAL",
"time_fired": "2020-08-20T04:22:23.187561+00:00",
"context": {
"id": "bec98dbae29c11eaabda8592a0fd5882",
"parent_id": null,
"user_id": null
}
}
I tried this configuration
This is what I am seeing, bad_state ?
This is the device info
Any pointers to guide me on the configuration?
Regards,
What Radio are you using?
flashed with Tasmota
I know the Switch is working as I have it set up as an automation, Trigger type event, event type zha_event and works fine.
Anyone know how to solve this without resorting to 3rd party HACS?
I see so many problems with people losing HACS configs during updates I’ve avoided it!
Would really like to see HA properly support events to entities…?
Thanks
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
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
Tibu, thank you for your solution , 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
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!
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
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.
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
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!
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!!!