Hi, within the new ZHA component, on a press of a button, there is an event coming in, based on the args, we know the what button is pressed on the remote, like up,down,left, right
the below code is a copy/paste from other members that have the same issue/question, but i want to create another thread for this, since its actually not ZHA related
also those other members were able to resolve it finally by using NodeRed instead of automation…
but i dont want to go that road…
so below code is the event coming in
{
"event_type": "zha_event",
"data": {
"unique_id": "0x1807:1:0x0005",
"device_ieee": "00:0d:6f:ff:fe:62:50:cf",
"command": "press",
"args": [
0,
1,
13,
0
]
},
"origin": "LOCAL",
"time_fired": "2019-08-19T00:32:25.590660+00:00",
"context": {
"id": "d344ee4083a34455aff7b04d3c66ba60",
"parent_id": null,
"user_id": null
}
}
the automation is like example:
- id: '1562807168430'
alias: Basement Remote - right arrow press
trigger:
platform: event
event_type: zha_event
event_data:
device_ieee: '00:0d:6f:ff:fe:62:50:cf'
command: 'press'
args:
- 0
- 1
- 13
- 0
condition: []
action:
- service: light.toggle
data:
entity_id:
- light.basement_couch_lights_level
or another example automation by another user
- alias: ikeaButton4
trigger:
- event_data:
args:
- 0
- 1
- 13
- 0
command: press
device_ieee: 90:fd:9f:ff:fe:fb:54:50
event_type: zha_event
platform: event
action:
- data:
entity_id: light.movie_box
service: light.turn_off
that should work but the problem is, that it disregards the args …
so for example
left button = 0,1,13,0
right button = 1,1,13,0
so whatever button is pressed, the automation always runs, thats the issue