Niko Zigbee switch no buttons in trigger, but buttons show up in logs when pressed

Hi,

a few days ago i posted a topic that i was not able to get the niko zigbee switch in HA.
That is working now.

However, i’m not able to get any actions assigned.
If i try to assign it, it show a couple of triggers, but the buttons are not one of those triggers:
But when i click the button, i can see in the logs that it reacts
So there should be 4 buttons that i could chose from.

Does anyone have any idea?

Kind regards

Buttons are generally events and not state changes, so you might need an event trigger.
You can see the button events by going to the Developer Tools and select the Event tab.
Then put * in the Listening for Events field.
Now click the Start listening button followed by the button on your device and finally the Stop listening button.

You will now have a list of all the events HA received in that timespan and somewhere in there will your button events be too.
Remember there can be multiple events for a button press, like button pressed, button hold, button hold, button hold, button released.
It is the device that decides what is sent and it is up to you to choose what events you want to react to.

Thanks for your reply.

I did what you said (for 1 button) and recieved the following:

event_type: zha_event
data:
  device_ieee: 00:3c:84:ff:fe:8b:e6:b1
  unique_id: 00:3c:84:ff:fe:8b:e6:b1:2:0x0006
  device_id: 8b163b8c2521a2e7a26dd4c993b591d7
  endpoint_id: 2
  cluster_id: 6
  command: "off"
  args: []
  params: {}
origin: LOCAL
time_fired: "2024-11-14T07:54:26.396187+00:00"
context:
  id: 01JCMTN66WEKCMZB54R96Z9ZF6
  parent_id: null
  user_id: null

How can i make an automation with this?

I use Node Red for the events, so I am not that much into the HA part of coding the triggers, but here is the documentation on it.

Thanks!
I went te lazy way and used chat gpt with the information i hade (i had the event, i had the action)
So chatgpt made me this:

alias: Toggle Light with Smart Switch
description: Toggle a specific light when the smart switch button is pressed
trigger:
- platform: event
event_type: zha_event
event_data:
device_ieee: "00:3c:84:ff:fe:8b:e6:b1"
command: "off"
condition: []
action:
- service: light.toggle
target:
device_id: e0620623385807d22e3abcd6ece07ab7
mode: single

Later today when i’m home i’ll test this.

ChatGPT is usually failing awfully with HA stuff, so I do not expect it to work.
The indentation looks all wrong as a startm but that might just be your copy-paste that failed there.

Also avoid using device_id. Use entity_id instead.

2 Likes

Oh okay, thanks for mentioning that.