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

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

Sorry been busy lately:

Log for:

2017-10-20 20:20:28.262 [ItemCommandEvent          ] - Item 'XiaomiMiPowerStrip6Plugs_Actions_ExecuteCommand' received command get_props[“power_consume_rate”]
2017-10-20 20:20:28.273 [ItemStateChangedEvent     ] - XiaomiMiPowerStrip6Plugs_Actions_ExecuteCommand changed from NULL to get_props[“power_consume_rate”]

It seems I can send any string to the "Execute Command"channel and it will set the contant accordingly, here command “a string”

XiaomiMiPowerStrip6Plugs_Actions_ExecuteCommand changed from get_props[“power_consume_rate”] to A string
2017-10-20 20:25:33.498 [ItemCommandEvent          ] - Item 'XiaomiMiPowerStrip6Plugs_Actions_ExecuteCommand' received command A string

It also gives HTTP Status Code 200 in REST API

@Moellegaard Thanks. Unfortunately it does not seem to have the expected log entries I was hoping for.
The good news is that I have a sponsored device on the way, I’m confident I’ll be able to determine the right channels for the deivce shortly.

1 Like

@marcel_verpaalen are you also getting a single wifi plug? There is nothing to indicate this has power metering on the specs for it but wow what a find if it did…

No, it is a powerstrip that @DaAndy sponsored as rhank foe tge effort & help to find the remaining commands

I could do the same for the wifi plug how would I get one to you