Xiaomi mi wifi plug & air purifier

I would love to integrate the plug into your mirobo repository. I’m a bit unhappy with the vacuum-centric cli.py. I don’t know how to add the plug there. If you are happy with just the device code (plug.py) I will make a PR.

The mirobo platform just added support for the wifi plug. Worth checking out.

@syssi - legend mate! Hopefully next release of HA will see inclusion of @Danielhiversen’s and your plug code into HA.

Are you using the power strip like this - https://goo.gl/ZAVR5j?

I’m using that

NIce. are you able to control individual sockets using this component?

No.
You switch the whole strip on or off. And you can get the overall current, not individual ones.

Apologies! All fixed! Working like a dream!

1 Like

@teprrr just merged the device support for the xiaomi plug. I will update the custom component tonight. If the updated component works out of the box I will prepare a PR for official inclusion into HA.

1 Like

Thanks @syssi for the patches! Adding support for air purifiers should also be quite easily done, I’m more concerned how to expose all different types of devices nicely to homeassistant without having to create separate platforms for each of them.

Is there an advantage of a common platform as long as the devices cannot be discovered automatically?

Hey guys.

Just wanna clarify, when you mention mi wifi plug, are you talking about the original wifi plug released in 2015 that comes with a USB port ?

Or are you talking about the one that is similar looking to the zigbee version without usb port ?

Does the ori plug with a USB port supported ?

I think (but I’m not very sure) that the first WiFi plug with integrated USB charger was not Zigbee, and maybe it should work too with this component.
But unfortunately that item is not sold any more. Mine is basic version, just WiFi, no gateway connection and no power measurement.

The model with usb port looks like a dual channel device. The usb port can be switched independend. The playload is slightly different (set_on, set_off, set_usb_on, set_usb_off).

I don’t know if this may be Off-Topic, but:

Did anybody notice this repository seems to have a custom component for Xiaomi Mi Remote (which I have) and Smart Mi Fan?

SchumyHao does a lot of good stuff. :slight_smile:

got it. thx man (:

Yeah. The one with the USB is not sold anymore. (: And yes it is not zigbee only WIFI. (:

Can you do me a favour? Just review the code here:

And provide the reponse of self.send("get_prop", ['on', 'usb_on'])? Does it return on/off or true/false? Can you tell me the devtype of your device? It should be printed on discovery:

            _LOGGER.debug("Discovered %s %s with ts: %s" % (self._devtype,
                                                            self._serial,
                                                            self._device_ts))

Thanks a lot!

What custom component are you using and what’s the config.yaml like?