out of interest, some users appear to have success by adding time.sleep(0.1) to the btle.py file (located in /usr/local/lib/python3.8/site-packages/bluepy/btle.pyin the container)
No idea if it’ll work, buth worth a try.
Another user used a separate bluetooth dongle and has no issues (reported) since
Seems like I’m stuck since the container always is restarting:
" pi@raspberrypi:~ $ docker exec -it mi-scale nano /usr/local/lib/python3.8/site-packages/bluepy/btle.py
pi@raspberrypi:~ $ docker exec -it mi-scale /bin/bash
Error response from daemon: Container 7e849f367875a5a50afe44800de0e1c42658ffd3a1d5174044a300781f1ede00 is restarting, wait until the container is running
pi@raspberrypi:~ $ docker exec -it mi-scale nano /usr/local/lib/python3.8/site-packages/bluepy/btle.py
Error response from daemon: Container 7e849f367875a5a50afe44800de0e1c42658ffd3a1d5174044a300781f1ede00 is restarting, wait until the container is running
I managed to run docker container inspect id/name and found UpperDir in JSON output which made me find the directory. The weird thing is that I don’t have the btle.py-file in the directory at all. Is there anything I need to add before installing this docker-file?
then nano with the path retrieved
if adding the line doesn’t work, then I don’t know. It seems to be an issue with bluepy / RPi and maybe a BT USB dongle is what you need…
I gave up on the Raspberry Pi and tried with another Raspberry Pi 3B+ since no store near me has a Bluetooth dongle. Was able to set it up and start the container, it even reported back the value from the scale to Hassio. But for the wrong user, not really sure why…
But, after I stepped off the scale it stopped working and the container went into the restarting-loop. Tried to reboot everything and now it restarts after 6 seconds (as you can see in the picture). Compared to the first time, it doesn’t send the value to hassio before restarting… I checked the logs for the container now and it gives me the same error messages as for the other RPis I’ve tried with.
What version of Raspbian and Docker are you using? Or do you have any recommendation for Bluetooth dongles that would work?
Out if interest what user did the data come under?
In not using raspbian, I use an HP N54L micro server with ubuntu 16.04.
I have no idea what dongle I have, it was the cheapest btle one I found when I bought it on eBay several years ago
It was reported to MQTT under “miScale/Elin/weight” instead of “miScale/Dennis/weight”, but I guess it could have something to do with us being 1KG from each other in the environment variables.
I installed the add-on for RPi4 on my hassio-device and now it seems to work. The result in Hassio differs from 0,5-0,2kg to what’s on the display of my scale. But it’s clearly good enough for me.
Do you know if it’s possible to store weight for pets? Tried to add a third user but my guess is that the scale has some kind of limitation regarding storing of weight-data that doesn’t register human contact.
Hello @lolouk44 and thanks for your work, I have an HP microserver too on proxmox 6.
The path of my bluetooth isn’t ttyAMA0 :
[supervisor.docker] Can't start addon_local_xiaomi_mi_scale: 500 Server Error: Internal Server Error ("error gathering device information while adding custom device "/dev/ttyAMA0": no such file or directory")
I use the standard bluepy library so don’t need to set device path anywhere. No idea where to change this.
Are you using an add on, a docker container or direct script from my github?
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 would be nice to hear how you guys made the visualization and also the comparison of the historical data.