Xiaomi mi wifi plug & air purifier

No. It needs to be paired with the xiaomi gateway.

i’ve made it but the power reading doesn’t work… i’ll show you a pic…

What’s the issue in detail? The values of the mi home app and home assistant doesn’t match?

In this case ha report 0 in load Power…

so which code to use for wifi plugs? please help. thanks

This one: GitHub - syssi/xiaomiplug: Xiaomi Mi Smart WiFi Socket integration for Home Assistant

how to get the the token?

@syssi, I just updated to 55.0 and HA was throwing errors about ATTRIBUTE.CURRENT is not defined and no WiFi plugs would show up.

I went through the xiaomi_plug.py doc and commented out the references to ATTRIBUTE.CURRENT and now the component is working again as it should.

ATTR_POWER = 'power'
ATTR_TEMPERATURE = 'temperature'
#ATTR_CURRENT = 'current'
SUCCESS = ['ok']

        self._plug = plug
        self._state = None
        self._state_attrs = {
            ATTR_TEMPERATURE: None,
#            ATTR_CURRENT: None
        }
        self._skip_update = False

            self._state = state.is_on
            self._state_attrs = {
                ATTR_TEMPERATURE: state.temperature,
#                ATTR_CURRENT: state.current,
            }

It looks like you should update the custom component. This issue was fixed recently.

That’s odd, I was on 54.0 and had no issue, it only occurred after upgrading to 55.0

hi can you help me
where i put xiaomi_plug.py file in pi3 so i can work with my Xiaomi WiFi Plug?

Just create a folder called “custom_components” at the same directory as your configuration.yaml. In my case it looks like this:

/home/homeassistant/.homeassistant/custom_components/switch/xiaomi_plug.py

@flyguy Do you still use the Chuang Mi Plug V1 with the USB port? Could you check something to improve the Home Assistant support?

Can’t get the token :frowning: no rooted android phone

@syssi

Yes I am still using.

what can I do for you?

Could you try to ask the plug for the property temperature? Does the device provide an internal temperature?

cp. Plug with USB port compatibility? ¡ Issue #5 ¡ syssi/xiaomiplug ¡ GitHub

What’s the output of

mirobo --ip 10.x.x.x --token a3d7fxxx  get_prop '["on","usb_on", "temperature"]'

Some good news! The xiaomiplug (official called switch.xiaomi_miio!) will be part of HA 0.56. In addition I have created a pull request for the xiaomi_airpurifier (in future called fan.xiaomi_miio): https://github.com/home-assistant/home-assistant/pull/9837

The xiaomiplug (switch.xiaomi_miio) gets a few recently added features soon. It’s part of this pull request: https://github.com/home-assistant/home-assistant/pull/9836

6 Likes

Hey congrats dude! Still haven’t gotten my purifier… But one of these days!

If it is included in HA 0.55.
How to enable it to discover my plugs and power strips.

It’s not working.

I was wrong. It will be released with version 0.56.

1 Like