Generic Wi-Fi plugs


(Ethan Martin) #1

Hey Everyone,
First post here. Super new to OpenHAB but I have it running on a Rpi3 and am able to control a few things I have, so all is well.
I am curious to see if anyone has had any experience with OpenHAB and these cheap generic Wi-Fi plugs commonly found on Amazon and eBay. I looked around and couldn’t find anything, possibly because how they do not have a specific brand or name really.

If you have had experience with these, or know someone who does, any help would be greatly appreciated. These are inexpensive plugs, and work pretty well for me so far. I maybe can open it up and flash the ESP in it with a different firmware, but they are sealed pretty tight.
Not sure if this is any help, but here is the FCC page on this device. It has pictures of the internals of the device.


Pretty sure I could flash it from the pictures, but the enclosure is definitely not designed to be reopened. So even if a flash is possible, assembly may not be. Any opinions or ideas are also greatly appreciated.
Thanks!


(Sergey M) #2

Pay attention to this and look here maybe it will be interesting to you.


(Ethan Martin) #3

Thank you. I am currently trying to dissemble the device. I’ll update this with how it goes.


(Moshe Dahan) #4

I also have one of these cheap ones. Bought mine from https://cnctlife.com/
However, after much (MUCH) research I finally found a Chinese company that produces very similar ones called ikonke. It seems like a local guy figured out their code and wrote both a homebridge version (which I personally run at home and works perfectly with Siri) and a competing Home Assistant Python script.
https://github.com/YinHangCode/homeassistant-ikonke-outlet/blob/master/custom_components/switch/homeassistant-ikonke-outlet.py
Seems like many of these similar ones are just various OEMs but run on the same code.
If anyone can use this info to help, U DA MAN (or WOMAN :grinning: ).


(Moshe Dahan) #5

OpenHAB team,

I haven’t seen any traction made with this one. As I mentioned, I am not a developer, otherwise I would have done this myself. I was able to validate the executable commands needed to get this to work.
Once you downloaded the executable files from https://github.com/YinHangCode/ikonkeIO onto your home directory on your OH system (in my case it is Openhabian platform), you’ll just need to copy the relevant files based on your CPU architecture to the main folder (two executable files in there).

Then, after running the discovery command: sh ikonkeIO.sh --discover 192.168.1.255 (where the IP address would be your broadcast IP address), it will find all ikonke outlets available on your network, example output:

broadcast address: 192.168.1.255, scan ikonke device.... 

type: mini_w
ip: 192.168.1.XXX
mac: 11-22-33-44-55-66
password: 12345678

type: mini_w
ip: 192.168.1.YYY
mac: aa-bb-cc-dd-ee-ff
password: 87654321

In order to operate each switch, the following executable commands are available, provided along with the syntax:

sh ikonkeIO.sh -C {type} {IP} {mac} '{password}' {setRelay/getRelay} {open/close}
These parameters are identified in the discovery process.

sh ikonkeIO.sh -C mini_w 192.168.1.XXX 11-22-33-44-55-66 '12345678' setRelay open
The above command will turn the relay switch to ON and the command output would say success

sh ikonkeIO.sh -C mini_w 192.168.1.XXX 11-22-33-44-55-66 '12345678' setRelay close
The above command will turn the relay switch to OFF and the command output would say success

sh ikonkeIO.sh -C mini_w 192.168.1.XXX 11-22-33-44-55-66 '12345678' getRelay
The above command will ask the switch for its current status. The command output would say either open (ON) or close (OFF)

Again, I am no developer, but it seems like this has all the materials you would need to develop this into an OH Thing.

Thoughts!!??


(IanJ) #6

I just bought one of these generic plugs for $9 and will test this out. If it works, I will update here.


(dbadia) #7

@Moshe_Dahan You need to use the app on your phone to add these plugs to wifi before running the scripts to control them, right?


(Moshe Dahan) #8

That is correct.
The OEM app that comes with it does all the initial setup, including adding the device into your WiFi network. After that’s done and you can control it in the OEM app, you can go through the setup process I described.


(IanJ) #9

Well, I got the GreenDot Wifi smart plug and sadly it does not respond to the ikonkeIO --discover command. It is working and appears to be capable from the smart phone app but not what I wanted. It does have a way to connect it to openHab via IFTTT but I am not sure I want to do that, I prefer my stuff contained on the local network.

After some research I found some information on this type of plug it is apparently using an mqtt server although I am having trouble capturing the packets that show that communication. The only thing I can capture is it’s broadcast that gives it’s ip address, it’s product key and unique ID and active, ability, mode and encryption settings.

I tried it with IFTTT and I have to say it’s so slow that it’s almost unusable. I will continue to hack at it, if I find out more I will update here.

There is a script that should work with the “smart life” plugs like the Green Dot and many other generic plugs. I got it to show a status but could not make it change the state of the plug. The information can be found here on git hub

UPDATE: I have tried everything I know to get mine to work through openHab but it appears that it’s not possible (at least for me) so I am now looking for a different brand that will work with the ikonkeIO software. Does anyone have any recommendations?

UPDATE2: So I bought an konke mini us plug and that worked with the ikonke scripts referenced above. Not only does it work but is an immediate response. I bought this one konke mini US aka mini_w ymmv.

UDATE3: I have been able to get the Green Dot to toggle on and off using the python script from Github. To find the key that I needed to send the commands to the plug I used an android SSL capture program called SSL Capture. This should probably work with all of the generic plugs that use the “smart life” app. - I hope this helps someone.