I’m trying to run a shell command (to send an infrared code with lirc) based on an MQTT payload. I was hoping this would be farily easy but for some reason the below setup doesn’t work yet. The script receives no parameters…
automation:
- id: irsend
alias: IR Send
trigger:
platform: mqtt
topic: "home/irsend/pi1"
action:
service: shell_command.irsend
data_template:
device: '{{ trigger.payload_json.device }}'
key: '{{ trigger.payload_json.key }}'
shell_command:
irsend: /home/homeautomation/homeassistant/scripts/media/irsend.sh "{{ device }}" "{{ key }}"
The irsend.sh
shell script runs but receives no arguments. The MQTT stream seems fine:
home/irsend/pi1 {"VIP1853":"KEY_1"}
I already tried around playing with different quote encapsulation in the irsend shell_command, but that didn’t help either.
Does anybody see what I’m missing or doing wrong here? Or have I found a bug?