I am experimenting with node-red
, connecting it to my MQTT broker.
The input (listening to a topic) works fine.
I also would like to send to a topic some payload ipon some triggers. In the example below, this would be on a query to a webservice:
I did not have a place to add the payload to the published message, where can I set it up?
The documentation mentions in the inputs section:
payload
most users prefer simple text payloads, but binary buffers can also be published.
and later
msg.payload
is used as the payload of the published message. If it contains an Object it will be converted to a JSON string before being sent. If it contains a binary Buffer the message will be published as-is.
I tried to add {msg: {payload: 'on'}}
or {payload: 'on'}
in node settings -> inputs but the payload is not carried to the MQTT, which hows an incoming cmnd/home/room1/switch1/power {}