Skip to main content

ZHA device - Smart Button

In this article we are going to cover zigbee smart button integration with ZHA (Zigbee Home Automation) in Home Assistant. The device we are using is

After pairing the smart button with ZHA, we will be only able to see two entities, battery and firmware which are totally not useful. No event is triggered when we press the button.

So we will need to download the ZHA Quirks and put in under /config/custom_zha_quirks/ folder.

Then we will need to add the following configuration to configuration.yaml:

zha:
enable_quirks: true
custom_quirks_path: /config/custom_zha_quirks/

Restart Home Assistant, remove the smart button and re-pair it again. Now we will be able to see the event when we press the button.

Now we can want to listen to the event and then trigger the automation. To know the event data, we can use the Developer Tools -> Events to listen to the event.

  • Event type: zha_event
  • Listening to: zha_event

Then click START LISTENING and press the button. We will see the event data like this:

event_type: zha_event
data:
device_ieee: a4:c5:33:31:f2:9e:d6:42
unique_id: a4:c1:38:32:ff:9e:46:42:1:0x0306
device_id: 309adaeeafesafeafdq39397cb7c0cc2dc497
endpoint_id: 1
cluster_id: 6
command: press_type
args:
- 1
params:
press_type: 1
origin: LOCAL
time_fired: "2024-07-29T14:11:33.678875+00:00"
context:
id: 01J3ZDA35E2R7JQ4RTPBMAC6FD
parent_id: null
user_id: null

Finally, We can use this data in our automation like below: