Home Depot Eco Plugs Binding Request

Hi All;

There is a new line of low cost appliance switch modules made by KAB sold at home depot under the name “Eco Plugs” (Currently on clearance at heavy discount). Sold under other labels as well (Wood WION series). The on-off control is performed via UDP. Other software packages have added support for it and I would love to use it with openHab.

For reference here is the UDP implemnetation for control: https://github.com/Danimal4326/homebridge-ecoplug

Some pics http://imgur.com/a/oAVIF (it is implemented with an esp8266 so alternative firmware is also a possibility).



Any hope of a binding?
I’m not a hardware kind of guy so the reprogramming with custom firmware is already over my head.

So I don’t know how to make bindings, but I did get my Eco Plugs working in openhab.

I started with the Danimal4326/homebridge-ecoplug code. Then I forked it. You can find my version at SingleDadLiving/homebridge-ecoplug make sure you use the BETA version

I’ve included sample OpenHAB configs for sitemap, items and rules

I literally put this together last night. It works for me, but it is rough around the edges.

1 Like

This is great I’ll give it a try.

If you have any questions feel free to ask and I’ll try and help

You need to have node installed on your server

Just got my openhab server up and running and was excited to add my Eco Plugs, sad to find out there aren’t binding for it. I’m giving Micah’s solution a try but haven’t had any exposure to homebridge so we’ll see how it goes.

That said, if anyone is willing and able to write bindings that would be great!

My solution doesn’t actually use homebridge. I think homebridge is an implementation of iOS smart home stuff.

I found code someone made for homebridge and Jerry rigged it for openhab, via node js.

You’ll probably have to know a bit of JavaScript to get it to work

Sadly I have no idea how to make bindings, if I did I would have made one. I’m just a business guy who used to do web programming, so I can hack my way around a bit.

I don’t see the download or the examples on the github. I’m assuming it’s a addon file. Unless i’m mistaken.

I got a pair of these working with OpenHAB by flashing them with ESPEasy.
Pinout info can be found here http://thegreatgeekery.blogspot.ca/2016/02/ecoplug-wifi-switch-hacking.html

I compiled the latest build, 106, of ESPEasy with rules so that I could retain the manual button functionality.
I’m kicking myself now for only buying one box, but after Christmas when I got them, people were just beginning to investigate modifying them. I had no desire to run them standalone, so I didn’t buy any more.
After some of the talk about them phoning your wifi SSID and password in clear text back to servers in China, I didn’t have much desire to use them at all with the stock firmware.

If there’s a desire, I can try to put together a short tutorial on flashing, setup, etc when I get some time. Most of the info is out there in various places, but there are a few quirks to watch out for.

If you could that would be great. I’m not much of a tinkerer of hardware

Home Depot Eco Plugs with custom firmware (ESPEasy) and openHAB

The Eco Plugs from Home Depot (and a few others) are built around a common ESP8266 wifi module. A few different people have done the work to “reverse engineer” these plugs. I used the post here as a guide in flashing the new firmware. The link gives the pinout of the module in the Eco Plugs. I had previously used the NodeMCU development module, but this was my first experience with an ESP requiring an external USB to Serial (FTDI) adapter.

The connection between the ESP and the FTDI adapter is:
Ground -> Ground
TX -> RX
RX -> TX

To put the ESP into a state in which it is ready to accept a new firmware from the ESPEasy flash tool, you simply jump GPIO 0 to ground at boot.

This was my first time using a FTDI adapter, and I about went nuts trying to get it to show up as a COM device. No matter what driver I tried, I could only get it to show up as a USB Serial Converter in Device Manager. The trick is to check “Load VCP” under the Advanced tab of the USB Serial Converter device.

Once you have leads connected to the ESP module, the driver loaded and connected to your computer, it is pretty straight forward to flash the new firmware http://www.esp8266.nu/index.php/Tutorial_ESPEasy_Firmware_Upload#Flashing_the_module. I started by flashing the current “stable” R78 firmware included in the download section. From there I compiled the latest build 106. Some of the logic for controlling the device requires what is called “rules” which was introduced as an experimental feature in build R86.

Once the Plug is flashed with the latest ESPEasy firmware, there is some configuration that is required. Obviously, connecting it to you wifi network is first. From there you will want to give the device a unique name, set the protocol to OpenHAB MQTT, set your MQTT controller IP and port. An important setting that caused me some issues until I did some digging is the Unit Number. If you have more than one MQTT device, and do not set a unique Unit Number, your devices will be constantly dropping their connection to the broker and will only respond intermittently.

Next comes the Device tab. The first entry is for physical button on the plug. You will want to set it up as shown.

The second device is basically a virtual “switch” to capture the state of GPIO 15, which is the relay that controls the outlet. This allows us to query the state of the outlet. It should be configured as shown:

The final step is to set up the “rules.” The logic that will control the outlet. Here is what I came up with.

on Button#Switch do
if [State]=0

on State#State do
if [State]=1
publish /%sysname%/state,ON
else if [State]=0
publish /%sysname%/state,OFF

The first section toggles GPIO 15 (the outlet relay) when it detects a state change on the physical button (gpio 13).
The second section publishes the state of the outlet to the MQTT topic when it detects a change in the state of GPIO 15 (the outlet relay).

It’s pretty late but hopefully this makes sense for the most part. The biggest hurdle was that ESPEasy is pretty sparsely documented. The Unit Number, for example. If you run into any issues, I will do my best to answer any questions.

This is a sweet tutorial. Thanks! I’m completely new to openHAB and I’m having a heck of a time getting started. I’ve read thru the docs and they aren’t complete unfortunately.
Can you provide the openHAB configuration for this? How to do it?
I’m starting with OH2.0-stable, and selected openHAB in the first place because I flashed an eco plug. :slight_smile:

Thanks much!!

Do you have an MQTT broker set up and OH configured to point to it?

Once you have that, here is an example of an item definition for one of my plugs, named ol1.

Switch outlet1 "Basement Lamp" (lights,lamp,basement) ["Lighting"] {mqtt=">[broker:/ol1/gpio/15:command:ON:1],>[broker:/ol1/gpio/15:command:OFF:0],<[broker:/ol1/state:state:default"}

The sitemap line:

Switch item=outlet1 label="Basement Lamp"

I do, I think. :slight_smile: I have Mosquitto installed and the ESPEasy seems to connect to it. I clicked on the MQTT binding and made some changes to the mqtt.conf file (I believe that’s the name). Beyond that… the lines you mentioned, where do they go? Many thanks!

The first line will go in your .item file, the second goes in your sitemap definition file. The first line will need to be edited. Change “ol1” to whatever name you gave your device on the Config tab.

I suggest you do a little more reading on the basics of OpenHAB operation. Here is the official documentation on Items.

This series uses OpenHAB 1, so some details will have changed for OH2. It would be a good read for getting to know the basics of how MQTT and OH interact. Most of the stuff on Item and Sitemaps will still be applicable to OH2 also.

Thanks again. As someone just getting into OpenHab I think that the whole v1 vs v2 stuff makes it extra confusing because some tutorials are for v1 and others for v2 and none of them are straightforward. I’m looking into other options right now (Home Assistant, homebridge, Node-Red) but haven’t settled on anything yet.

@PointandClick or anyone else: Have you updated your Plug since flashing it the first time? I tried to update over wifi but it apparently failed because now I just have a flashing blue light. I don’t want to tear the box open and reflash each of mine (I originally flashed an older version, apparently).

For those interested and having troubles with the rules, per http://www.letscontrolit.com/wiki/index.php/Tutorial_Rules - it apparently depends one the firmware version, but on mine I had to first enable Rules under Tools -> (System) -> Advanced -> checkbox towards bottom. Then the Rules menu shows up on the top where you can enter in the above code.

Yes, I forgot to mention that you must enable the rules engine first.

I have done OTA updates on mine successfully. Not sure what would have went wrong there. Are you still able to access the plug, or is it in a “bricked” state?

OH can be quite overwhelming at first. I can’t say that I’m that well versed yet since I only have a few of these Eco Plugs and a zwave thermostat at the moment. Most of the other options I’ve looked into (Home Assistant for example) seem like they are not that much better in regards to getting things set up. Still require editing config files etc. Plus, I don’t think OH can be matched for the sheer number of devices supported. To me that is the real power. I could take the easy way out and buy an off the shelf controller, but the tradeoff of being locked in to certain devices just isn’t worth it to me. Once I’ve learned how to set up a particular device in OH it’s generally pretty hands off after that.

I think it’s “bricked” until I unscrew it and reflash it. The blue LED is blinking without any plans to retire :wink: