Well your software is somewhat (2 years) newer than mine. So, in spite of the fact that at least one newer version has been released, my Envoy S has not been updated and probably never will. Let s wait.
As all your software, such as Mosquitto and NOde RED is running, I will publish my flow, I currently use.
1. The total solar production. This is similar than the Enphase hardware module, except that it uses another API endpoint.
2. Data of the individual inverters. Username/Password required. Thepassword is presented in the upper stream.
3. Status information of individual inverters and Q-relay (if used).
In the function nodes, you have to replace the inverter serial numbers (these are for privacy reasons random generated and not correct)in the "case" statements. Of course you have to use your own Domoticz idx numbers.
Try it, you will find detailed description is the posts above.
Code: Select all
[{"id":"d77c71e3.00c508","type":"http request","z":"7cd95b57.aab664","name":"Envoy-S Production Request","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://192.168.1.1/api/v1/production","tls":"","persist":false,"proxy":"","authType":"","x":680,"y":240,"wires":[["4475eb1a.8ba75c"]]},{"id":"32228b5e.6bbbe4","type":"inject","z":"7cd95b57.aab664","name":"Timer ( 30 seconds)","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"30","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":240,"wires":[["b2cc3304.b4e51","4709b3cb.376b2c"]]},{"id":"1bf22be8.529d6c","type":"http request","z":"7cd95b57.aab664","name":"Envoy-S Production/Inverter Request","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.1.1/api/v1/production/inverters","tls":"","persist":false,"proxy":"","authType":"digest","x":710,"y":300,"wires":[["8bcd8e7e.695e68"]]},{"id":"df136f90.4190e","type":"mqtt out","z":"7cd95b57.aab664","name":"Domoticz In","topic":"domoticz/in","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"2d06e6e96ce54335","x":1550,"y":300,"wires":[]},{"id":"b2cc3304.b4e51","type":"http request","z":"7cd95b57.aab664","name":"Envoy-S Inventory Request","method":"GET","ret":"obj","paytoqs":false,"url":"http://192.168.1.1/inventory.json","tls":"","proxy":"","x":680,"y":440,"wires":[["82d26dc0.154b1"]]},{"id":"a28e474b.bd602","type":"switch","z":"7cd95b57.aab664","name":"PCU/NSRB","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"PCU","vt":"str"},{"t":"eq","v":"NSRB","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1130,"y":440,"wires":[["2781e2d4.9e00ce"],["230846f0.9cc62a"]]},{"id":"2781e2d4.9e00ce","type":"split","z":"7cd95b57.aab664","name":"PCU/Objects","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":1330,"y":400,"wires":[["ad8308fd.9f2c4"]]},{"id":"ad8308fd.9f2c4","type":"split","z":"7cd95b57.aab664","name":"Split Inverters","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1540,"y":400,"wires":[["c68c28ef.b161d8"]]},{"id":"4475eb1a.8ba75c","type":"function","z":"7cd95b57.aab664","name":"Solar Production to Domoticz","func":"var msg1 ={};\nvar msg2 ={};\nvar msg3 ={};\nif ((msg.payload.wattsNow) < 0) (msg.payload.wattsNow) = 0;\nmsg1.payload = {\"command\":\"udevice\",\"idx\":279,\"nvalue\":0,\"svalue\":(msg.payload.wattsNow.toString()) + \";\" + (msg.payload.wattHoursLifetime.toString())};\nmsg2.payload = {\"command\":\"udevice\",\"idx\":280,\"nvalue\":0,\"svalue\":(((msg.payload.wattHoursSevenDays)/1000).toString())};\nmsg3.payload = {\"command\":\"udevice\",\"idx\":281,\"nvalue\":0,\"svalue\":(((msg.payload.wattHoursLifetime)/1000).toString())};\nreturn [[msg1,msg2,msg3]];","outputs":1,"noerr":0,"x":1050,"y":240,"wires":[["df136f90.4190e"]]},{"id":"82d26dc0.154b1","type":"splitter","z":"7cd95b57.aab664","name":"Split Objects","property":"payload","x":930,"y":440,"wires":[["a28e474b.bd602"]]},{"id":"230846f0.9cc62a","type":"split","z":"7cd95b57.aab664","name":"NSRB/Object","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":1330,"y":480,"wires":[["de90b27c.8778f8"]]},{"id":"de90b27c.8778f8","type":"split","z":"7cd95b57.aab664","name":"Split Q Relay","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1530,"y":480,"wires":[["191a77ab.81ecd"]]},{"id":"c68c28ef.b161d8","type":"function","z":"7cd95b57.aab664","name":"Solar Inverter Status to Domoticz","func":"if (msg.payload == \"PCU\"){\n msg.topic = \"PCU\";\n return [null,msg]\n} else {\n\nswitch (msg.payload.serial_num) {\n \n case \"121123456789\": //Solar Panel 1\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":288,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":288,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":288,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 1\";\n break;\n\n case \"121234567891\": //Solar Panel 2\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":289,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":289,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":289,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 2\";\n break;\n\n case \"1213456789012\": //Solar Panel 3\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":290,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":290,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":290,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 3\";\n break;\n\n case \"1215678901234\": //Solar Panel 4\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":291,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":291,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":291,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 4\";\n break;\n\n case \"1216789012345\": //Solar Panel 5\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":292,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":292,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":292,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 5\";\n break;\n\n case \"121890123456\": //Solar Panel 6\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":293,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":293,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":293,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 6\";\n break;\n\n case \"121098765432\": //Solar Panel 7\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":294,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":294,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":294,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 7\";\n break;\n\n case \"121098765431\": //Solar Panel 8\n if (msg.payload.producing & msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true)\n msg.payload = {\"command\":\"udevice\",\"idx\":295,\"nvalue\":1,\"svalue\":\"OK\"};\n if ((msg.payload.communicating || msg.payload.provisioned || msg.payload.operating === false) && (msg.payload.producing === true))\n msg.payload = {\"command\":\"udevice\",\"idx\":295,\"nvalue\":2,\"svalue\":\"Fault\"};\n if (msg.payload.producing === false)\n msg.payload = {\"command\":\"udevice\",\"idx\":295,\"nvalue\":4,\"svalue\":\"No Production\"};\n msg.topic = \"Zonnepaneel 8\";\n break;\n}\n}\nreturn [msg,null];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":360,"wires":[["df136f90.4190e"]]},{"id":"191a77ab.81ecd","type":"function","z":"7cd95b57.aab664","name":"Q Relay Status to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\nvar msg4 = {};\nvar msg5 = {};\n\nif (msg.payload == \"NSRB\"){\nreturn [null,msg]\n} else {\n\nswitch (msg.payload.serial_num) {\n \n case \"12112345698\": //Q Relay\n if (msg.payload.communicating & msg.payload.provisioned & msg.payload.operating === true){\n msg1.payload = {\"command\":\"udevice\",\"idx\":296,\"nvalue\":1,\"svalue\":\"OK\"};\n msg1.topic = \"Q Relay Status\";\n } else {\n msg1.payload = {\"command\":\"udevice\",\"idx\":296,\"nvalue\":2,\"svalue\":\"Fault\"};\n msg1.topic = \"Q Relay Status\";\n }\n if (msg.payload.relay == \"closed\"){\n msg2.payload = {\"command\":\"udevice\",\"idx\":297,\"nvalue\":1,\"svalue\":\"Closed\"};\n msg2.topic = \"Q Relay Contact Status\";\n } else {\n msg2.payload = {\"command\":\"udevice\",\"idx\":297,\"nvalue\":2,\"svalue\":\"Open\"};\n msg2.topic = \"Q Relay Contact Status\";\n }\n if (msg.payload[\"line1-connected\"] === true){\n msg3.payload = {\"command\":\"udevice\",\"idx\":298,\"nvalue\":1,\"svalue\":\"Connected\"};\n msg3.topic = \"Line 1\";\n } else {\n msg3.payload = {\"command\":\"udevice\",\"idx\":298,\"nvalue\":2,\"svalue\":\"Disconnected\"};\n msg3.topic = \"Line 1\";\n }\n if (msg.payload[\"line2-connected\"] === true){\n msg4.payload = {\"command\":\"udevice\",\"idx\":299,\"nvalue\":1,\"svalue\":\"Connected\"};\n msg4.topic = \"Line 2\";\n } else {\n msg4.payload = {\"command\":\"udevice\",\"idx\":299,\"nvalue\":2,\"svalue\":\"Disconnected\"};\n msg4.topic = \"Line 2\";\n }\n if (msg.payload[\"line3-connected\"] === true){\n msg5.payload = {\"command\":\"udevice\",\"idx\":300,\"nvalue\":1,\"svalue\":\"Connected\"};\n msg5.topic = \"Line 3\";\n } else {\n msg5.payload = {\"command\":\"udevice\",\"idx\":300,\"nvalue\":2,\"svalue\":\"Disconnected\"};\n msg5.topic = \"Line 3\";\n }\n break;\n}\n}\nreturn [[msg1,msg2,msg3,msg4,msg5],null];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":520,"wires":[["df136f90.4190e"]]},{"id":"c459ed4.7a2849","type":"inject","z":"7cd95b57.aab664","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["62206049.3d5c58"]]},{"id":"62206049.3d5c58","type":"http request","z":"7cd95b57.aab664","name":"Envoy-S Info Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.1/info.xml","tls":"","persist":false,"proxy":"","authType":"","x":380,"y":140,"wires":[["631034ee.648594"]]},{"id":"631034ee.648594","type":"xml","z":"7cd95b57.aab664","name":"","property":"payload","attr":"","chr":"","x":590,"y":140,"wires":[["d8a4ee6.0a3a09"]]},{"id":"d8a4ee6.0a3a09","type":"function","z":"7cd95b57.aab664","name":"Envoy-S Password","func":"var sn = msg.payload.envoy_info.device[0].sn[0];\nvar pw = sn.substr(6, 6);\nmsg.payload = pw;\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":140,"wires":[["20dd15ef.367a4a"]]},{"id":"20dd15ef.367a4a","type":"debug","z":"7cd95b57.aab664","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1010,"y":140,"wires":[]},{"id":"4709b3cb.376b2c","type":"time-switch","z":"7cd95b57.aab664","name":"Day Time switch","lat":"52.179281","lon":"5.606528","startTime":"sunrise","endTime":"sunset","startOffset":"-30","endOffset":"+30","x":400,"y":240,"wires":[["d77c71e3.00c508","1bf22be8.529d6c"],[]]},{"id":"86287b9b.69f7b8","type":"function","z":"7cd95b57.aab664","name":"Solar Production Inverters to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\n\nswitch (msg.payload.serialNumber) {\n\n case \"121234567890\": //Solar Panel 1\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":263,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":271,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"1216784321\": //Solar Panel 2\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":264,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":272,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"12187654321\": //Solar Panel 3\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":265,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":273,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"12134562189\": //Solar Panel 4\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":266,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":274,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"1215687219\": //Solar Panel 5\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":267,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":275,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"12187654321\": //Solar Panel 6\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":268,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":276,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"12198745623\": //Solar Panel 7\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":269,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":277,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n\n case \"12198765432\": //Solar Panel 8\n if ((msg.payload.lastReportWatts) < 0) (msg.payload.lastReportWatts) = 0;\n msg1.payload = {\"command\":\"udevice\",\"idx\":270,\"nvalue\":0,\"svalue\":((msg.payload.lastReportWatts).toString() + \";0\")};\n msg2.payload = {\"command\":\"udevice\",\"idx\":278,\"nvalue\":0,\"svalue\":(msg.payload.maxReportWatts).toString()};\n break;\n}\nreturn [[msg1,msg2]];\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":300,"wires":[["df136f90.4190e"]]},{"id":"8bcd8e7e.695e68","type":"split","z":"7cd95b57.aab664","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":970,"y":300,"wires":[["86287b9b.69f7b8"]]},{"id":"99bde26.878c82","type":"inject","z":"7cd95b57.aab664","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":320,"wires":[["1bf22be8.529d6c"]]},{"id":"2d06e6e96ce54335","type":"mqtt-broker","name":"Jonas_MQTT_Server","broker":"192.168.10.24","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]