Hi all -
I’m new to templates, so go easy on me! I’m trying use the payload from MQTT (JSON) send up to 3 dynamic IR commands (d1, d2, d3). I wrote my YAML as follows:
alias: TestMQTT
description: ""
trigger:
- platform: mqtt
topic: homeassistant/playc
condition: []
action:
- service: remote.send_command
data:
device: Sony CD Player
command: {{ trigger.payload_json.d1 }}
target:
device_id: xxxxxxxxxxxxxxxxxxxxx
mode: single```
Home assistant changes the code to:
alias: TestMQTT
description: ""
trigger:
- platform: mqtt
topic: homeassistant/playc
condition: []
action:
- service: remote.send_command
data:
device: Sony CD Player
command:
"[object Object]": null
target:
device_id: xxxxxxxxxxxxxxxxxxxxx
mode: single
So, clearly I’m doing something wrong and I’d be grateful for any pointers. Thanks in advance!