Failed to call service mqtt/publish - when using brackets

if i try to use MQTT.Publish from dev tools / services i get Failed to call service mqtt/publish when using brackets.

{
"topic": "winthing/system/commands/open",
"payload":  ["notepad.exe", "C:\\file.txt", "C:\\"]
}

Failed to call service mqtt/publish

This works, but i need to send the full string with arguments above

 {
    "topic": "winthing/system/commands/open",
    "payload": "notepad.exe"
    }

Try this:
"payload": "['notepad.exe', 'C:\\file.txt', 'C:\\']"

This assumes you want to include the square brackets in the payload. If they aren’t required, just remove them from the example above but retain the double and single quotes as shown.

Thank you, but it doesn’t pass the text correctly, i get “invalid JSON” on the other side.

for now i set Node-red to listen for the topic, convert the payload and forward that to the host/server. that seems to be working well and very fast :slight_smile:

In your first post, you overlooked to mention you were attempting to pass a JSON string. Indeed it is invalid and requires correction.