Energenie EG-PMS2-LAN and similar

Hi

I have the PMS-LAN too, and would like to control it via Home Assistant too, can you help to understand what you’ve done to do it ?

Thanks !

Hi,
i have not yet done much - i still don’t really see how to poll the status in a nice way.

Thanks, I wish I could help but sadly I don’t have the necessary programming skills/understanding .

I came across this on GitHub too - but it looks like it just seems to turn the sockets on/off - https://github.com/zdazzy/eg-pyms-lan

Hopefully it can be a product that could be supported in the future

Still curious if someone has got this device working with HA

any new status?

You should be able to use the script from github in a command line switch.

Thanks,

I now have example of how to control my Energenie PMS-LAN, which I’m trying to work through on the micasverde.com (Vera Control) forum- on a quest to see how I can get Vera (and by association HASS) to run them.

As it seem both curl or wget can do the job.

The first thing you need to do is login (the default password is 1, so I have left it as that for those examples) - and this times out after I think 3-5 mins

Using curl,

curl -s -d "pw=1" http://192.168.1.90/login.html

or wget

wget -q -O - --post-data="pw=1" http://192.168.1.90/login.html 

And the to turn the sockets on or off you set the value of your target to either 1 or 0 e.g.

Turn on socket 4 (via curl)

curl -s -d "cte4=1" http://192.168.1.90/

Turn off socket 4 (via curl)

curl -s -d "cte4=0" http://192.168.1.90/

Turn on socket 4 (via wget)

wget -q -O - --post-data="cte4=1" 'http://192.168.1.90/'

Turn off socket 4 (via wget)

wget -q -O - --post-data="cte4=0" 'http://192.168.1.90/'
1 Like

Please could someone help me with this code - which I’m trying to get working based on this guide.

The use of quotes in the curl command seem to be causing me issues ? Plus I’m not sure what to do with the “command_state” value ?

switch:
  platform: command_line
  switches:
    arest_pin_four:
      command_on: "/usr/bin/curl -s -d "pw=1" http://192.168.1.90/login.html && curl -s -d "cte4=1" http://192.168.1.90/ && curl -s -d "" http://192.168.1.90/login.html"
      command_off: "/usr/bin/curl -s -d "pw=1" http://192.168.1.90/login.html && curl -s -d "cte4=0" http://192.168.1.90/ && curl -s -d "" http://192.168.1.90/login.html"
      command_state: "/usr/bin/curl -X GET http://192.168.1.90"
      value_template: '{{ value == "1" }}'
      friendly_name: Energenie PMS-LAN Multiblock

I have got it to work - by creating on and off commands for each of the 4 sockets. The key is that you need to send a login request first for the socket firmer - and then to help matters once the command is sent - , I send a log out (empty) request at the end…

switch:
  - platform: command_line
    switches:
      energenie4:
        command_on: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte4=1' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        command_off: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte4=0' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        friendly_name: Energenie Socket 4
  - platform: command_line
    switches:
      energenie3:
        command_on: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte3=1' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        command_off: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte3=0' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        friendly_name: Energenie Socket 3
  - platform: command_line
    switches:
      energenie2:
        command_on: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte2=1' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        command_off: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte2=0' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        friendly_name: Energenie Socket 2
  - platform: command_line
    switches:
      energenie1:
        command_on: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte1=1' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        command_off: "/usr/bin/curl -s -d 'pw=1' http://192.168.1.90/login.html && curl -s -d 'cte1=0' http://192.168.1.90/ && curl -s -d '' http://192.168.1.90/login.html"
        friendly_name: Energenie Socket 1

If anyone can advise on how I can capture the ‘state’ of each socket via the UI that would be great !! When the curl commands are sent a page of HTML is sent back, which looks like it can confirm the status of each socket.??

1 Like

You can try using my script for Energenie PMS-LAN, which allows you to control switches through the MQTT server. The script on the python here , here’s the code for home assistant:
switch:
- platform: mqtt
name: socket_1
state_topic: “energenie/socket1/state/”
command_topic: “energenie/socket1/state/”
availability_topic: “energenie/online/”
payload_on: “1”
payload_off: “0”
optimistic: false
qos: 0
retain: true
- platform: mqtt
name: socket_2
state_topic: “energenie/socket2/state/”
command_topic: “energenie/socket2/state/”
availability_topic: “energenie/online/”
payload_on: “1”
payload_off: “0”
optimistic: false
qos: 0
retain: true
- platform: mqtt
name: socket_3
state_topic: “energenie/socket3/state/”
command_topic: “energenie/socket3/state/”
availability_topic: “energenie/online/”
payload_on: “1”
payload_off: “0”
optimistic: false
qos: 0
retain: true
- platform: mqtt
name: socket_4
state_topic: “energenie/socket4/state/”
command_topic: “energenie/socket4/state/”
availability_topic: “energenie/online/”
payload_on: “1”
payload_off: “0”
optimistic: false
qos: 0
retain: true

1 Like

Since I am interested to buy EG-PMS2-LAN I wanted to ask you if everything is working OK after 3-4 years. The integration you use is still the same? Are you satisfied with the product?
Thank you

It’s been solid for me, I’ve even created a plugin on my Vera Home Controller so I can control it via that - Luup Plugin - Energenie PMS LAN Switch - General Plugin Discussion - Ezlo Community

1 Like

I bought it and turning on and off works great with the way you showed.
Can you help me how to change the icon of each socket?
Also when HA restarts is there a way to know the status of each socket?
Thank you for your help and your contribution!!!

On the Vera plugin ?

If so, that’s not a straightforward thing to do, but it might be possible - probably best to raise any request for that plug in via the ezlo community link shared earlier (other on that forum can possible help too) …

no. on HA :slight_smile:
actually I am trying to understand how to change the status of the switch to on and off and how to change the icon according the state.
so far this is what i have done but doesnt work properly

- platform: command_line
  switches:
    energenie2:
      friendly_name: Led Strip
      command_on: /usr/bin/curl -s -d "pw=1" http://192.168.1.126/login.html && curl -s -d "cte2=1" http://192.168.1.126/ && curl -s -d http://192.168.1.126/login.html
      command_off: /usr/bin/curl -s -d "pw=1" http://192.168.1.126/login.html && curl -s -d "cte2=0" http://192.168.1.126/ && curl -s -d http://192.168.1.126/login.html
      value_template: '{{ value == "1" }}'
      command_state: "/usr/bin/curl -X GET http://192.168.1.126"
      icon_template: >
          {% if value == "1" %} mdi:toggle-switch
          {% else %} mdi:toggle-switch-off
          {% endif %}

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.

1 Like

@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":""}]