#Send custom event from esphome and filter it using device id from blueprint selector

1 messages · Page 1 of 1 (latest)

granite pollen
#

I am trying to filter out events from a particular device in a blueprint and I was planning to use the device selector. However, I have no idea how to get the device id in esphome to add it to the event_data

bleak cedar
thick crag
#

Hi I think I'm trying to do the same thing. I'm creating a blueprint that is triggered by dahua_event_received, and toggles input_booleans for the different event types. I have an input selector that lets me pick a camera, but it returns a device ID, and need to turn that into the device name. I'm trying to user device_attr but I'm doing something wrong because HA refuses to import the blueprint. ```
variables:
camera_id: !input camera_name

triggers:

  • trigger: event
    event_type: dahua_event_received
    event_data:
    Code: !input motion_event
    DeviceName: {{ device_attr( {{ camera_id }} ,"name") }}
    action: Start
    conditions: [] while parsing a flow mapping in "<unicode string>", line 53, column 20: DeviceName: {{ device_attr( {{ camera_id }} , ... ^ expected ',' or '}', but got '{' in "<unicode string>", line 53, column 35: DeviceName: {{ device_attr( {{ camera_id }} ,"name") }} ^```
thick crag
jolly hill