Lovelace: Body Miscale Card 5.6.0

have you had time to move forward?

I will start today - had a lot of trouble with a ubuntu 16 upgrade where I killed the machine which took ages. Lot worse than my windows experiences so far, 8 hours of updates and then it was broken or is still broken.

I will have to deinstall everything out of the HACS world cause I guess there is the cause.

It should work on hacs. I do my tests on a different machine from my production machine. this allows me to offer you something functional.

OK, took quite a bit longer to get all the pieces together.
First I uninstalled the HACS lovelace card and bodymmiscale integtraion.
Then I double checked and deleted all the files Hacs had not deleted (for example below www/community/

The I started the manual installation with all the following steps.

#1
created a folder CONFIG/components

#2
Then I edited the bodymiscale.yaml file this way which seems to work cause later you will see these data appear in a card.

aurelien:
  sensors:
    weight: sensor.weight_aurelien
    # impedance: sensor.impedance_aurelien
  height: '200'
  born: '1989-11-11'
  gender: 'male'
  model_miscale: '181D'

#3
Then I created the next dir and its content: CONFIG/custom_components/bodymiscale/

Attention: the community folder you can see in the screenshot below has been deleted before I started my tests.

#4
then the CONFIG/www directory

#5
Here is the lovelace part 1 in configuration.yaml file

lovelace:
  resources:
    - url: /local/body-miscale-card.js?v=1.0.0
      type: module

#6
Here is the ble monitor part of the configuration.yaml file

ble_monitor:
  ###   MAC ADRESS RASPI   ###
  bt_interface:     'DC:A6:32:05:99:98'
  discovery:        True
  active_scan:      False
  report_unknown:   False
  # batt_entities:  False depreciated
  decimals:         '1'
  period:           '60'
  log_spikes:       False
  use_median:       False
  restore_state:    False
  
  devices:
    - mac:              'C8:47:8C:BB:48:C7'
      name:             'MI SCALE2'
      decimals:         2   
      use_median:       False
      restore_state:    default

#7
In the ressources I have added this line
/local/body-miscale-card.js

Just to let you know: my scale sensor is called

sensor.ble_weight_mi_scale2

and it works cause it shows me the weight in a simple card for a short period of time.

And here the first result; aurelien sensor is not empty (so the yaml file is working)

If I go to the homescreen and add a card via add and select the Body Miscale Card I get this :

ATTENTION: In the second when I delete the 3rd empty row it seem to work somehow, cause I will then get this (looks lilke a progress)

If I press visual editor at that point I get surprisingly this

which looks “unfolded” like this

There I can see a lot of progress, but I still think that at the point where “your aurelien” sensor must pickup my miscale sensor something goes wrong cause the card looks a lot better now, but the core is still that I do not get any data from the sensor.

Final chance might be to remove the manual installation and replace that with a new HACS one, but I will wait for your reply what I can improve or check in the manual installation.

Big thank you from here.

I think the problem is with your sensor.weight_aurelien which must not exist in your system. Is your name Aurélien too? replace it with your sensor.ble_weight_mi_scale2. I think that should unblock the situation.

I just did the test and I confirm if you inform a sensor.weight_XXX that does not exist you have a NULL return in WEIGHT. So you need an existing sensor. Then for the size you must remove the ‘’ so height: 200 for born,
gender and
model_miscale you must put between "

aurelien:
  sensors:
    weight: sensor.ble_weight_mi_scale2
    # impedance: sensor.impedance_aurelien
  height: 200
  born: "1989-11-11"
  gender: "male"
  model_miscale: "181D"

Now with this config it should work :crossed_fingers:

regarding aurelien sensor

Are you sure that it needs “” instead of ‘’?
That part has been working cause you can see in the cards the figures too. They arrived right into the card so that can not be the cause.

I didn’t change the name cause I did not wanna change something good into bad and I had thought that it is required at least for the start.
I had not seen a line on githubg to change my sensor name there, but I will try it out.

These line worked out - at least in the first part

wolf:
  sensors:
    weight: sensor.ble_weight_mi_scale2
  height: 200
  born: "1989-11-11"
  gender: "male"
  model_miscale: "181D"

But there are parts of the description missing I guess
image
then there is a “huge” gap between these lines and that turn on / off button.

I got the weight, but anything else is missing like here
image

I changed the other bodymiscale variables to “” and let the height without “”.
But ’ versus " did not make a difference.

Finally: that bodymiscale.wolf sensor has all the values needed at least I saw them for a few minutes.
Thanks a lot - and time for the next ideas I guess.

Now I have delete this cache in bodymiscale “pycache”

Guess what: I have gotten a 4 new figures, those in the lower section and I those are all that my scale does offer accoding to your documentation

  • Visceral fat
  • BMI
  • Basal metabolism
  • ideal weight

But on the upper half something is missing - I do not know what.
image

And then I have configured the 181D but why is the card showing all that things I my scale does not support like
water (miscale 181B),
body_fat (miscale 181B)
muscle_mass (miscale 181B)
protein (miscale 181B)
bone_mass (miscale 181B)
metabolic_age (miscale 181B)

But know it starts to work after many, many hours most likely caused by the point I did not understand and would have been easier if it would be mentioned in the documententation

not as

aurelien:
  sensors:
    weight: sensor.weight_aurelien
    impedance: sensor.impedance_aurelien

but

yourname:
  sensors:
    weight: sensor.ble_weight_mi_scale2
    impedance: sensor.impedance_aurelien

Last line: I do not know how that is called by default

That was the major point i had struggled all the time for sure.
Thanks again

on the card you must also put the model

model: '181D'

Here is an idea to create your sensor weight.
Only drawbacks when you restart the system you lose the data

- platform: template
  sensors:
    weight_wolf:
      friendly_name: "Weight Wolf"
      value_template: >-
        {% if states('sensor.ble_weight_mi_scale2') | float >= 50 and states('sensor.ble_weight_mi_scale2') | float <= 120 %}
          {{ states("sensor.ble_weight_mi_scale2") }}
        {% else %}
          {{ states("sensor.weight_wolf") }}
        {% endif %}
      unit_of_measurement: 'kg'
      icon_template: mdi:weight-kilogram

I had shorted that code but of cause I was using model ‘181D’.

What are the missing points here called “nicht verfĂŒgbar” and “none”.
Even when weight and BMI appear these stay the same
image

I will now start the translation work for german.

Where can I find the english file for the translation 
 you had a proposal linked above for german but I wanna make sure to get it right and need the englisch one?
thx

UPDATE: I searched for toggle in both hacs and found this - I guess that is the right one, isn’t it?

ye={name:“Bodymiscale Card”,description:“The bodymiscale card allows you to display your body score.”,not_available:“Bodymiscale is not avaialable”,toggle_power:“Show score/Hide score”},we={ok:“OK”,problem:“Problem”,none:“None”,“weight unavailable”:“Weight unavailable”,“impedance unavailable”:“Impedance unavailable”,“weight unavailable, impedance unavailable”:“Weight unavailable, impedance unavailable”},ve={"weight: ":"Weight: ","impedance: ":"Impedance: ","height: ":"Height: ","age: ":"Age: ",“gender: “:“Gender: “},Se={male:“male”,female:“female”,“unavailable kg”:“unavailable”,“unavailable ohm”:“unavailable”},xe={water:“Water”,visceral_fat:“Visceral fat”,body_fat:“Body fat”,bmi:“BMI”,muscle_mass:“Muscle mass”,protein:“Protein”,basal_metabolism:“Basal metabolism”,bone_mass:“Bone mass”,metabolic_age:“Metabolic age”,ideal:“Ideal”,body_type:“Body type”},ke={Skinny:“Skinny”,“Balanced-skinny”:“Balanced-skinny”,“Skinny-muscular”:“Skinny-muscular”,Balanced:“Balanced”,“Balanced-muscular”:“Balanced-muscular”,“Lack-exerscise”:“Lack-exerscise”,“Thick-set”:“Thick-set”,Obese:“Obese”,Overweight:“Overweight”},Pe={” years”:” years”},Me={missing_entity:“Please define an entity.”,missing_enttity_bodymiscale:“Please define a bodymiscale entity.”,missing_model:“Please define a valid scale model.”},Ce={entity:“Entity (Required)”,show_name:“Show Name”,show_name_aria_label_on:“Toggle display name on”,show_name_aria_label_off:“Toggle display name off”,show_state:“Show State”,show_state_aria_label_on:“Toggle display state on”,show_state_aria_label_off:“Toggle display state off”,show_attributes:“Show Attributes”,show_attributes_aria_label_on:“Toggle display attributes on”,show_attributes_aria_label_off:“Toggle display attributes off”,show_body:“Show Body Score”,show_body_aria_label_on:“Toggle display body score on”,show_body_aria_label_off:“Toggle display body score off”,show_buttons:“Show Buttons”,show_buttons_aria_label_on:“Toggle display buttons on”,show_buttons_aria_label_off:“Toggle display buttons off”,show_toolbar:“Show Toolbar”,show_toolbar_aria_label_on:“Toggle display toolbar on”,show_toolbar_aria_label_off:“Toggle display toolbar off”,code_only_note:“Note: Setting actions and stats options are available exclusively using Code Editor.”

Hello,

The English file is here. I will post an update, you will find my german file

Just to let you know:

I will take your english file and fill in the german translation.

but i will also add comment lines for you that all start with #
That way you can easily remove those, but also get behind my thoughts.
So most likely you will find a lot of thoughts cause some things are different like “weight not available” would be called “weight measurement not available”.
and there are other points like “weight not available” or does it mean the Weight is currently / actual not available cause the person for sure has its weight, only the scale service is suffering temporarily I guess.

Just to let you know cause I had already started
Here is an example - you just need to remove the # line and the empty line afterwards.

{
    "common": {
      "name": "BodyMiScale Karte",
      # First question or point: I changed to upper letter whereever needed like in name. BodyMiScale is far better cause you can idenitfy its meaning a lot easier then an endless row of letters. I translate everything into german where younger people are used or more familiar with the english card which translated means Karte like a card in a card game. BodyMiScale itself is a productname so I do not tranlate scale into "Waage"
      # name:"Bodymiscale Card",description:"The bodymiscale card allows you to display your body score."
      # here i added body status but "weightwise" which are just weight related data not body status regarding blood pressure.

      "not_available": "BodyMiScale ist momenatan nicht verfĂŒgbar",
      #if you meant to say that the scale is not available I would call it "Ihre BodyMiScale Waage ist momentan nicht verfĂŒgbar" or if you meant the service itself then I would call it "Der BodyMiScale Dienst ist momentant nicht verfĂŒgbar" and I added "actually not available" "momentan nicht verfĂŒgbar"

      "toggle_power": "Weitere Details wie BMI kCal anzeigen / ausblenden"
      # Punktzahl is a kind of score you achieved in an examin or decathlon competition. I guess you mean "showing further details"      
    },

I just pushed an update with my DE file

Please note I changed the icons again for the body score part. I added the description to add them to your configuration

1 Like

Just a plain simple question: do average french people really know what a impedance means ? I had to check it up to get behind it that it is not the usual physical impedance of springs but about the body composition and its measurement.

I would try to help people to find an orientation what impedance in that context really means and therefore you would need more words than just “impedance” cause it is a complex thing and you need to search for the right term “bioelectrical impedance” other wise you might be lost in physics of springs.

:smiley:
I used the Mi Fit app as a basis. These are the terms used. I confirm that the impedance is well related to the weight calculation

Now I understand where you had gotten the translations from, not bad but not really well and I wonder how well the french edition is cause I did not use the app and did not even know about biological impedance measurement till now where I had to read up what it means and does.

If you need a good or a better translation service which pretty good results at leas for german - english and spanish - english then have a look at deepl.com 
 they have a pretty decent context translation a lot better than all the others.

UPDATE:
Here are 2 points you can check too

      "unavailable kg": "Gewichtsmessung momentan nicht verfĂŒgbar",
      # you had here "nicht verfĂŒgbar" which would mean not available but I guess it is about "weight measurement is not available".

      "unavailable ohm": "Bio Impedanzmessung momentan nicht verfĂŒgbar"
      # attention: here is a bug in the english word if it meant ohm, the measurement of resistance of electrical conductors. I guess you mean the Bio Impedance measurement unavailable ohm"

I had an error in version 4.1.0 I just pushed 4.1.1
The idea is to let people translate into their language to be sure of the translation.
As you are doing. For my part I use the google translator to chat with you. I often think my English should not be understood

I’m going to work I’ll read you again tonight

Oh, you start to work and will miss the match I guess?

I type and translate all the stuff manually and still do not dictate. I only crosscheck words I do not know and the impedance thing was such a critical point I had to look into. anyway.

Here is a long file with a lot of explanations and thoughts how that might have been meant in english cause the chinese had made errors where I had first thought that you had gotten the false translations. So I explained to you in detail what the proposed translation meant and what it should be 
 cause gender had been translate into german as nett. But nett means nice and has nothing to do with Geschlecht - “your gender is ?”

As i had thought you had tried the translation I explain all details cause honestly I would also consider extend the original english version a tiny bit here and there.

I have added that file to github as an issue that you can implement it. Here it would be far too long to add or read.

I’m on a break from 9 p.m. to 11 p.m. :innocent:

1 Like