Integrating Xiaomi Mi Scale

Hello and congratulations for the graphs, can you explain how you made the table with "current weight, change since yesterday, change last 7 days … Thanks

When i install the HA add-on and configure, save and i will start the addon i get this error:

This add-on does not expose configuration for you to mess with…

I dont see anything on the logs.

That error message doesn’t look familiar at all. Are you sure you installed my add-on?

Yes it is the good one.

Xiaomi Mi Scale

Current version: 0.3.6

Please raise an issue on my github repo

I have added now via the Official integration on HA bodymiscale integration. I can there add users and give the high CM. But there is no option to give some KG greather than or Lower than. How will this app now detect the users?

How will be detect that integration users?
Why are you not use that integration, what is missing there?

That is why I have built my integration, so that multiple users can use it :wink:

Very interested can you please share your config? I want also see some last months history. My grafana with infulxDB is up and running.

It is now working fine, no idea how this is now solved, Do you have also an option how i can see the last months weight on a Graph?

Click on the entity in your dashboard, then click on show more on top right of the chart
Alternatively you can indeed to track this via grafana:

That is ok, but i need to have the metric settings etc. that coming from MQTT and add it to Grafana, how to show that data on a dashboard, that part is very difficult.

Same here. Also interested in getting the add-on to work with an esp32 Bluetooth proxy.

1 Like

Hi Guys, im new here, can you please get some help? the info below come from Xiaomi Mi ScaleXiaomi Mi Scale.

im stuck, i step on scale but nothing happen.

2023-06-22 16:10:29 - Loading Config From Add-On Options…
2023-06-22 16:10:29 - (INFO) -------------------------------------
2023-06-22 16:10:29 - (INFO) Starting Xiaomi mi Scale v0.3.6…
2023-06-22 16:10:29 - (INFO) Loading Config From Options.json…
2023-06-22 16:10:29 - (WARNING) Invalid logging level provided, defaulting to INFO…
2023-06-22 16:10:29 - (INFO) Config Loaded…
2023-06-22 16:10:30 - (INFO) MQTT Discovery Setup Completed…
2023-06-22 16:10:30 - (INFO) -------------------------------------
2023-06-22 16:10:30 - (INFO) Initialization completed, step on scale to wake it up and get a weight value sent… Make sure the scale is within reach…

1 Like

I’ve just the same problem ;/
added MQTT and MiScale add-on


Zrzut ekranu 2023-06-24 o 13.34.50

I have added MiScale support to the Xiaomi BLE integration, so you can now use it directly in HA

3 Likes

Thanks @Ernst. I got it to work. However, it only shows weight, no impedance. I have a composition scale 2.

Edit: Nvm. Works now too. Low batteries probably.

Thanks for your sharing

Not sure what I am doing wrong here. Crosspost from GitHub issue.

Keep getting this:

mi-scale         | KeyError: 'options'
mi-scale         | TERM environment variable not set.
mi-scale         | Traceback (most recent call last):
mi-scale         |   File "/opt/miscale/Xiaomi_Scale.py", line 122, in <module>
mi-scale         |     data = json.load(json_file)["options"]
mi-scale         | KeyError: 'options'

My docker file is:

  mi-scale:
    image: lolouk44/xiaomi-mi-scale:latest
    container_name: mi-scale
    restart: always
    network_mode: host
    privileged: true
    volumes:
      - ./mi-scale:/data
      - /var/run/dbus/:/var/run/dbus/:ro #needed for bleak
    

Been over and over on this but can’t find out what’s wrong. And the options.json file is there obviously. I have placed the options file in data, data/options, opt/miscale/ etc but no dice. I must be something missing in my understanding. In the python code it refers to options.json but then later it does a json load of options, maybe a bug? @lolouk44

Nevermind, figured out the options.json from the add-on differs in that it needs an another dictionary entry called options. Loads now.

Starting mi-scale ... done
Attaching to mi-scale
mi-scale         | TERM environment variable not set.
mi-scale         | 2024-02-20 10:10:27 - (INFO) -------------------------------------
mi-scale         | 2024-02-20 10:10:27 - (INFO) Starting Xiaomi mi Scale v0.3.5...
mi-scale         | 2024-02-20 10:10:27 - (INFO) Loading Config From Options.json...
mi-scale         | 2024-02-20 10:10:27 - (WARNING) Invalid logging level provided, defaulting to INFO...
mi-scale         | 2024-02-20 10:10:27 - (INFO) Config Loaded...

Not getting any messages on console yet though, maybe because of invalid logging level? Also no entities created yet, so I’m guessing something is not working yet/passing stuff to MQTT.

All working now, wrong MQTT password.

Hello,

I did everything. Installed add on, configured, configured configuration yaml. In add on log I see that poeple is on scale and see all info about it, but in HA entity of weight and bmi not appear, what is wrong?
2024-03-14 08:49:53 - (INFO) Initialization completed, step on scale to wake it up and get a weight value sent… Make sure the scale is within reach…
2024-03-14 15:26:12 - (INFO) Publishing data to topic miscale/Martynasnau/weight: {“weight”:40.80,“weight_unit”:“kg”,“bmi”:17.89,“basal_metabolism”:1280.72,“visceral_fat”:1.00,“timestamp”:“2024-03-14T15:26:12+00:00”}
2024-03-14 15:26:12 - (INFO) Data Published …

In mosquito broker log I see too some info of connection:
2024-03-14 15:26:12: New connection from 192.168.8.155:44395 on port 1883.
2024-03-14 15:26:12: New client connected from 192.168.8.155:44395 as auto-C03B54B5-6170-BCD7-C47C-203E03FD3655 (p2, c1, k60, u’marius’).
2024-03-14 15:26:12: Client auto-C03B54B5-6170-BCD7-C47C-203E03FD3655 disconnected.

But no entity appear on HA.

CONFIGURATION:
HCI_DEV: hci0
BLUEPY_PASSIVE_SCAN: false
MISCALE_MAC: 88:22:B2:E7:F3:2A
MQTT_PREFIX: miscale
MQTT_HOST: 192.168.8.155
MQTT_USERNAME: marius
MQTT_PASSWORD: xxxxx*x
MQTT_PORT: 1883
MQTT_RETAIN: true
MQTT_DISCOVERY: true
MQTT_DISCOVERY_PREFIX: homeassistant
MQTT_TLS_CACERTS: Path to CA Cert File
MQTT_TLS_INSECURE: false
DEBUG_LEVEL: debug
USERS:

  • NAME: Mariusnau
    SEX: male
    GT: 85
    LT: 105
    HEIGHT: 190
    DOB: “1984-07-27”
  • NAME: Martynasnau
    SEX: male
    GT: 35
    LT: 50
    HEIGHT: 151
    DOB: “2013-07-05”

CONFIGURATION.YAML
mqtt:
sensor:

  • name: “Mariusnau Weight”
    state_topic: “miscale/Mariusnau/weight”
    value_template: “{{ value_json[‘weight’] }}”
    unit_of_measurement: “kg”
    json_attributes_topic: “miscale/Mariusnau/weight”
    icon: mdi:scale-bathroom
    state_class: “measurement”
  • name: “Mariusnau BMI”
    state_topic: “miscale/Mariusnau/weight”
    value_template: “{{ value_json[‘bmi’] }}”
    icon: mdi:human-pregnant
    unit_of_measurement: “kg/m2”
    state_class: “measurement”
  • name: “Martynasnau Weight”
    state_topic: “miscale/Martynasnau/weight”
    value_template: “{{ value_json[‘weight’] }}”
    unit_of_measurement: “kg”
    json_attributes_topic: “miscale/Martynasnau/weight”
    icon: mdi:scale-bathroom
    state_class: “measurement”
  • name: “Martynasnau BMI”
    state_topic: “miscale/Martynasnau/weight”
    value_template: “{{ value_json[‘bmi’] }}”
    icon: mdi:human-pregnant
    unit_of_measurement: “kg/m2”
    state_class: “measurement”

Whats the problem?

Guys by me all the impedence value is unavailable, what can be the reason? With the loluk mqtt custom integration i get well this data.