Hello, I am working on this and getting quite close to having it working, but cannot work out how to extract/escape the following commans string
I have an event as
event_type: zha_event
data:
device_ieee: f4:b3:b1:ff:ff:db:a2:1a
unique_id: f4:b3:b1:ff:ff:db:a2:1a:1:0x0006
device_id: 66d1194921a9470cd8365540f29e29e8
endpoint_id: 1
cluster_id: 6
command: remote_button_short_press
args: []
params: {}
origin: LOCAL
time_fired: "2023-03-28T07:47:42.610455+00:00"
context:
id: 01GWKJZRWJ39R2PDRFZ933DCZ3
parent_id: null
user_id: null
All I need to extract is the endpoint_id and command. For testing, I am just trying to notify to Telegram as
alias: Kitchen buttons
description: Test of kitchen buttons
trigger:
- platform: event
event_type: zha_event
event_data:
device_ieee: f4:b3:b1:ff:ff:db:a2:1a
device_id: 66d1194921a9470cd678e540f29e29e8
condition: []
action:
- service: notify.telegram_test
data:
message: >-
The endpoint is {{ trigger.event.data.endpoint_id }} and the command is {{
trigger.event.data.command }}
mode: single
If I have just the endpoint_id, it works fine, but once I add the command, it doesn’t send anything. I assume that it’s due to the fact that this is a string, but I don’t know how to handle/escape it.
Can anyone offer some guidance?