I’m having trouble getting automations to work when using template values with event triggers. In the below example the sensor sensor.bedroom_keyboard_remote_device_number is a command line platform sensor that gives the proper linux USB input device name using the command
printf "/dev/input/" ; ls -l /dev/input/by-id/usb-HAOBO_Technology_USB_Composite_Device_1120030400060620-if02-event-kbd | cut -d\> -f2 | cut -d\/ -f2
and this is the automation I was trying to use with it:
- id: 'Harmony replacement bedroom down'
alias: Harmony replacement bedroom down
trigger:
- platform: event
event_type: keyboard_remote_command_received
event_data:
device_name: "HAOBO Technology USB Composite Device Keyboard"
device_descriptor: '{{ states.sensor.bedroom_keyboard_remote_device_number.state }}'
type: key_down
key_code: 108
action:
- service: script.bedroom_appletv_down
This would allow me to have multiple remotes using the keyboard remote integration of the same brand/model plugged into the USB ports on the HA machine without mixing commands between AV equipment in different rooms. Any way I can verify the linux USB input device name using this command line sensor? I want it to verify with this sensor because it has been made to adapt even if the device event number changes with a reboot of the machine.