Integrating Xiaomi Mi Scale

Does anyone could give me an example on how to store the scale data historical?
for now i use the mini graph card to show all data in a nice way, but it updates every 1-2 hours… so if you dont use the scale for more than one day, the timeline is filled with the last value which makes it pretty useless :sweat_smile: would be nice to hear how you guys made the visualization and also the comparison of the historical data.

greets

I use your addon directly from your github and addon store integration.

EDIT:
I’ll try this:

{
  "name": "Xiaomi Mi Scale",
  "version": "0.7",
  "slug": "xiaomi_mi_scale",
  "description": "Read weight measurements from scale via BLE",
  "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
  "startup": "before",
  "boot": "auto",
  "devices": ["/dev/ttyACM0:/dev/ttyACM0:rwm"],
  "host_network": true,
  "privileged": ["NET_ADMIN", "SYS_ADMIN"],
  "options" : {},
  "schema" : {}
}

EDIT2: Won’t work, replace configuration when install

I use influxdb and Grafana for this

I’ve not written the add-on.
What happens if you try the docker container separately?

could you give me some examples? i havent used graphana ^^

Check this post:

thanks work perfect

Just tried to install @Tobi0892 addon but there is no longer any refresh option in the addon store and the addon does not show.

If someone can show me how to create an add on I can try and have a go

Just tried this with my neglected MI Scale original (no body composure) (https://hub.docker.com/r/lolouk44/xiaomi-mi-scale), never used it with BLE before yet it worked perfectly.

Really happy considering my Raspberry Pi was already acting as a server and it was 3 stories away, worked a charm .

1 Like

This worked great, however the problem comes when every few minutes I want to run another script that sends data from Xiaomi Temperature Sensor. Also bluetooth, same libraries. Is there a way I can make them coexist?
I am guessing they can’t use bluetooth resources at the same time.

if you’re using the code from the github, I’ve just pushed a change to allow you to set the sleep time and changed the default sleep from 1s to 30 sec
if you’re using the container version, I’ll push a new version once I’ve rebuilt the containers

I really appreciate the quick reply. I have tried running the new script directly but I’m getting an error.

root@yoda:/var/script/xiaomi_mi_scale/src# bash wrapper.sh
  File "/var/script/xiaomi_mi_scale/src/Xiaomi_Scale.py", line 39
    TIME_INTERVAL = int(os.getenv('TIME_INTERVAL, '30'))
                                                    ^
SyntaxError: invalid syntax

In the meantime I change it manually to 30 sec in Xiaomi_Scale.py (time.sleep) so no rush.
It’s working perfect now.

sorry I had committed but not pushed my change. Try again pls

Not a problem, tried it, working, thanks

So many messages on this post :grinning: I followed back but it is very hard to figure out if there is a working solution. Can someone point me in the right direction? Thank you so much!

If you’re asking how to connect try https://hub.docker.com/r/lolouk44/xiaomi-mi-scale

Guys,

Can someone tell me where i can startup? This integration is now in development right?

  • WHat is the best choise to buy a Scale? Mi Scale vers 1 or vers 2 ?
  • I have Zigbee and MQTT working on my Hass. Does this Mi scale have a Zigbee or do i need to implement on my HASS bluetooth and connect the scale via Bluetooth?

This is not an ha native integration. This is something I’ve “created” because nobody else had done it the way I wanted. It only works on Bluetooth and not really reliable of using a raspberry pi built in Bluetooth, much better with a Bluetooth dongle.
Scales v2 also provides body composition data, v2 only provides weight

Do you mean v1 only support weight?

My hass is installed on a PC under Linux. Which bluetooth dongle can i better buy? Do you have a good working tutorial how to install the dongle also?