How to get data with JSON from inverter

I~m pretty new with programming languages, Nod red and JSON.
I want to get data from a SMA Webbox with "JSON". I already created a couple of nodes (inject node -> change node -> http request node -> debug) has per [Cybertron](https : // How to send a post request with content) post. The "Manufacturer" realesed a guide ( where it says that teh request should be in the following form:

"version": "1.0",
"proc": "GetPlantOverview",
"id": "1",
"format": "JSON" }

Also the URL for all requests is: http : // IP address/rpcThe IP address in each case is the currently configured IP address of the Sunny WebBox. The default setting is, the default URL is the following: http: // request is transmitted via HTTP POST in the body of the HTTP request as a serialized JSON object according to the conventions established in Section 4.1.

Can somebody give me some light? Any clues how to achieve the goals...

Appreciate for some help.


Hi Ricardo,

Try this .. we use an inject node .. to triger a function node that sets up a http post request node .. and we get the result in debug.

[{"id":"5650b8fb.a434","type":"http request","z":"9f2f6aea.6d2be","name":"","method":"use","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":630,"y":900,"wires":[["e576fd9b.022f98"]]},{"id":"e576fd9b.022f98","type":"debug","z":"9f2f6aea.6d2be","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":900,"wires":[]},{"id":"10c5cdd5.0cf0da","type":"inject","z":"9f2f6aea.6d2be","name":"read","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":250,"y":900,"wires":[["6cff2930.174fe8"]]},{"id":"6cff2930.174fe8","type":"function","z":"9f2f6aea.6d2be","name":"http post config","func":"\nmsg.headers = {}\nmsg.method = \"POST\"\nmsg.url = \"\";\nmsg.headers[\"content-type\"] = \"application/json\"\n\nmsg.payload = {\n\"version\": \"1.0\",\n\"proc\": \"GetPlantOverview\",\n\"id\": \"1\",\n\"format\": \"JSON\" }\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":900,"wires":[["5650b8fb.a434"]]}]

Hi UnborN,

Thanks for the quick reply. Where should try the code, in the inject node? Sorry for my nobby question.


Ricardo Guita

You have to import the flow in Node-red
Details on how to do that can be found here

The inject node is there just to trigger the http request

Did the import but some errors poped up

Sunny WebBox

File ExpectationFailed

file: temp\wwwroot\
BuildAndSendResponse failed


The actual value didn came up


You imported the flow and then you 'Deploy' ?

If you are just starting Node-red i would recommend going through some really good video tutorials HERE

Can you send us a screenshot of the error ?


Hi UnborN,

Yes I did the Deploy, but it seems that the connection didn´t worked has it should. I alsow changed the IP address of my device (Webbox).



Try replacing the function node code with this :

//msg.headers = {}
msg.method = "POST"
msg.url = "";
//msg.headers["content-type"] = "application/json"

msg.payload = 'RPC={"version": "1.0","proc": "GetPlantOverview","id": "1","format": "JSON" }'

return msg;


Here the working code:

        "id": "f85209eb.14f638",
        "type": "function",
        "z": "6ca02d32.524864",
        "name": "http post config",
        "func": "\n//msg.headers = {}\nmsg.method = \"POST\"\nmsg.url = \"\";\n//msg.headers[\"content-type\"] = \"application/json\"\n\nmsg.payload = 'RPC={\"version\": \"1.0\",\"proc\": \"GetPlantOverview\",\"id\": \"1\",\"format\": \"JSON\" }'\n\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 380,
        "y": 260,
        "wires": [

[Edited to format correctly]

Thanks for your help UnborN.


You are welcome .. so im guessing it worked ?

by the way when you paste code in the forum .. paste it using the < / > icon so it gets formatted correctly. As it is now i cannot import your flow

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.