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

in today’s update I’ve updated the powerstrip properties
You can get it from the market place
as the channels have changed, best to delete your thing and add it again

1 Like

Hi Marcel
I tested the new binding, it works very good, with the power on and off. I didn’t notice any reading from the current and temperatur, but I’ll have to try it out a bit more, maybe I have to remove and add the item again, I’ll get back to you, but thanks so much for you work on the binding!’

I reinstalled the binding but I don’t get any values from the None-switch elemets, so the power on/off and the led switch works, but the rest I dont get any values.

image

I think something is preventing the scheduled refresh from working for done users.
I’m not clear what it is.
Maybe the oh version. Are you running snapshots or 2.1 release?

Yes, I’m on 2.1

Ive got my second wifi single plug and unlike the first, this one is discovered as a basic device, but never then discovered as what it actually is, meaning the power channel is never available?

When I tested after uninstalling the old binding and reinstalling the new, I added it as an basic device, and first it was registered as an generic device. After some minutes the thing was updated to the correct type of device and everything was good.

I got some errors that might be of interest for you:

2017-11-09 17:00:19.320 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'power' for thing miio:generic:b5ac9195 already exist... removing
2017-11-09 17:00:19.323 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'modeGreen' for thing miio:generic:b5ac9195 already exist... removing
2017-11-09 17:00:19.325 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'current' for thing miio:generic:b5ac9195 already exist... removing
2017-11-09 17:00:19.327 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'temperature' for thing miio:generic:b5ac9195 already exist... removing
2017-11-09 17:00:19.355 [ThingUpdatedEvent         ] - Thing 'miio:generic:b5ac9195' has been updated.
2017-11-09 17:00:19.433 [hingStatusInfoChangedEvent] - 'miio:generic:03957D15' changed from OFFLINE to ONLINE
2017-11-09 17:00:19.442 [INFO ] [ing.miio.handler.MiIoAbstractHandler] - Mi IO model chuangmi.plug.m1 identified as: Mi Power-plug (chuangmi.plug.m1). Matches thingtype miio:basic
2017-11-09 17:00:19.526 [INFO ] [ing.miio.handler.MiIoAbstractHandler] - Mi IO model xiaomi.repeater.v2 identified as: Unknown Mi IO Device (unknown). Matches thingtype miio:unsupported
2017-11-09 17:00:21.134 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'power' for thing miio:basic:034AC846 already exist... removing
2017-11-09 17:00:21.136 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'modeGreen' for thing miio:basic:034AC846 already exist... removing
2017-11-09 17:00:21.138 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'current' for thing miio:basic:034AC846 already exist... removing
2017-11-09 17:00:21.140 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'temperature' for thing miio:basic:034AC846 already exist... removing
2017-11-09 17:00:21.164 [ThingUpdatedEvent         ] - Thing 'miio:basic:034AC846' has been updated.
2017-11-09 17:00:21.188 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'power' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.190 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'powerUsage' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.191 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'led' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.193 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'power_price' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.195 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'current' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.197 [INFO ] [inding.miio.handler.MiIoBasicHandler] - Channel 'temperature' for thing miio:basic:02E7390C already exist... removing
2017-11-09 17:00:21.327 [ThingUpdatedEvent         ] - Thing 'miio:basic:02E7390C' has been updated.
2017-11-09 17:00:21.415 [INFO ] [ing.miio.handler.MiIoAbstractHandler] - Mi IO model zimi.powerstrip.v2 identified as: Mi Power-strip v2 (zimi.powerstrip.v2). Matches thingtype miio:basic
2017-11-09 17:00:36.583 [hingStatusInfoChangedEvent] - 'miio:generic:03D7EA76' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): No Response from device

Can you send me the model ID, as there are 3 different powerplugs, only 1 has a mapping, the other 2 not. (mainly as the on-off command is working different than all other devices)

I think its the same as the other one…

chuangmi-plug-m1_miio55298XXX

Should be the same as the one on its way to you.

if I manualy add the device model string as chuangmi.plug.m1 I then get the channel but it still doesnt turn off the device. but I assume I could put anything valid in there and the channels for that device would then show

says its online so the token must be right,

Can you send a REFRESH (smarthome:send [channel] REFRESH) to any of the channels, see If that is triggering a refresh
Is on off working?

no on off is not working and I dont know how to form the karaf command - a stop and start hasnt done anything

Ok so I moved the device to another PowerPoint rediscovered it and it is now working - don’t understand why I discovered it and added it the same way as last time

Never mind it’s working!

Hi Marcel
I can confirm that switching to 2.2 added the extra functionally.

Im reciving this error every 30 sec with the binding:

2017-11-15 22:04:20.428 [INFO ] [nal.transport.MiIoAsyncCommunication] - Received message is invalid JSON:

I can locate the error, any idears?

Hi Marcel

Many thanks for your binding!
I am using version 2.2.
My Yeelight Ceiling lamp and Yeelight Desk lamp were found automatically at the first shot!
The token was displayed and both devices are shown as online in things.

Now I am struggling to turn power on/off.

I tried a command like this in items:

Switch Yeelight2_Switch “Deckenlicht WZ” (EG_Wohnzimmer) { channel=“miio:generic:034832…:actions#power” }

with no success. The switch is shown in Basic UI, but has no effect.

Things show me:

Deckenlicht
Xiaomi Mi IO device


Status: ONLINE

Token: 00000000034832…
HIDE PROPERTIES
vendor Xiaomi

192.168.1.16
Channels
SHOW LESS
Network
radio_button_unchecked
SSID
miio:generic:034832…:network#ssid
String


radio_button_unchecked
BSSID
miio:generic:034832…:network#bssid
String


radio_button_unchecked
RSSI
miio:generic:034832…:network#rssi
Number


radio_button_unchecked
Life
miio:generic:034832…:network#life
Number
Actions
radio_button_unchecked
Power On/Off
miio:generic:034832…:actions#power
Switch


radio_button_unchecked
Execute Command
miio:generic:034832…:actions#commands
String


radio_button_unchecked
(experimental)Execute Test Commands
miio:generic:034832…:actions#testcommand
Switch

Any help is appreciated!

The ceiling lamp had an error in the database that send the wrong command. I’ll fix that in a day or so.
I’ll check, it is very likely that the other yeelight had the same error, as they started as copies.

@marcel_verpaalen

Thanks a lot, Marcel!
This might be the explanation, why neither ceiling light nor desk lamp did respond to the on/off command.

I made small update… yeelight cealing hopefully works

Hello there.
I have got a 5 socket powerstrip and after setting it up on Mi Home app, which strangely on itunes is only available in the US store). You must also set the locale in the app to ‘Mainland’ in order to select the wifi powerstrip. It needed to update its firmware and then it worked in the Mi Home app.

I then installed the binding, it discovered it amazingly fast. Impressed!

The issue I have is to get the token, I only us Apple (its the accessibility bit)
Are there instructions I could use on an iPad, it would not be jailbroken.

I am very pleased so far looking forward to getting it over the last hurdle.

[EDIT]
I have solved getting the Token using my PC, I followed the instructions in this blog: https://www.npmjs.com/package/homebridge-xiaomi-mi-robot-vacuum

Regards

Paul

1 Like