Sorry, wish I could help on the HA front but I stopped using it a while back, I’m focussing on Vera & OpenLuup. Although I’ll no doubt pick it up again at some point…
Hello, I am in the process of switching to HA and would like to integrate my LAN socket.
I discovered your MQTT script and wanted to try it right away.
Can you adapt the scripts to newer Python versions?
I can not start the scripts because I always get error messages that modules can not be imported, syntax errors and so on.
And from debugging and programming I have no plan.
Hi together,
I know this is a quite bit old thread, but this helped me out to get my EG-PMS2-LAN working properly (so far I can see) with home assistant.
So I will share my working config. The problem at @acme s post was, that the logout need the curl -X GET command.
Also the value of the socket should be determined in other way.
- switch:
name: EG-PMS2-LAN Nord - Socket 4
command_on: curl -s -d "pw=1" http://192.168.178.50/login.html && curl -s -d "cte4=1" http://192.168.178.50/ && curl -X GET http://192.168.178.50/login.html
command_off: curl -s -d "pw=1" http://192.168.178.50/login.html && curl -s -d "cte4=0" http://192.168.178.50/ && curl -X GET http://192.168.178.50/login.html
command_state: curl -s -d "pw=1" http://192.168.178.50/login.html && curl -X GET http://192.168.178.50/ && curl -X GET http://192.168.178.50/login.html
value_template: '{{ value.split("sockstates = ")[1].split("]")[0].replace("[", "").split(",")[3] == "1" }}'
I hope my post can help someone else, to get this working.
@Lordas, i have tried your suggestion but the problem remains the same.
After restarting the Home Assistant, all switches are displayed as “OFF”.
But two of my switches are definitely on. Am I doing something wrong?
Hi! Even though this is a quite old thread, I wanted to share my Node-RED flow with you. With the flow, I’m able to control an Energenie PMS2 LAN and retrieve its state. For the control via HA, I created switches from within Node-RED that will be registered in HA.
[{"id":"01d019b793c41636","type":"subflow","name":"Energenie PMS2 LAN","info":"","category":"home_assistant","in":[],"out":[{"x":520,"y":80,"wires":[{"id":"e565f6a5ed297146","port":1},{"id":"e565f6a5ed297146","port":0}]},{"x":520,"y":120,"wires":[{"id":"e0ff63322b58363c","port":0},{"id":"e0ff63322b58363c","port":1}]},{"x":520,"y":160,"wires":[{"id":"38c6654c48c27496","port":0},{"id":"38c6654c48c27496","port":1}]},{"x":520,"y":200,"wires":[{"id":"e9c92f4bee849acc","port":0},{"id":"e9c92f4bee849acc","port":1}]}],"env":[],"meta":{},"color":"#AAAA66","outputLabels":["Socket 1","Socket 2","Socket 3","Socket 4"],"icon":"font-awesome/fa-power-off","status":{"x":480,"y":40,"wires":[{"id":"299e6c990ec0b33e","port":0}]}},{"id":"e565f6a5ed297146","type":"ha-switch","z":"01d019b793c41636","name":"Energenie PMS2 LAN Socket 1","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"be97b35209b5413a","enableInput":true,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"state","propertyType":"msg","value":"","valueType":"entityState"},{"property":"socket","propertyType":"msg","value":"1","valueType":"num"}],"x":270,"y":80,"wires":[[],[]]},{"id":"e0ff63322b58363c","type":"ha-switch","z":"01d019b793c41636","name":"Energenie PMS2 LAN Socket 2","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"83a6eda8aa9174c5","enableInput":true,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"state","propertyType":"msg","value":"","valueType":"entityState"},{"property":"socket","propertyType":"msg","value":"2","valueType":"num"}],"x":270,"y":120,"wires":[[],[]]},{"id":"38c6654c48c27496","type":"ha-switch","z":"01d019b793c41636","name":"Energenie PMS2 LAN Socket 3","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"8c36f378721f4365","enableInput":true,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"state","propertyType":"msg","value":"","valueType":"entityState"},{"property":"socket","propertyType":"msg","value":"3","valueType":"num"}],"x":270,"y":160,"wires":[[],[]]},{"id":"e9c92f4bee849acc","type":"ha-switch","z":"01d019b793c41636","name":"Energenie PMS2 LAN Socket 4","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"086a81c8c6ddc220","enableInput":true,"outputOnStateChange":true,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"state","propertyType":"msg","value":"","valueType":"entityState"},{"property":"socket","propertyType":"msg","value":"4","valueType":"num"}],"x":270,"y":200,"wires":[[],[]]},{"id":"299e6c990ec0b33e","type":"status","z":"01d019b793c41636","name":"","scope":null,"x":340,"y":40,"wires":[[]]},{"id":"setLoginData","type":"function","z":"f1","name":"Set Login Data","func":"msg.headers = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\nmsg.payload = 'pw=1';\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1540,"y":620,"wires":[["loginRequest"]]},{"id":"loginRequest","type":"http request","z":"f1","name":"Login Request","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":1720,"y":620,"wires":[["captureCookies"]]},{"id":"captureCookies","type":"function","z":"f1","name":"Capture Cookies","func":"if (msg.responseHeaders && msg.responseHeaders['set-cookie']) {\n msg.headers = {\n 'Cookie': msg.responseHeaders['set-cookie'].join(';')\n };\n}\nreturn msg;","outputs":1,"noerr":0,"x":1910,"y":620,"wires":[["firstGetRequest"]]},{"id":"firstGetRequest","type":"http request","z":"f1","name":"First GET Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2110,"y":620,"wires":[["secondGetRequest","parseStateNode"]]},{"id":"secondGetRequest","type":"http request","z":"f1","name":"Second GET Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2340,"y":620,"wires":[["953135ad3c5cfa6d"]]},{"id":"b137ac1254fcc816","type":"inject","z":"f1","name":"Refresh Status","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":"20","topic":"","payload":"","payloadType":"date","x":1100,"y":660,"wires":[["758dde869105defe"]]},{"id":"parseStateNode","type":"function","z":"f1","name":"Parse Socket States","func":"var htmlContent = msg.payload;\nvar start = htmlContent.indexOf(\"var sockstates = [\") + \"var sockstates = [\".length;\nvar end = htmlContent.indexOf(\"];\", start);\nvar statesString = htmlContent.substring(start, end);\nvar statesArray = statesString.split(\",\").map(function(item) {\n return parseInt(item, 10);\n});\nmsg.payload = statesArray;\n\nreturn [{ socket: 1, enable: true ? statesArray[0] == 1 : false }, { socket: 2, enable: true ? statesArray[1] == 1 : false}, { socket: 3, enable: true ? statesArray[2] == 1 : false}, { socket: 4, enable: true ? statesArray[3] == 1 : false}];","outputs":4,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":2340,"y":540,"wires":[["c68516e138dafa44"],["c68516e138dafa44"],["c68516e138dafa44"],["c68516e138dafa44"]]},{"id":"02f7c808f5a8e276","type":"function","z":"f1","name":"Set Login Data","func":"msg.headers = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\nmsg.payload = 'pw=1';\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":740,"wires":[["41765c2afe939963"]]},{"id":"41765c2afe939963","type":"http request","z":"f1","name":"Login Request","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":1540,"y":740,"wires":[["67eb172462049459"]]},{"id":"67eb172462049459","type":"function","z":"f1","name":"Capture Cookies","func":"if (msg.responseHeaders && msg.responseHeaders['set-cookie']) {\n msg.headers = {\n 'Cookie': msg.responseHeaders['set-cookie'].join(';')\n };\n}\nreturn msg;","outputs":1,"noerr":0,"x":1730,"y":740,"wires":[["befeef3766944041"]]},{"id":"befeef3766944041","type":"function","z":"f1","name":"Command On","func":"msg.payload = msg.on_command;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1920,"y":740,"wires":[["da118aead47d2ae6"]]},{"id":"da118aead47d2ae6","type":"http request","z":"f1","name":"First POST Request","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2120,"y":740,"wires":[["1edc16f156e5b439"]]},{"id":"1edc16f156e5b439","type":"http request","z":"f1","name":"Second GET Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2340,"y":740,"wires":[["18997a853b92cdc3"]]},{"id":"57be4a7aee6abfb6","type":"function","z":"f1","name":"Set Login Data","func":"msg.headers = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\nmsg.payload = 'pw=1';\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1360,"y":820,"wires":[["335cae384c31e3f5"]]},{"id":"335cae384c31e3f5","type":"http request","z":"f1","name":"Login Request","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":1540,"y":820,"wires":[["b67665b72b7d6f99"]]},{"id":"b67665b72b7d6f99","type":"function","z":"f1","name":"Capture Cookies","func":"if (msg.responseHeaders && msg.responseHeaders['set-cookie']) {\n msg.headers = {\n 'Cookie': msg.responseHeaders['set-cookie'].join(';')\n };\n}\nreturn msg;","outputs":1,"noerr":0,"x":1730,"y":820,"wires":[["c393d6f9cf84e0e9"]]},{"id":"c393d6f9cf84e0e9","type":"function","z":"f1","name":"Command Off","func":"msg.payload = msg.off_command;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1920,"y":820,"wires":[["f031c09223b4678b"]]},{"id":"f031c09223b4678b","type":"http request","z":"f1","name":"First POST Request","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2120,"y":820,"wires":[["ee3b823ba3ac910a"]]},{"id":"ee3b823ba3ac910a","type":"http request","z":"f1","name":"Second GET Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.1.200/login.html","tls":"","persist":false,"proxy":"","insecureHTTPParser":true,"authType":"","senderr":false,"headers":[],"x":2340,"y":820,"wires":[["18997a853b92cdc3"]]},{"id":"4673f8c089bc5685","type":"ha-switch","z":"f1","name":"Energenie PMS2 LAN Socket 1","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"be97b35209b5413a","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":2910,"y":480,"wires":[[],[]]},{"id":"c68516e138dafa44","type":"switch","z":"f1","name":"socket","property":"socket","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":2650,"y":540,"wires":[["4673f8c089bc5685"],["2c52f4f79e453991"],["bc285305e66dedd5"],["4514bf9ff596a115"]]},{"id":"2c52f4f79e453991","type":"ha-switch","z":"f1","name":"Energenie PMS2 LAN Socket 2","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"83a6eda8aa9174c5","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":2910,"y":520,"wires":[[],[]]},{"id":"bc285305e66dedd5","type":"ha-switch","z":"f1","name":"Energenie PMS2 LAN Socket 3","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"8c36f378721f4365","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":2910,"y":560,"wires":[[],[]]},{"id":"4514bf9ff596a115","type":"ha-switch","z":"f1","name":"Energenie PMS2 LAN Socket 4","version":0,"debugenabled":false,"inputs":1,"outputs":2,"entityConfig":"086a81c8c6ddc220","enableInput":true,"outputOnStateChange":false,"outputProperties":[{"property":"outputType","propertyType":"msg","value":"state change","valueType":"str"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":2910,"y":600,"wires":[[],[]]},{"id":"def838de3811e963","type":"function","z":"f1","name":"Build on/off command","func":"if(msg.socket != null) {\n msg.on_command = \"cte\" + msg.socket + \"=1\";\n msg.off_command = \"cte\" + msg.socket + \"=0\";\n\n return msg;\n}\nreturn null;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":780,"wires":[["83d74c70e1b961f4"]]},{"id":"e5d04d31aa1602e8","type":"switch","z":"f1","name":"state","property":"state","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":780,"wires":[["7001db3fc031d641"],["74e2b81cc6ad7612"]]},{"id":"3b127957309ffcc5","type":"link in","z":"f1","name":"energenie_http_status_req","links":["18997a853b92cdc3"],"x":985,"y":620,"wires":[["1906db841a270229"]]},{"id":"1906db841a270229","type":"delay","z":"f1","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1100,"y":620,"wires":[["758dde869105defe"]]},{"id":"18997a853b92cdc3","type":"link out","z":"f1","name":"call_energenie_http_status_req","mode":"link","links":["3b127957309ffcc5"],"x":2475,"y":780,"wires":[]},{"id":"97b20f3a84201ad5","type":"subflow:01d019b793c41636","z":"f1","name":"","x":120,"y":780,"wires":[["def838de3811e963"],["def838de3811e963"],["def838de3811e963"],["def838de3811e963"]]},{"id":"758dde869105defe","type":"function","z":"f1","name":"status_request_in_progress","func":"flow.set('status_request_in_progress', true);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1320,"y":620,"wires":[["setLoginData"]]},{"id":"953135ad3c5cfa6d","type":"function","z":"f1","name":"status_request_in_progress","func":"flow.set('status_request_in_progress', false);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2580,"y":620,"wires":[[]]},{"id":"8ff6257e0e4473f1","type":"catch","z":"f1","name":"","scope":["loginRequest","firstGetRequest","secondGetRequest"],"uncaught":false,"x":2390,"y":660,"wires":[["953135ad3c5cfa6d"]]},{"id":"844832e4da8d8d90","type":"switch","z":"f1","name":"status_request_in_progress","property":"status_request_in_progress","propertyType":"flow","rules":[{"t":"null"},{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":3,"x":740,"y":780,"wires":[["52da96df4ea94f83"],["52da96df4ea94f83"],["158fe09d9d3db270"]]},{"id":"5e3818ecb5f273d3","type":"function","z":"f1","name":"Update Send retry","func":"var send_retry = flow.get(\"command_send_retry\") || 0;\nsend_retry += 1;\nflow.set(\"command_send_retry\", send_retry);\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":920,"wires":[["1dd1a03030f11f7f"]]},{"id":"70942ba9a70415b1","type":"delay","z":"f1","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":940,"y":920,"wires":[["33896c0e31361873"]]},{"id":"1dd1a03030f11f7f","type":"switch","z":"f1","name":"","property":"command_send_retry","propertyType":"flow","rules":[{"t":"lte","v":"100","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":920,"wires":[["70942ba9a70415b1"],[]]},{"id":"e833d39ca784ba5b","type":"inject","z":"f1","name":"Reset status_request_in_progress","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":340,"y":280,"wires":[["7f2bfced54b7e312"]]},{"id":"7f2bfced54b7e312","type":"function","z":"f1","name":"status_request_in_progress","func":"flow.set('status_request_in_progress', false);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":280,"wires":[[]]},{"id":"33896c0e31361873","type":"link out","z":"f1","name":"link out 110","mode":"link","links":["e9dbcaf3ece8b29f"],"x":1075,"y":920,"wires":[]},{"id":"e9dbcaf3ece8b29f","type":"link in","z":"f1","name":"link in 63","links":["33896c0e31361873","83d74c70e1b961f4"],"x":585,"y":780,"wires":[["844832e4da8d8d90"]]},{"id":"158fe09d9d3db270","type":"link out","z":"f1","name":"link out 111","mode":"link","links":["1da97d651a463ca3"],"x":895,"y":800,"wires":[]},{"id":"1da97d651a463ca3","type":"link in","z":"f1","name":"link in 64","links":["158fe09d9d3db270"],"x":485,"y":920,"wires":[["5e3818ecb5f273d3"]]},{"id":"c4bfcd2028bb114f","type":"link in","z":"f1","name":"link in 65","links":["718556041f992de0","52da96df4ea94f83"],"x":1025,"y":780,"wires":[["e5d04d31aa1602e8"]]},{"id":"52da96df4ea94f83","type":"link out","z":"f1","name":"link out 113","mode":"link","links":["c4bfcd2028bb114f"],"x":895,"y":760,"wires":[]},{"id":"7001db3fc031d641","type":"link out","z":"f1","name":"link out 114","mode":"link","links":["b4e686921ada51f9"],"x":1195,"y":760,"wires":[]},{"id":"b4e686921ada51f9","type":"link in","z":"f1","name":"link in 66","links":["7001db3fc031d641"],"x":1245,"y":740,"wires":[["02f7c808f5a8e276"]]},{"id":"74e2b81cc6ad7612","type":"link out","z":"f1","name":"link out 115","mode":"link","links":["be0955d080906cf4"],"x":1195,"y":800,"wires":[]},{"id":"be0955d080906cf4","type":"link in","z":"f1","name":"link in 67","links":["74e2b81cc6ad7612"],"x":1245,"y":820,"wires":[["57be4a7aee6abfb6"]]},{"id":"83d74c70e1b961f4","type":"link out","z":"f1","name":"link out 116","mode":"link","links":["e9dbcaf3ece8b29f"],"x":495,"y":780,"wires":[]},{"id":"be97b35209b5413a","type":"ha-entity-config","server":"dfd9f15b.de1b1","deviceConfig":"ef3c327f3868d287","name":"Energenie PMS2 LAN Socket 1","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Energenie PMS2 LAN Socket 1"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"outlet"}],"resend":false,"debugEnabled":false},{"id":"83a6eda8aa9174c5","type":"ha-entity-config","server":"dfd9f15b.de1b1","deviceConfig":"ef3c327f3868d287","name":"Energenie PMS2 LAN Socket 2","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Energenie PMS2 LAN Socket 2"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"outlet"}],"resend":false,"debugEnabled":false},{"id":"8c36f378721f4365","type":"ha-entity-config","server":"dfd9f15b.de1b1","deviceConfig":"ef3c327f3868d287","name":"Energenie PMS2 LAN Socket 3","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Energenie PMS2 LAN Socket 3"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"outlet"}],"resend":false,"debugEnabled":false},{"id":"086a81c8c6ddc220","type":"ha-entity-config","server":"dfd9f15b.de1b1","deviceConfig":"ef3c327f3868d287","name":"Energenie PMS2 LAN Socket 4","version":"6","entityType":"switch","haConfig":[{"property":"name","value":"Energenie PMS2 LAN Socket 4"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":"outlet"}],"resend":false,"debugEnabled":false},{"id":"dfd9f15b.de1b1","type":"server","name":"Local","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"ef3c327f3868d287","type":"ha-device-config","name":"Energenie PMS2 LAN","hwVersion":"","manufacturer":"Energenie","model":"PMS2 LAN","swVersion":""}]
Thanks for sharing this node-red Flow. I tried out, but it doesn’t work. I set the correct IP-Address in the every http request nodes. The password I have to set in the set login data node?
Is the password under function this:
msg.headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};
msg.payload = 'PASSWORD';
return msg;
Thanks for help
Hi Thomas,
thank you for trying out my flow and sorry for the late reply.
Recently, I had issues with this flow myself. That’s why I reworked it:
In HA, I’ve created 4 helpers:
- input_boolean.energenie_pms2_lan_socket_1
- …
- input_boolean.energenie_pms2_lan_socket_4
The password you set in (each of the 3 function nodes):
change msg.payload = 'pw=1';
to msg.payload = 'pw=your_password_here';
The correct IP has to be set in all 9 of the http request nodes, e.g.:
With this implementation, setting the state of the PMS2 sockets works (quite) reliably.
Let me know, if I can assist any further.
Best regards,
Mario
Hello @all, @gnumpi has launched an official integration with 2024.5.
Let’s vote for the project so that he also integrates the LAN and WiFi version. We’ve all been waiting so long for someone to integrate the Energenie sockets.
Upvoted, so I really hope this is achievable