Custom_component bodymiscale [For Xiaomi Miscale 1& 2] Esphome or BLE Monitor

Here are my screens

In options leave blank

Finally I installed the dev version thank to your reply. But I continue with the error with the dckiller51:dckiller51 version:

[23:42:22] INFO: Installing esphome version 'esphome_version:dckiller51:dckiller51' (https://github.com/esphome_version/esphome/archive/dckiller51.zip)...
Collecting https://github.com/esphome_version/esphome/archive/dckiller51.zip
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://github.com/esphome_version/esphome/archive/dckiller51.zip
[23:42:23] FATAL: Failed installing esphome pinned version.
[cont-init.d] 30-esphome.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

The dckiller51 version no longer exists. it has been integrated into the official dev. you must not specify a version in the configuration.

1 Like

Dear dckiller,

Thanks a lot, the integration works perfectly now, I can read all the data from my BodyScale.

Thanks,

1 Like

Hi @dckiller51,

Thanks again for a new great integration.
I use Passive BLE Monitor integration and it added automatically my Mi Body Composition Scale 2. Thanks to this I can read the impedance and the non-stabilized and stabilized weight given by the scale.
I also added your component using HACS and following your steps explained on GitHub.
How do I make the link between both? Is there anything else to do to make it work?

Right now, I see bodymiscale entities but not the weight and impedance entities.

Hello,

Does that answer your question?

Actually, I understood after posting this that I need to give the same entity names for the weight and impedance between the bodymiscale and the blemonitor integrations.

1 Like

Hello,

this is my card for MIScale:

You can make template sensors for the attributes if you change it to “easy readable” format in the /config/custom_components/bodymiscale/const.py.

For example ATTR_FATMASSTOLOSE = “Fat mass to lose” has to be changed to ATTR_FATMASSTOLOSE = “fat_mass_to_lose”

There is only one question left, which is the right evaulation, the results in the official app Zepp or these ones? Because lot of result differrent between the results.

1 Like

Hello, I did not understand the meaning of your example

I should put the attributes with “_”

For example ATTR_FATMASSTOLOSE = “Fat mass to lose” has to be changed to ATTR_FATMASSTOLOSE = “fat_mass_to_lose”

If you make a template sensor with originial attribute, for example:

      scale_fat_mass_to_lose:
        friendly_name: lefogyasztandó zsír
        value_template: "{{ states.bodymiscale.merleg.attributes.Fat mass to lose }}"
        unit_of_measurement: "kg" 

then you got an error and the sensor can not be compiled. Maybe the spaces between the words cause the problem.

Ok You must use like this.

{{ state_attr('bodymiscale.merleg', 'Fat mass to lose') }}

Look here also I put an example of manual card. You can change the name and the unit

Another card in progress

I tried it, the attribute fat_mass_to_lose is changed back to Fat mass to lose in both files, in the const.py and the template sensor too.
I got this error in this case:

Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:486
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 12:33:43 (1 occurrences)
Last logged: 12:33:43

Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected name or number) for dictionary value @ data['sensors']['scale_fat_mass_to_lose']['value_template']. Got "{{ states.bodymiscale.merleg.attributes.'Fat mass to lose' }}". (See ?, line ?).

Perhabs it is working with picture elements but doesn’t work as template sensor…? :thinking:

hello, this is my settings. where do you think is wrong?

@dckiller51 - that calculation for age did not take into account leap years.

I have dropped a PR to correct this and also one to suggest the ReadME is explicit on the format for the DOB - YYY-MM-DD.

HTH

Hello,
I am trying to update the bodymiscale integration to v 1.1.4 but I am getting this error after the update.
Obviously I can’t restart home assistant but luckly I can restore the backup.error when trying to update bodymiscale

The Passive BLE Monitor integration has been improved such that the impedance and weight sensors for the V2 scale now report almost simultaneously. Passive BLE Monitor integration - #410 by Ernst

I’m still seeing duplicate updates from this component though.Double reports if the two sensors are updated at different times · Issue #51 · dckiller51/bodymiscale · GitHub

V2.0.0 not triggering correctly when sensors change.

I have 2 scales defined and both updated at the same time as one of the sets of sensors updated.

Reverted to 1.1.5 and all OK @dckiller51

hello, is this card removed? i need it!!!

hey there. I really want to use mi-scale with multiple persons.
But how?

How can I use the bodymiscale integration (setup from gui) wiht multiple persons · Discussion #83 · dckiller51/bodymiscale (github.com)