OMG supports indeed presence detection by scanning BLE devices and reading of devices dependent values from the following ones (temperature, moisture, humidity…):
Regarding the reading of value coming from BLE scales I’m interested, do you have a link to yours?
I would like to, but I need to know what to do at least, to say yes.
This scale for some reason sometimes called as YUNMAI Scale from Xiaomi.
Maybe this is relabeled Xiaomi product. Here is the link for example: https://us.gearbest.com/body-scale/pp_719052.html
Just flash an esp32 with : default_envs = esp32dev-ble
and post here the different servicedata field you see in your mqtt broker corresponding to the scale, with the corresponding weight measured.
Any instructions on how to do this (links please)? This is my first time when I used ESP32.
I just loaded precompiled files into ESP32. Can’t find anything on Google. Played with ESP8266 a lot.
OK, All errors are cleared, (learning with Platformio), and now Im getting even less information from the scale.
now:
{“id”:“0c:1c:xx:xx:xx:xx”,“manufacturerdata”:“dº¤W\f”,“rssi”:-64,“distance”:x.79xxxx}
No change just this information {“id”:“0c:1c:xx:xx:xx:xx”,“manufacturerdata”:“dº¤W\f”,“rssi”:-64,“distance”:x.79xxxx}
Is it need to be authorized with a pin code? And how to?
Because when scale connected to the android app it uses a pin code.
Hello!
I want to add to your discusion. I was doing some research about how to connect OMG with the Xiaomi Scale and I found this thread. In mi case, it’s a Xiaomi Scale (First version).
I inspect the publications and I found the following lines, where apear the servicedata field:
Also I found and interesting post about “decrypting” the bluetooth traffic of this scale. In this post, the author explain that the connection isn’t open and the scale broadcasts the weight in the Bluetooth POST: https://github.com/oliexdev/openScale/wiki/Xiaomi-Bluetooth-Mi-Scale
Okey! I have it!!!
The number of service data is in little endian format. Splitting the number in pairs, and choosing the 2 and 3 pair you can get the weight. It is wide explained in the post, but in summary the idea is:
Get the service data and split in pairs:
…“servicedata”:“a2ac2be307060207122b”… => a2 ac 2b e3 07 06 02 07 12 2b
…“servicedata”:“a28039e3070602070e28”… => a2 80 39 e3 07 06 02 07 0e 28
Choose the second and third pair and turn them (because are hex number in littel enndian)
ac 2b => 2bac
80 39 => 3980
Convert to decimal and divide by 200. (Divide by 100 if you use lb)
Just to know, you think that can be integrated to OMG in the future? Or better I make a script that does the calculations and conversions and re-publish the results.