EcoPlug integration

Has anyone successfully integrated an EcoPlug into Home Assistant? I saw some random add-on somewhere, but I need to be able to manually specify my plug since the plug doesn’t live on the same wifi network as Home Assistant.

I came across this:

With that, I can successfully control my plug with a one liner:

[root@server homebridge-ecoplug]$ node PlugControl.js -a state -id "ECO-780XXXXX" -ip "192.168.90.141"   
OFF
[root@server homebridge-ecoplug]$ node PlugControl.js -a on -id "ECO-780XXXXX" -ip "192.168.90.141"     
Setting  switch with ID ECO-780XXXXX to: ON
[root@server homebridge-ecoplug]$ node PlugControl.js -a off -id "ECO-780XXXXX" -ip "192.168.90.141" 
Setting  switch with ID ECO-780XXXXX to: OFF

But what is the best way to integrate this into home assistant? Seems like I can do this will possibly a shell_command, but seems like there is probably a better way to do this. Any ideas?

There is a plugin that lets the eco-plugs work directly in Homeassistant. It is not official, but it is located in the forums. Let me see if I can find it. Works great for me.

There is a tricky part of it, there is something that you need to install to make it work, but I can try to assist if needed. after that, they just appear and work great.

Thanks @reylas, that’s the one I saw before. However, I need to manually specify an IP since HA isn’t on the same network as the plug. Doesn’t appear you can manually specify anywhere?

Let me look at my setup.

Let me know what you find here. I am running hassio, so discovery components are tricky all around since it runs HA in a docker container. If somehow you can manually specify the ecoplugs, this would be great.

Otherwise, I’m able to do a hack job with a shell_command. Since it requires node to run the command I need, I can’t run that command natively from the docker container, so I have to ssh from the docker container to the main host to then run the one liners I showed above.

I looked through the discovery code for the eco plugs and I don’t see the easiest way to do cross router discovery. I do see that what it finds is passed as an array so maybe seed the array with hard ips?

Where do you even see where the discovery is passed on? I dont see that in the python code.

Too bad you can’t manually specify like you can for the wemo component. Perhaps someone else has run into this and can chime in.

@gbealmer @jeffl78 any ideas here? Looks like you two have forks of this code on github so perhaps will be able to help find a way to manually specify a plug IP/mac within a home assistant config.

I can’t get https://github.com/gbealmer/pyecoplug to work with hassi.io either. I think raylas is correct, there’s something simple missing. To bad I don’t know much about coding.

I am going to agree there does seem to be something missing. I followed to the letter can HA would not work. I put the file in the custom_components/switch folder but it does not seem to see it or like to work with it. Not a coder either.

I think it’s because I’m running hassio in docker, anyone know how to get this working with docker or where we can post to look for help? I don’t know how to code beyond yaml and config.json

I can confirm that the custom component still works for me. I also created a test Hass.io system on a RPI 3 B, updated to 0.89.1 and the plugs were discovered and work properly.
To ensure the breaking changes for the custom component issue weren’t going to be a problem, I manually modified the directory structure to custom_component/ecoplug and renamed ecoplug.py to switch.py
My plugs were discovered and operate properly with the modified directory structure.

@gbealmer is hassio main host on the same subnet as the ecoplugs? I’ve never been able to have hassio discover my plugs since my plugs are on a different subnet.

I was hoping that this code can be updated where an IP of the plug can be manually configured, but to date nobody has been able to review this and add that functionality.

The hassio host is on the same subnet. Just like the Ecoplug app, you must be on the same subnet for the plugs to be discovered.
i haven’t looked at the code for a while, but there isn’t any manual configuration option in it. Code to interrogate the configuration and add the devices found under the platform section would have to be included.

Right. I have tried this in the past to manually put in names and IP addresses, but haven’t been successful in reverse engineering this code unfortunately. In the first post on this thread, I showed what I am using, but really don’t like that code, would really like to get this platform working with a manually defined plug. If anyone is willing to help out here, it would be much appreciated.

@gbealmer I found that with HA update to 0.92, this custom component no longer loads. With .92 HA finally completed the migration of custom components requiring some additional build. Do you have any intentions to update this component to work with .92? If not I may fork this on Github and attempt to update it for .92 (though I don’t have much time nor experience doing this)

I haven’t upgraded to 0.92 yet. I’ll try it today and look at it.
If you can, post the errors/warnings you receive when attempting to load the component.

Upgraded to 0,92 and had the same problem with loading the custom_component.
As a temporary change until I update the repository,

modify folder structure 
from 
custom_component/switch 
to 
custom_component/ecoplug

rename ecoplug.py to switch.py
create empty __init__.py
create custom_component/ecoplug/manifest.json
with the following contents
{
  "domain": "ecoplug",
  "name": "Ecoplug",
  "documentation": "https://github.com/gbealmer/pyecoplug/",
  "dependencies": [],
  "codeowners": [],
  "requirements": []
}

I previously manually made all changes except the addition of manifest.json, so all I had to do was add that file.
Let me know if this works for you.

Updated


with the changes.