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

You can try to get these properties

load_voltage
load_power
power_consumed

By going to the command channel and send e.g get_prop[“load_voltage”]

What also helps is to send the plugin apk (from your backup where you got your key, the files with somenumber.apk filename.)
I can than try my emulator for your devices.

Okay, I don’t know how to do that, could you post an example or guide me to more information on this? I really like to use it.

You can enable the command channel by going to paperUI, open your your thing.
Than when you see the list of channels, click on show all, and the enhanced channels can be selected. Enable the command channel (it is a advanced channel, so otherwise invisible)
You can than paste the commands there, wait a bit and the value of the channel will be updated with the response.

(I think in the vacuum thread there are some screenshots as well).

okay I tried to do it, I added a item for the executing command:

I send the get_prop[“load_voltage”] via REST API:

The result was a bit unexpected.

I think I did something worng :S

Nope, you did it right…
It means that property is not supported by your device. Can you try the other 2?

Okay, I tried it out, I had the same result, no responce, here is my definition of the thing:
image

btw. I notice I that I need to send a couple of on off cycles to the strip before I normally see it turn on or off. I don’t see anything strange in my log, tell me if I can send you some information on this to help.

The xiaomi power I’m testing is this one: https://www.aliexpress.com/item/New-App-Remote-Control-Original-Xiaomi-Smart-Power-Strip-Intelligent-6-Ports-WiFi-Wireless-Remote-Power/32810868837.html?spm=a2g0s.9042311.0.0.TeJGcA&aff_platform=aaf&cpt=1507017595061&sk=zj6qB6AIM&aff_trace_key=d71e01b7269647dabfed4f88f1b541f1-1507017595061-08758-zj6qB6AIM&terminal_id=e2b487dc2cd04ca28afdbbc22cfb565e

I have the latest binding which decodes the IOS token correctly and the thinkg shows up fine.

channels are bound to items:

image

item file:

Switch Xaiomi1  "Switch it on"  {channel="miio:basic:03EDD566:power" }
Number Xaiomi1current "Current " {channel="miio:basic:03EDD566:current"}
String Xaiomi1green "Green " {channel="miio:basic:03EDD566:modeGreen"}
Number Xaiomi1temp "Temp " {channel="miio:basic:03EDD566:temperature"}

sitemap

Switch item=Xaiomi1
Text item=Xaiomi1current
Text item=Xaiomi1green
Text item=Xaiomi1temp 

Basic UI shows no values and switch does nothing:

Can anyone help?

Hi,

I found another suggestion for the power usage.
Can someone with strip and someone with plug try the following command

get_props["power_consume_rate"]
get_rt_power[1]

If you get a response, does the value correspond with the value you see in the app?

Can you also try if these work?
toggle[] is working (would switch on/off)
get_props["wifi_led"]
set_wifi_led["on"]

for the chuangmi.plug.v1:
set_off[]
set_on[]
set_usb_off[]
set_usb_on[]
get_props[“on”, “usb_on”]

Normally the action commands respond simply with response “ok”. So if you get that, I assume the device is going to switch. Do you see the same in the app?

I have one of these:

and nothing but the switch channel works - none of the above commands work either

ive also see this - send it 4 or 5 times but then after the initial unresponsiveness it is fine after that - perhaps it goes to sleep?

@Andrew_Pawelski
Can you pls send the debug log . I don’t own such a device so I can’t test this before releasing.
In the log it is bit more clear what is happening.

The same as Andrew says, I don’t see this with the app, but I didn’t really use it so much. I try when I get the chance and get back to you

I tried the get_props[“power_consume_rate”]:

image
get_rt_power[1]:

image
Both are accepted by REST UI with responce 200 = OK

I will test the rest later when I have the chance

Normally after entering this, after a bit, the value is updated with the
response from your device.
Depends bit on how many commands are in the queue, but mostly this happens
in <10 sec.

This response is what I would like to know. The 200 response is something
internal from OH, not something your device is providing

I still see the last command after a couple of min. :
image

That’s indeed very odd.
What’s strange as well to me is that the mode & temp in your screenshot is not updated either.
Which would mean either the communication is not working fine or the screenupdate has a problem.

Can you share what is happening in the debug log when these commands are running, as that may give indication

Theres nothing going on in the debug log that I can see and it doesnt do it all the time i have it running a fish pump on in the morming off in the evening and last night it sent an off command that OH says it is off but the Mi App shows it on (as is the case as the pump is still running) today it worked perfectly

perhaps I just send it 5 offs 2 seconds apart and same for an on

Okay here is the inital log for ON/OFF cycles. The first few times I run it do responce then, suddenly everything works:

2017-10-20 20:16:13.329 [ItemCommandEvent          ] - Item 'XiaomiMiPowerStrip6Plugs_PowerOnOff' received command ON
2017-10-20 20:16:13.342 [ItemStateChangedEvent     ] - XiaomiMiPowerStrip6Plugs_PowerOnOff changed from OFF to ON
2017-10-20 20:16:19.379 [ItemCommandEvent          ] - Item 'XiaomiMiPowerStrip6Plugs_PowerOnOff' received command OFF
2017-10-20 20:16:19.388 [ItemStateChangedEvent     ] - XiaomiMiPowerStrip6Plugs_PowerOnOff changed from ON to OFF
2017-10-20 20:16:21.537 [ItemCommandEvent          ] - Item 'XiaomiMiPowerStrip6Plugs_PowerOnOff' received command ON
==> /var/log/openhab2/openhab.log <==
2017-10-20 20:16:24.399 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.core.thing.internal.ThingManager@62811e' takes more than 5000ms.
==> /var/log/openhab2/events.log <==
2017-10-20 20:16:24.409 [ItemStateChangedEvent     ] - XiaomiMiPowerStrip6Plugs_PowerOnOff changed from OFF to ON