Xiaomi Mi Smart Plug (New Model) Device Handler

It works with the new Smartthings app.

Regarding history, I’m not sure if this is what you mean but I can see historical power readings in the “History” tab for the device:

I can also see it as a graph on the “Controls” tab.

Yes, that’s exactly what I meant, thank you! I’ll be getting a couple of these. It seems like they are the only cheaper alternative for Samsung’s own plugs that actually show energy usage.

I just bought three of these and edited the device handle according to the thread (it was included from my previous sensors through Github, so I only had to change the two lines.

It’s only been a couple of minutes (15? EDIT: 2 hours) but it’s not showing energy usage on any of them. How often does it update?

Edit. Hmm, I don’t seem to have the “Power meter” statistic like you have in your screenshots. I only have “Energy consumption” which is at 0W so far (though it hasn’t been long since I added them). The same goes for both Classic and the new Smartthings app.

I must be missing something of course, I wonder what it is.

Just double checking, but did you edit the device and change the Type field to use your DTH? Can you include a screenshot of yours?

Hmm, no I did not. That might be what I am missing. I might have glared over it, as I mostly checked your reply that was marked as “solved”.

Since I already had bspranger from Github (because of my Xiaomi sensors) I only added the device handler for my Xiaomi outlets and then changed the corresponding lines to match yours (changing to 15 and 16 respectively on line 165 and 172).

I’ll go back and double check and report back.

Edit: It was set as “Zigbee Switch Power” as default. When I switched to “Xiaomi Zigbee Outlet” it does indeed show current wattage usage as intended. That did the trick! Thank you @johnconstantelo! You just made my weekend!

2 Likes

sigh

After changing type to “Xiaomi Zigbee Outlet” two of the three outlets do show current wattage, while the third does not. It has the same settings and has been changed to the same type. It’s been on for at least a couple of hours now, shows temperature (which I ignore since it’s at 130 Celsius) but does not show wattage. I have a “dumb” meter connected to that same outlet which shows just below 600W being used, yet the Xiaomi outlet doesn’t show any wattage usage.

Here’s a screenshot of that device (it’s a large screenshot, so I’ll host it at Imgur): https://imgur.com/a/b7W5OeZ

Here’s a comparison to one of the working ones: https://imgur.com/a/NqFu0fm

Any ideas?

Edit: Another sigh because it now works after unplugging it and back again. Problem solved, I hope!

Edit 2: While I’m here, does anyone know if it’s possible to somehow show the wattage usage as “default” among the tiles instead of it showing as a outlet that I can turn on and off?

While not optimal of course, I am using these as “smart energy meters” and they will always be on, so I don’t need it to show up as an actual outlet that I switch on and off from the tiles.

Good that you got it working! Also, nice surprise to see Swedish on your screenshots :slight_smile:

I’m using it for the exact same purpose and would also like to do that.

So I have researched this before because I also have some Aqara temperature/humidity sensors that display humidity by default and I would instead want to show temperature on the app tile. I couldn’t find a way to do it in the new app and I am trying to stick to that as much as possible so it doesn’t hurt as much when Samsung cuts the Classic app, whenever that happens.

However, there seems to be a way to edit the default tile metric on the Classic app but I haven’t tried it myself. Maybe you are OK with using the Classic app so here’s the link to what I found, if you’re interested:

Hope it helps. Lycka till!

Always fun to se fellow Swedes doing this!

Honestly, I don’t like the Classic app at all and only ever use it when I’m adding new devices since it seems to work better. I also have several Xiaomi sensors and two Aqara. At the moment I’m not using the Aqara sensors, but I’m pretty sure they worked as intended when I did use them.

I had another issue with the Xiaomi sensors not reporting temperature on the tiles and was forced to change phone language to English instead of Swedish. Not a good solution, but it worked. Perhaps it could be something similar for you (or not of course).

If you ever happen to stumble upon a solution to showing energy usage on tiles as default with the new app, please let us know!