Binding for Xiaomi wifi plug and power strips - Xiaomi Mi IO Binding

I was wondering if there is a binding thats kan intergrate Xiaomi wifi plug and power strips.

the Readme for the binding lists the supported devices.

http://docs.openhab.org/addons/bindings/mihome/readme.html

Yes this is for the zigbee plug but Xiaomi also makes wifi based units that are controled.

Hey Brian,

did you get your wifi power strip to work with openhab? I bought one at gearbest flashsale and didnt think about the binding first…

Thank you in advance.

Greetings
Andreas

Hi Andreas
There is a binding that should work with this, but I didn’t manage to find the correct token for the wifi plug I have. It should also work with the power strip, but I don’t have any yet.
you can find a binding here: Xiaomi Robot Vacuum Binding
The guy developing it give good support and makes steady progress. If you find a good way to extract tokens for xiaomi power strips, please let me know.

Good luck :slight_smile:

1 Like

Wow, that was a fast reply. :slight_smile:

I will have the power strip in like 2 weeks and time in maybe 3-4 weeks (accidentally ordered it to my parents place…). Hopefully I find out anything, if I do so I will send you an update :slight_smile:

1 Like

Yes, I believe that with the vacuum binding, now renamed to Mi IO binding it should be possible to control the powerstrip.
I thought I ordered one, but unfortunately ordered the wrong version :frowning:

If you are willing to do some testing than I’ll add the config for the powerstrip to fully control it.

I received last week a quite poor performing (wifi wise) yeelight which made me realize that the current approach in the binding is not the best one. I was always doubting if I should use synchronous communication or asynchronous. The former was easier hence I used that. For the vacuum that seems to work fine. However wih a poor responding device I get all sort of thread issues. Hence I’m rewriting part of the binding to work asynchronous instead.

Anyways, please give the current binding a try (from market place). With a little luck you can already control it as a ‘unsupported device’. Pls send me (PM) a full log (incl the discovery part and all the way from the starting of the binding)

I have a smart plug inbound from China - will report back

In the mean time, the miio binding has been updated to run asynchronously.

once you have your plug in house and you have your token. Let’s try to get it working.

Let me know the exact type you see, and than I can try to incorporate the support for your device

Hi, do you know how to get the token?

Yes, read in the first post of Xiaomi Robot Vacuum Binding

I got my 6-slot-socket working now.

I just followed the post in the linked thread and it all worked fine. The ToolKit was a bit tricky, but also okay.

Here is my configuration-overview:


If there is any way I can give you more informations @marcel_verpaalen to add that device as known device just tell me what to do :slight_smile: Like power usage and so on.

That’s good to hear.
I’ve added the database file for your device. Will do some testing and make it available.

The best way to help is to send a wireshark file of the communication while accessing updating all the functionality in the mihome app.
From that, all commands can be found.

What also helps are screenshots from the so it is clear what options can be available

Could you tell me how to exactly do that wireshark file? Tried to find a documentation here, but yeah. Is it necessary to run on the same device (mobile) and/or network (got a few… :smiley: )? I got a wireless card on my pc, so I could at least access the wifi of the socket and mobile (just put them in the same network).

Here are already the screenshots:

Do you plan to add the Xiaomi Router 3C anyhow? Maybe Wifi-Level or so? Dont know if it is possible. I own one and do have all my smart home devices running over it (own subnet). If I know how to use wireshark I could do that for the router too I guess.

Edit: I used “tPacketCapture” on my phone. Dont know if it worked - I cannot see anything in there. I will send you the file in private (thought it is not good to have it public?) and some informations what I did.

Thanks. I’ve added the database for the powerstrip.
The updated version is available on the market.

I did not yet have chance to look at the packet file.
Let me know if this is already working.

@DaAndy
Can you test in the command channel the following 2 commands to get the properties for the powerstrip

get_prop[“current”]
get_prop[“temperature”]

Pls also indicate the values you see at that time in the screen

I try to do that this evening (ran into massive problems at my smart home, because the dedicated smart home router has a 20 device limit…).

Where do I need to put that btw? :smiley: I do not know much - I only read a lot…

You go to your thing config. select the 'show more’to show the advanced channels
Enable the command channel.

Than you can update that channel with the command. Wait a bit and the channel is updated with the response.
Once you have the response, you can try the 2nd command

That sounds easy - thank you.

Will do that in the evening.

It sounded easy, but guess it is not for me.

What I did is that:

After that I tried several commands like:

“update MiPowerStripV2LivingTV-Actions_ExecuteCommand get_prop[“current”]”

Also tried with bundle:update with things, item, channel and so on. Can you give me the exact command? Sorry to ask again…

Edit: Found something:
smarthome:update

I will try this.

Edit 2:

How long do you need to wait? Nothing happens. Do I have to use the “Test Command”-Channel?

“19:06:33.362 [INFO ] [marthome.event.ItemStateChangedEvent] - MiPowerStripV2LivingTV_Actions_ExecuteCommand changed from get_prop[temperature] to get_prop[current]”