Pass entire service data in msg payload to call service node?

I have a function node with this:

msg.payload = {
    data: {
        "num_repeats": 1,
        "delay_secs": 0.4,
        "hold_secs": 0,
        "device": "ac",
        "command": "down"
    }
};
return msg;

which flows into a call service node with just the domain (remote), service (send_command), and entity (remote.broadlink).

I want to use the msg.payload as Data, but when I try to use {{ payload }} as an expression or JSON I get an error:

JSONataError: Expected ":", got "}"

How do I write this properly?

If you send that payload to a call service node. You don’t need to put anything in the data field. The call service accepts config value via the input.

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/node/action.html#input

1 Like

this worked. thank you