Generic Wi-Fi plugs

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!

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

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

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: ).

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!!??

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

@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?

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.

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.

HI folks, new to OH2, just wonder what binding you use to add the smart plugs to your setup?

Hey Guys,

Thought this is worth an update for this thread. Since there are so many variations of these cheap wifi plugs, the need for a better viable solution with OH has been lingering for way too long.
I have stumbled upon a great solution recently for these power plugs, but the same exact solution also works with many other cheap wifi devices, like switches/dimmers, light bulbs and a few others.

The concept of the solution is quite simple!
A quick and easy off the air firmware change for these devices with Tasmota firmware!
Benefits:

  • Completely OTA firmware flashing. No need to open the device and solder anything to flash the new firmware.
  • Using Tasmota firmware. If you are not familiar with it, it’s the most robust open source firmware to provide a simple and easy MQTT connectivity with OTA updates as well.

I cannot take credit for this, I just happen to stumble upon this solution and test it. Works great!
For a full list of compatible devices currently supported by this process, look here: https://github.com/ct-Open-Source/tuya-convert/wiki/Compatible-devices

This is the github repository with the code to enable this: https://github.com/ct-Open-Source/tuya-convert

Here is a good YouTube video to show the process as well: https://youtu.be/O5GYh470m5k

Once you’re done with the firmware flashing on your device, in case anyone needs the referrence, here is a link with a good description of connecting Tasmota based devices with OH v2.4.

I hope this helps!

1 Like

Hey @Moshe_Dahan,

That was great advise!
I thought it would be nice to share my experience.

In the YouTube video (and much of the other video’s), they use a raspberry.
Not having one laying at home, I decided to use my laptop instead.
(For me this worked greate. However, this probably depends on the type of laptop and wifi card that it contains.)

I created a live usb stick of Ubuntu and booted with it.
Opend the terminal and issued the following commands:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install git
sudo apt-get install ifconfig

Check if your wifi card is named wlan0 (the script won’t run otherwise):

ifconfig

Change name if necessary(my card was named wlp2s0):

ifconfig wlp2s0 down  
ip link set wlp2s0 name wlan0
ifconfig wlan0 up 

Follow the rest of the video, from approximately 3 minutes to the end (after they logged in with SSH and start configuring the py)
https://youtu.be/O5GYh470m5k

I found some additional video’s that explaines how to install the MQTT binding and broker:
https://youtu.be/R-SrZvKHXdA

and how to attach a Tasmota flashed device to openhab:
After creating the “Topic Thing”, I did have to connect with an external MQTT brower tool once, before it got online within openhab. Don’t know if it was just a glitch. (I used the MQTTool ios app for that).
https://youtu.be/flMg2fm-3AY

FYI:
I have two Neo coolcam 10A switches (WR01W) that where flashed and connected to openhab.