Xiaomi zigbee smart plug

Please post you configuration, too. Do you use a proper key? How did you obtain the key (iOS or android app)? Your backtrace shows the component was unable to encrypt the “turn_off” command because of missing requirements.

Hi @syssi

Here it is. I’ve commented out the key just today. Until then it was running with the key. Either way the other sensors work, and the Plug behaves the same.

xiaomi_aqara:
  gateways:
  #  - mac:
  #    key: 6050E5E0E9594A31

I use the iOS instructions in the docs to obtain the key.

Thx
James

A key is needed to control the device. I think you should regenerate the key with the android app. Take a look here: https://community.home-assistant.io/t/pyxiaomigateway-problem-error-invalid-key/

I’m a rare breed with no access to any android devices - only iOS, MACOS or Windows. Any other thoughts?
Thx
JP

hi, did you manage to solve ir?i have the same isue, im using hass.io, and the discovery found the gateway and plug, but the plug doesnt work just like your problem, besides i cant control the light of the gateway

I had the same issue as you both, managed to fix it by generating a new key in the MiHome app, putting the new key in the config yaml, then it worked

1 Like

slightly off topic, but after the recent update to the firmware, load_power is always displaying ‘0’. Any thoughts on how to fix this?
I also moved from aio ha installer to hassio by the way. Not sure if this is relevant to the issue.

This works when i enable internet access to the gateway. However, doesnt seem to work on the local network only.

Hey @Mukund,

I’ve been using my xiaomi smart plugs to turn on my kettle, but I am also encountering that the load_power doesn’t update for around 4 minutes. I need this load_power information so I can automatically turn the switch off at the wall when the kettle is boiled, and to send me my notification.

Did you ever get it sorted?

1 Like

Yep. It works when I allow the switch to communicate to the internet. I generally disable internet access to all of my Xiaomi products.
I use it to turn on lights when motion is detected by the Xiaomi pir sensor.

What’s the exact name and type of your device? Which HA component do you use?

And does it update in real time? Mine take 4-5 minutes to update the load_power.
I have never disabled internet access for my Xiaomi gear. I am also using Hassio, if that makes a difference.

1 Like

Is there any way to report plug power usage per day or cumulative month usage in a chart ?

You’re not alone here, mine are also very delayed reporting power usage which makes it horrible for automations. Around the 4-5 minute mark most of the time, but once it starts to see some changes it’s faster. I can’t tell if this is a HA or Xiaomi bottleneck…

In my case always show 0 as load power. :sweat: 5 minutes could be great for me…

I noticed the same thing. Was trying to base some automations based on how many watts is going through the plug.

I’m using home assistant, xiaomi gateway, xiaomi zigbee power plug.

The load power (watts) updates instantly inside the mi home application, but takes a very long to update the state attributes within home assistant.

Someone mentioned that if you give the gateway internet access it fixes the slow update problem, i haven’t tried this yet. The other method that has been mentioned is to change the update frequency of pooling for the switch, but I’m not sure how to do this, or if it is even supported.

Another method might be to use a sonoff plug with tasmota and mqtt, some (but not all) of the sonoff devices can monitor watts/current usage.

Apparently with the zigbee2mqtt component / hardware the update of the zigbee power plug is a bit faster (? 1 minute).

See discussion here:

See github issue asking if the update frequency can be increased for zigbee2mqtt:

1 Like

Hi, is it possible to combine this xiaomi_miio platform with aqara gateway platform for Xiaomi AC companion (lumi.acpartner.v3)?

Got a Xiaomi Mi Zigbee Smart Plug connected to HA via deconz. I put this plug on to the washing machine. When the washing machine is not being used, xiaomi plug goes into OFF position after ~30 mins. I want the plug to be ON always even when staying idle, unless i make it off from deconz. Is there a way to do it?

UPDATE: Removing the plug from deconz and readding it solved it. It also solved the Total consumption remaining as “unknown”. Now it stays ON as long as i don’t switch it off and reflects total consumption in kWh.

Hi,

I just noticed the same behaviour when I blocked internet to my xiaomi gateway. Is there a way to get load_power data when the gateway is blocked?