In order to send a fix text over MQTT, I have added the following in my config.yaml:
automation:
- alias: Red1
trigger:
platform: state
entity_id: switch.R1_REL1
state: 'on'
action:
service: mqtt.publish
data: {"payload": "Test message from HA", "topic": "home/notification", "qos": 0, "retain": 0}
and I got error:
homeassistant.util.yaml: mapping values are not allowed here
in "/home/homeassistant/.homeassistant/configuration.yaml", line 241, column 19
Please tell me what syntax to use here. Thank you