Hello,
I have tried for two days to post a curl command to a openDTU, but I was not sucessful
I want to set a limit and send it to the openDTU (to set a limit in an microinverter). I can set the limit with a curl command on the commandline, but not from red node.
Can somebody help me?
curl command:
curl -u "admin:password" http://192.168.178.70/api/limit/config -d 'data={"serial":"11418295xxxx", "limit_type":1, "limit_value":20}'
Here is my code:
[
{
"id": "3fbcc579.1dc12a",
"type": "inject",
"z": "12358896a07574c6",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 100,
"y": 760,
"wires": [
[
"acdcd415afc52c74"
]
]
},
{
"id": "261e81ee.00f02e",
"type": "debug",
"z": "12358896a07574c6",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 760,
"wires": []
},
{
"id": "acdcd415afc52c74",
"type": "change",
"z": "12358896a07574c6",
"name": "",
"rules": [
{
"t": "set",
"p": "data",
"pt": "msg",
"to": "{\"serial\":\"11418295xxxx\", \"limit_type\":1, \"limit_value\":20}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 280,
"y": 760,
"wires": [
[
"ee69209909c23b7c"
]
]
},
{
"id": "ee69209909c23b7c",
"type": "http request",
"z": "12358896a07574c6",
"name": "",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://192.168.178.70/api/limit/config",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "basic",
"senderr": false,
"headers": [],
"x": 470,
"y": 760,
"wires": [
[
"261e81ee.00f02e"
]
]
}
]