#How to use the event trigger

1 messages · Page 1 of 1 (latest)

gloomy pike
#

Hello, can anyone give me some real-world examples on how to use the event trigger in an automation? I have these Philips Hue wall switch modules which unfortunately don't offer any switch or button entities but only fire events, so that's what I have to work with.

languid socket
#

Same way you would with any state change automation.

fading edge
#

First thing to do would be to go to capture what event it actually fires, so you can design a trigger. You can do this in developer-tools/events.

gloomy pike
gloomy pike
fading edge
#

Ok, well share what you see and we'll go from there.

gloomy pike
#

Ok, here's what the event monitor spits out: ```
event_type: zha_event
data:
device_ieee: 00:17:88:01:0c:c2:16:b7
unique_id: 00:17:88:01:0c:c2:16:b7:1:0xfc00
device_id: 5bda4e069a38a22a6eb82124ba7abe41
endpoint_id: 1
cluster_id: 64512
command: left_press
args:
button: left
press_type: press
command_id: 0
args:
- 1
- 3145728
- 0
- 33
- 0
- 0
params: {}
origin: LOCAL
time_fired: "2025-01-02T19:07:57.539800+00:00"
context:
id: 01JGM6NN73R1H9W6N8K5V1TK9S
parent_id: null
user_id: null

#

and: ```
event_type: zha_event
data:
device_ieee: 00:17:88:01:0c:c2:16:b7
unique_id: 00:17:88:01:0c:c2:16:b7:1:0xfc00
device_id: 5bda4e069a38a22a6eb82124ba7abe41
endpoint_id: 1
cluster_id: 64512
command: left_press_release
args:
button: left
press_type: press_release
command_id: 0
args:
- 1
- 3145728
- 2
- 33
- 1
- 0
params: {}
origin: LOCAL
time_fired: "2025-01-02T19:07:57.578276+00:00"
context:
id: 01JGM6NN8A59RZV4E7B0M6ZCDE
parent_id: null
user_id: null

#

I now need to translate that into a trigger statement.

#

Here's what I got so far:

trigger: event
event_type: zha_event
event_data:
  data: 
    device_id: 5bda4e069a38a22a6eb82124ba7abe41
    command: left_press_release
fading edge
#

Might be this:

event_type: zha_event
event_data:
  device_id: 5bda4e069a38a22a6eb82124ba7abe41
  command: left_press_release
gloomy pike
#

Looks like I got it right 🙂

#

well almost 😉