Hi al, I’m really struggling with getting a mqtt publish in my scripts.yaml file. With the musquitto client I am able to send my mqtt message with the following command:
mosquitto_pub -h localhost -p 1883 -m '{"command": "switchlight", "idx" : 223, "switchcmd": "On" }' -t domoticz/in
When I try to put it in my scripts.yaml I keep getting errors in my log regarding to my scripts.yaml file, I finally got something that give no error, but now it simply does not work. This is what I got now:
mqqtappletv:
alias: 'Send AppleTV state to Domoticz'
sequence:
- service: mqtt.publish
data:
topic: "command: switchlight, idx: 223, switchcmd: On"
payload: "domoticz/in"
I tried many different things, adding ’ or " or { and } but nothing seems to work so far. I hope someone has the answer!