Using nodered to run call service node

Hi there,

from a project we are trying to use we have the following flow for running a HA call service node, its just coming up with API error and i cant work out what the issue is, adding a debug node doesnt really tell me anything annoyingly :slight_smile:

this is the flow data for it:

"type": "api-call-service",
        "name": "Set ph value",
        "service_domain": "input_number",
        "service": "set_value",
        "data": "msg.payload",

i have added a debug node on the step before this one and confirmed that msg.payload does have the correct info (in this case a number)

im guessing it has something to do with the fact there doesnt seem to be a place to define exactly which entity id needs to be updated? but in the UI there doesnt appear to be a way to define this, im very new to both HA and Node Red so im probably missing something very obvious

this is the debug detail which is coming out which really tells me nothing

11 Apr 14:29:07 - [info] [debug:e35aaa88aa39b501]
{
  domain: 'input_number',
  service: 'set_value',
  data: {
    '0': 'm',
    '1': 's',
    '2': 'g',
    '3': '.',
    '4': 'p',
    '5': 'a',
    '6': 'y',
    '7': 'l',
    '8': 'o',
    '9': 'a',
    '10': 'd'
  }
}

any help would be hugey appreciated, ive been struggling with this project for a while now :slight_smile:

Export the relevant nodes and post them here.

i think this is right?

[
    {
        "id": "cdaddd511c6ba0db",
        "type": "api-call-service",
        "z": "4e3336ea709808e2",
        "name": "Set ph value",
        "server": "86b445a.684a7b8",
        "service_domain": "input_number",
        "service": "set_value",
        "data": "msg.payload",
        "mergecontext": "",
        "x": 1030,
        "y": 300,
        "wires": [
            [
                "e35aaa88aa39b501"
            ]
        ]
    },
    {
        "id": "86b445a.684a7b8",
        "type": "server",
        "name": "Home Assistant",
        "url": "http://localhost:8123",
        "pass": "",
        "llat": "<redacted>"
    }
]

Just a heads up. Based on your export I believe youโ€™re running a version of the HA nodes that most people on here are not going to be familiar with. https://flows.nodered.org/node/node-red-contrib-home-assistant-llat

The most common and maintained is going to be https://flows.nodered.org/node/node-red-contrib-home-assistant-websocket.

To address your issue:

If you change your output of the function node to move what you have in msg.payload to msg.payload.data and then remove msg.payload from the data field in the call-service node it should work.

thanks for that, i had been gussing with the nodes and actually had both the llad and the websocket ones installed, ive removed the llat one now and a lot of the errorrs i was getting actually went away which is awesome, its still failing but now its actually giving useful debug info and the errors are just because the value its trying to send exceeds the max it should be, so huge thanks for pointing me in the right direction :slight_smile:

spent 2 weeks trying to make this work and it was that simple haha

thanks hugely