Set Default Output Power for Growatt Noah 2000
This flow set the default output power of a Growatt Noah 2000 to 200 Watt.
Prerequisits:
- Password must be hashed
- You need the serial no of the Noah 2000 --> you can get this by calling following APIs: -- https://openapi.growatt.com/PlantListAPI.do --> Get plant ID --> https://openapi.growatt.com/noahDeviceApi/noah/isPlantNoahSystem?plantId=xxxxx
[{"id":"70abf13dc8898e02","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"7a9bb3b7a270c042","type":"inject","z":"70abf13dc8898e02","name":"Manuell","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"2","topic":"","payload":"","payloadType":"date","x":210,"y":160,"wires":[["94144329fb1082b3"]]},{"id":"94144329fb1082b3","type":"change","z":"70abf13dc8898e02","name":"Set username und password","rules":[{"t":"set","p":"payload","pt":"msg","to":"userName=xxxxx&password=xxxxhashedPWxxx","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":160,"wires":[["3fa9e65314f7172f"]]},{"id":"3fa9e65314f7172f","type":"http request","z":"70abf13dc8898e02","name":"Login","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://openapi.growatt.com/newTwoLoginAPI.do","tls":"602f4de630dce848","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/x-www-form-urlencoded"}],"x":690,"y":160,"wires":[["cc66915770060e13"]]},{"id":"ba50888d4e8a2548","type":"function","z":"70abf13dc8898e02","name":"setCookies and body - output watt","func":"msg.payload = \"serialNum=xxxxxxxxxxxxx&type=default_power¶m1=200\";\nmsg.cookie = flow.get('cookie');\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1200,"y":160,"wires":[["43297fdb0acc8337"]]},{"id":"43297fdb0acc8337","type":"http request","z":"70abf13dc8898e02","name":"Set Default Power","method":"POST","ret":"obj","paytoqs":"ignore","url":"https://openapi.growatt.com/noahDeviceApi/noah/set","tls":"602f4de630dce848","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[{"keyType":"other","keyValue":"Content-Type","valueType":"other","valueValue":"application/x-www-form-urlencoded"},{"keyType":"other","keyValue":"Cookie","valueType":"msg","valueValue":"cookie"}],"x":1490,"y":160,"wires":[[]]},{"id":"cc66915770060e13","type":"function","z":"70abf13dc8898e02","name":"extract headers and save","func":"const cookie1 = msg.headers[\"set-cookie\"][0].split(';')[0] + '; ';\nconst cookie2 = msg.headers[\"set-cookie\"][1].split(';')[0] + '; ';\nconst cookie3 = msg.headers[\"set-cookie\"][2].split(';')[0];\n\nflow.set(\"cookie\", cookie1 + cookie2 + cookie3); \nreturn flow;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":910,"y":160,"wires":[["ba50888d4e8a2548"]]},{"id":"602f4de630dce848","type":"tls-config","name":"I don't care","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false,"alpnprotocol":""}]