Giter Club home page Giter Club logo

Comments (5)

zewelor avatar zewelor commented on July 22, 2024

I don't have V2 so not sure. Never heard of anyone reported that V2 works with this code. So probably not ?

from bt-mqtt-gateway.

nightcat91 avatar nightcat91 commented on July 22, 2024

I would like to try and get it to work, maybe that would help others as well.

Just not sure how exactly I would start with that???
I did have a look into the worker file of the xiaomi scale and saw that you are looking for a specific value and then do some math with that.

EDIT: this here is what I was looking at:
https://github.com/zewelor/bt-mqtt-gateway/blob/master/workers/miscale.py#L43-L44

Would you be able to help me with this? Maybe I can find out the bluetooth messages from the scale and maybe you could do the code for it, since I am not good at programing?

Is there a good program or app to capture all the bluetooth content that the scale is sending so I could give that content to you?

Thanks a lot

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 22, 2024

Hi

I think there is good chance that someone already reversed v2 and protocol is described somewhere. Here is good explaination of reverse process for V1, you can try to recreate that. https://github.com/oliexdev/openScale/wiki/Xiaomi-Bluetooth-Mi-Scale

Code in miscale worker is just copied from some exmplaes, available on the internet. You can take this worker and play with it to get correct weight retrieving procedure for V2.

from bt-mqtt-gateway.

bbbenji avatar bbbenji commented on July 22, 2024

This repository has been updated with support for the v2 scale. Please update and let us know how it works for you. Closing for now.

from bt-mqtt-gateway.

nightcat91 avatar nightcat91 commented on July 22, 2024

Hi,

@bbbenji , thanks for letting me know about the update.
I just tested it (complete new install) and I seem to have a few issues...

EDIT: My old problem with the mqtt not working correctly, it was because the service was still present and active on the raspberry it started the gateway in the background. And me starting it with the normal command made it run twice and that fucked everything up big time.... my bad.

Now I did find a real problem (I think). When you use the scale and either wear socks/shoes (basically anything else apart from bare feet) or you step off the scale after you see the weight before the body measurements, you get the following error from the gateway and it stops!

("Impedance is too high (limit >3000ohm)")

Traceback (most recent call last):
  File "./gateway.py", line 73, in <module>
    mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute())
  File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 58, in execute
    messages = self._callback(*self._args)
  File "/home/pi/bt-mqtt-gateway/workers/miscale.py", line 72, in status_update
    results.weight, height, age, sex, int(results.impedance)
  File "/home/pi/bt-mqtt-gateway/workers/miscale.py", line 263, in __init__
    raise Exception("Impedance is too high (limit >3000ohm)")
Exception: Impedance is too high (limit >3000ohm)
Traceback (most recent call last):
  File "./gateway.py", line 91, in <module>
    raise e
  File "./gateway.py", line 73, in <module>
    mqtt.publish(_WORKERS_QUEUE.get(timeout=10).execute())
  File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 58, in execute
    messages = self._callback(*self._args)
  File "/home/pi/bt-mqtt-gateway/workers/miscale.py", line 72, in status_update
    results.weight, height, age, sex, int(results.impedance)
  File "/home/pi/bt-mqtt-gateway/workers/miscale.py", line 263, in __init__
    raise Exception("Impedance is too high (limit >3000ohm)")
Exception: Impedance is too high (limit >3000ohm)

Could this be caught somehow and maybe if someone just steps on the scale for the weight but does not wait for the body measurements, just send out the mqtt messages containing the weight and nothing else.

from bt-mqtt-gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.