Lovelace: Body Miscale Card 5.6.0

have fun in your break - can not be better, nice weather even in northern Germany.

I have now gotten the update and I am now working on an updated version that I will add to github later tonight.

Now I understand the huge gap cause the picture had been missing.
I suggest that you change this line
image: /local/custom/folder/background.jpg
to the standard image folder
image: /local/img/miscale2.jpg

And here is another improvement for the visual interface:
a switching description of the button called “show details” but here in german
image

and if shown it is the opposite “hide details” or in german “Details einblenden”
image

Makes more sense to discuss it here I guess.

UPDATE: what do these 2 symbols in the upper left stand for?
They never had shown something here. If I measure nothing changes. Is the lower one a sign for issues during measurement and then it should replay to “problems?” with “none” … then the german translation would be “keine” cause nein means no. But I need to know what these are for.
image

1 Like

I like your addition.

The top left icon is the state of bodymiscale.yourname

  1. OK = For 181B Weight and Impedance data is available
    For 181D Weight data is available
    None = No problem

  2. Problem = For 181B Weight and Impedance data is unavailable
    For 181D Weight data is available
    None = Description of the default sensor weight and / or impedance

I put it on when you hover your mouse so on phone it doesn’t work

Sans titre

Regarding these top 2 stati:
for me they seem to be a bit redundant in this case cause the warning sign should only be visible in case everyting is fine.

I suggest this
#1 SCALE ICON “STATUS: OK” - (Warning symbol is hidden or text transparent)
or
#2 WARNING ICON “STATUS: pay attention for these issues”

Why?
You avoid a mixture of icon usage and you only have 2 cases: Scale is OK or Warning.
On top or the most important point: You save space in the section for errors where it is a lot easier to work this was in 2 aligned lines.

2 aligned lines are much easier too read cause we will see there

  • mostly 1 line (for the 181D owners)
  • and usually 2 lines for the 181B owners.
    Weight unavailable
    impedance available

I emphasize on this point cause even german short translations are much longer. Only point might be how to get a CRLF to get those controllable aligned instead of the current one like
image
That could look better if you can start to deal with 2 lines in a column.

I would also suggest to change this section in the setup "measurement success " caused it is just about that. It is not about the scale in general cause the scale can be totally OK and it is just a measurement issue at that time.

3 not a smartphone but echo show user

I have to admit I do not use HA on smartphone right now, just on PC or tablet or Amazon Echo Show.
So I can not judge about smartphone just about PC and Echo show.

What you need to know about amazon show:
I start it with “alexa, start silk” and then tap on the favorite. Therefore I have created a special Favicon on the server that looks more pleasant (green or so).

BUT Silk will switch from silk to the echo show homescreen if you do not use or touch the HA screen. If it had switched to homescreen then you can get it back easily by voice only cause the last page will be opened, so you should see homeassistant and you can setup which dashboard.
I have an echo show 8 which works great in my opinion for such purpose, our show 5 is a bit small, but also a nice device. Screen estate is big enough to hit a HA switch. You mostly will use it for acutal data like power consumption, weather or weight maybe.
I am still working on the final file cause I am pushing the translation into the js file you had released earlier. This way I can see how it will look and shorten the words that would be too long. Saves time for you and additional turns I hope.

4 hovering description is not working for a lot of devices - clean n simple is better

Regarding your hovering idea: it would be a lot more usefull to have real text behind the switch.
All the displays withouth mouse do not show that i guess, tablet nor echo show will display anything for what such switch is usefull. Might also be considerable to have at that point a triangle as switch icon showing with its peak to 3 o’clock (like in a tank turret) to expand and if that is expanded the triangle should be replaced by one that shows down. The power button is misleading a bit , cause it does not toggle its color for turned on and turned off. Yes, the power button looks nicer but first thought is more or less like shut down the scale.

5 FINAL QUESTIO: Why different colured lines ?

Final point: you have 2 blue lines on your picture and a blue “power switch”. This colour is defined in the personal configuration on each device. I have setup a clean “WHITE” instead of this “blue”

My right vertical line is displayed 100% white I had put on the left for better comparison , while the left line looks more blue grey and not white
image image

Maybe it is question of opaqueness or so that caused this change cause I had not notice that second line and was astonished to see your 2 lines.

Here is another bug I guess cause I tried to find the word Kartenkonfiguration and could not find it anywhere.
Then I thought if that is a term provided by the HA environment and that is true, but other lovelace addons show at that point its name so you need to add a switch or attribute or so to get the right text there

"Body Mi Scale " Kartenkonfiguration - but the first part is from you add on for sure.
Still not sure if it would make more sense to add the german translation in such context like the international product name “Body Mi Scale / Waage” as explanation to make it clear for every german. Scale is not a term everybody does know.

Here for comparison vertical staple which shows its title there in the headline.
image

Now I can see the status after the measurement :+1: (here in the screenshot in the lower right corner) after I had cleaned that old cache.
But I guess I have another bug here cause the sensor shows in the developer pane the values like basal consumption but not in the lovelace card which states unavailable … funny :grinning: side note is that the sensor status is OK, and has “no(ne)” problems.

image

Here is another tiny bug “Lack-exerscise”: “Bewegungsmangel”
you mean exercise … the s after the r is 1 letter too much but I do not know if that causes other issues or is just a variable with a funny title.

Here is a kind of tiny bugs / requests / improvements.

Might be usefull to have a pic and other attributes for the sensor for example a picture / avatar of the user next to the user name and most likely to improve the title a bit to ‘STATUS: Aurelien’ or “BODY STATUS: Aurelien” with a small round shaped avatar like the sensors can get this way.

#1 ADD ADDITIONAL ATTRIBUTES TO THAT SENSOR
You can also add additional attributes, but only via the [customize.yaml] file.
Make sure that the customize.yaml file is included in the configuration.yaml like this

homeassistant:
  customize: !include customize.yaml

THEN ADD THESE LINES to [customize.yaml]

bodymiscale.wolf:
  friendly_name:  'STATUS Wolf'               ###   the title of the sensor usefull for body mi scale card etc.
  entity_picture: '/local/img/miscale2.jpg'   ###   small picture for the sensor / person usefull if used in other cards
  icon:           'mdi:scale'                 ###   icon of the sensor

These will be usefull if you use the sensor bodymiscale.wolf in own selfdesigned small cards.

#2 FEW tiny BUGS

Your card from below shows:

  • Impedance: 550 ohm has to be 550 Ohm cause Ohm is the international SI norm for the unit
  • 13,57 for Visceral fat, does it mean 13,57 kg or 13,57%
  • 1500.02 kcal but there is a thousand separator missing for easier reading and of cause 0,02 kcal is too much

#3 IMPROVEMENT OF READABILITY BY CLEANER, ALIGNED STRUCTURE

Improvement: looks a lot better to have decimal aligned figures

BETTER             GOOD SOLUTION        BEST SOLUTION					
but not yet        good but can  		adding the unit			
really good        be 'cleaner'         to the label					
BETTER             GOOD SOLUTION        BEST SOLUTION					
but not yet        good but can  		adding the unit			    VALUE  TREND
really good        be 'cleaner'         to the label					    ▲ᐅ▼

   53 %                53    %          Water            (%)	       53    ▲
   14 %                14    %			Visceral fat     (%)		   14    ᐅ
   23,3 %              23,3  %			Body fat         (%)		   23,3  ▲
   24,2                24,2			    BMI 		                   24,2  ᐅ
   54,6 kg             54,6  kg			Muscle mass      (kg)		   54,6  ▼
   20 %                20    %			Protein          (%)		   20    ▲
1.500 kcal          1.500    kcal		Basal metabolism (kcal)		1.500    ᐅ
    2,9 kg              2,9  kg			bone mass        (kg)		    2,9  ▼
   37 years            37    year	    meatbolic age    (years)	   37    ᐅ
   67,2 kg             67,2  kg			Ideal weight     (kg) 		   67,2  ▲

Of cause I do not know how tricks it is but should be possible cause the icons and labels in the first 2 columns have been aligned nicely too.

One final point here: most likely people would wanna see an indicator arrow for trend compared to the last measurement like arrow up for weight has grown or body fat is lower. Having that in mind it might be good to move the unit to the label to have space for the “trend” signs. Of cause I do not know if the values are stored somewhere, but I guess there will be such a requirement and trend is easier cause small and not as massive as 2nd column would be with previous data and of cause the delta column.

image

#4 IMPROVEMENT: CONFIGUREABLE DECIMALS

I guess it will be usefull to expand the bodymiscale.yaml file for individual decimals cause I guess there would be a lot complains if there is only 1 fixed set available. I do not know the variable names but for a suggestion I will create one you should recognice:

water_decimals:     0 # leads to 53% water (who needs more being unaware how reliable this figure is)
v_fat_decimals:     0 # leads to 13 or most likely 13%
body_fat_decimals:  0 # leads to 23%
bmi_decimals:       1 # leads to 24,2
muscle_decimals:    1 # leads to 54,6 kg 
protein_decimals:   0 # leads to 20%
basal_decimals:     0 # leads to 1500 kcal
bone mass:          1 # leads to 2,9 kg
meatbolic age:      0 # leads to 31 y
Ideal weight:       1 # leads to 67,2 kg

But each and everyone will have his own desire and therefore wanted to have different decimals.
Therefore expanding the bodymiscale.yaml in that way would be good too cause if you cut decimals always someone will complain.
And I do not know an easy way how to cut decimals from the attribute values in the configuration file.

Lot of stuff, but some tiny part, some major parts to get it a bit better and future proof as the title stays for “in progress”

That a lot of change. I am self-taught, I have no in-depth knowledge of programming. I copy bits of code from right and left.

For the power button and the display of the display detail and hide detail I will try to add it. As I cheated with a simple divcheck it forces me to review the code.

For the appearance of the card I want to keep that of the vacuum cleaner here.

To start, I will interfere with your translation.

Then I want to integrate a progress bar with the severity options.

If you have any knowledge I can send you my construction files

1 Like

#1 copier and paster

sorry, not that much knowledge, just copy and paste and digg into the bits and pieces.
If you start with the translation that will be great.
Then have a look at the easier parts like getting rid of the decimals.
I know the formula but do not know how to change an attribute of a sensor entity cause you have to read, round based on the configuration decimals and write back. I might be able to change the weight to 2 decimals by code but that is it.
And vaccum is the next point or the robot I have hear to add. It is just running on the xiaomi home app.
But things get better, we are not in a hurry and I guess you have seen where to look at.

#2 bar card experience
Regarding “progress bar” and severity are you talking about the HACS bar card ?
With that I had done a few things for example for power consumption in the house and colourfull states based on Watts running or Wh already consumed.
And I have adapated Ricardo’s card - from portugal who had placed the code on the mi scale integration. That code had made trouble cause he might have copied a code he had polished but no checked. He had used the attribute access but used upper case letters even those are variable and usually should get lower case and no space but “_”.
After I got your code running I digged into the bugs of his template cause it did not work.
So Bar Card knowledge is there, at least a bit cause I changed a bit too cause I just have the 6 values of the 181D model.
I you think to move bar card then you might get the trend visualisation automatically on the front or end, which I had seen working on Ricardos implementation from time to time appear.
image

I found this pretty usefull and maybe on h-a.io there was a documentation too, which I can not find right now.
GitHub - custom-cards/bar-card: Customizable Animated Bar card for Home Assistant Lovelace

#3 german pre release where I can edit and check how it looks if possible ?
BUT: first suggestion could you send me a german version or a JS file where I can replace the german stuff to get a quick overview how it looks and behave and where I have to shorten ?

I tried it and edited the HA/www/community/lovelace-body-miscale-card/body-miscale-card.js file and replaced the false german entries.
That did not work out.

any ideas

#4 Bug fix for meabolsim and body typ german pre release where I can edit and check how it looks if possible ?

The bodymiscale.wolf sensor shows the values for basal_metabolism = GRUNDUMSATZ and the bmi_label = KRPERBAU but both are NOT displayed in the card. Therefore I guess both might suffer from a typo like Ricardo had using no “-” but " " in the attribute section. I do not know about that but it looks so cause both variables consist out of 2 words and those do not work like Ricardos did not work for me. Maybe these work for the creator only and then do not work for others.

image

thx

Would be good to get a prerelease of the german part to check it before you release cause I expect a bit of work due to lenght and context that might be misunderstood.

For example the “entity (required)” thing was a point I had misunderstood before I had seen the real release and the “selection of a bodymicalc.sensor” where I instantly knew what was meant:
a single scale with just one user or a selection between multiple users.

Therefore I would call it now select a BodyMiScale account / sensor cause that is what it is for in case of a card. Account is a term that everybody understands and it makes sense that Aurelien has an account on the scale when there is a second person using it.

If you have a rough german version put it here and tell me which file(s) I have to replace and what I have to change else. Takes quite some time to get through the translated content and where it appears and how it will fit. I have to leave for a business trip and I would be happy to have that fixed before I have to leave.
thx

The problem is that it automatically compiles the js. that is what you need all the files for. Then you have to use VSC. Do you want me to create a git branch?

I sent you the private github link.

No, thanks a lot for the offer. I just asked for a better understanding if that would be an editible file and would push the pure translation process a lot.
I had already tried to open, translate and saved a lot translations where I hoped to get a better picture if it work or not regarding space, but this newly saved JS file did not see to have changed anything.

I guess it would be VERY good if you release a quick update with these translation and small bug fixes cause right now the german version you had released is disappointing for german users or looks crappy while your extension is not crappy.

1.
The 1. line is OK, but the 2nd and 4th labels on right corner are CRAZY.
AVERAGE: 175 cm
That is bizarre, irritating and destroys the value of your solution so far off is that term. Even more worse: The GENDER you released has become the german word for “NICE”.

2.
In the age line you can see the word " jahre", but it has to be “Jahre” or " Jahre" cause I do not know if you really need the space in front".

3.
NICE WOMAN is not what you expect from a serious scale even though a bit funny, but more like chinese crap, while your solution is not crap.

4.
Finally the 4th point easy to fix is the word “NEIN” next to the warning, which means NO instead of “none” or “no errors”, but “no” is false . At least try to replace it with “kein Messfehler”
which means literally: “No measurenment error”

5.
FINALLY 2 bug fixes that should be easy to fix in the Card: The bodymiscale repository for the scale is working on Ricardo’s Lovelace Card based on Bar Card. It shows all the additional data, but the Body Miscale Card says unavailable for

  • the 3rd item metabolism and
  • the 5th item body type or so.

But these 2 sensors are available in Ricardos Frontend bar card and also in the developer tool panel (bodymiscale.wolf shows these 2 values too and a lot other) and in Ricardos Bar card.

6.
And regarding the stati in the top left try to replace the 2 lines by just 1 line:
Scale and OK or Warning sign and description.
image

And these are bugs in the userninterface I would try to avoid as soon as possible,
same for the missing 5 features my 181D does not support and I can not tell you if there are similiar errors among the 181B still some not working.

4 are just text /translation changes so easy to fix and I guess the compilation should not take so long.

Why? Here you can see what the current german version tries to tells you.
image

You can not show the german version someone else due to terrible translation errors or copy / paste errors and I can not flip to english for the scale.

Do not wait for a bigger solution cause it is the reputation that can suffer from all those german translation issues.
FINALLY: I did do the updates from today / yesterday.

Weight comes with 1 decimal
Bauchfett / visceral fat i guess has 0 deicmals, but no unit ! = I guess it is bug and % are meant, right ?
Ideal weight looks really weird hear, cause it still comes with 2 digits while the weight comes with just 1 decimal. Those shoot fit to each other.

Hello, I’ll push your translation in the morning. For the weights I want to keep the consistency to two decimal places. For the stats on the left you can hide them via the show stats map editor.

Translation fix is very welcomed to get rid of the funny “nice man” or “nice woman”

I can agree to decimal consistency regarding weight but the weight itselfs shows just 1 decimal and that’s why I was writing cause you had said decimal changes - I just have 5 of those features only so I can not tell you, what else might work or not AND 2 attributes out of 5 are not working.

For the stats you are right but it still is not usefull to show both at the same time: you have only 2 states: OK or error and the error message is the only point someone expects.

Now it is redundant and everybody else will tell you that too.
I can hide it but I wanted it to get behind measurement issues cause those are only visible there. I do not know if there is something complicated to show one or the other but if it is OK then there can not be a warning sign cause these are the opposite icons.

Believe me, I had to deal with car UI developers that it needs a clear language.
If you have an error the scale icon could be displayed too cause a scale icon has no message itself compared to a Warning sign.
And the WARNING sign with “none” is not needed if you can read above: SCALE OK

Put a line here if you have updated the german template so I can check it early.

Indeed it makes sense not to display the error icon and none. I watch in the weekend.
I corrected the error metabolism and remove body type
For the decimal weight if 75.50 then 75.5, if 75.55 then 75.55.

Update with translation is available https://github.com/dckiller51/lovelace-body-miscale-dev/blob/main/src/body-miscale-card.js

I did not push it on the hacs

You were the guy of “consistency” so I would still suggest to give each kg value those 2 digits.

Looks a lot better, especially if those are aligned

75,09 kg weight
70,0 kg ideal

You might have a look for that sooner or later cause i do not care about the amount of decimals unless they do not make any more sense for example in the bio impedance measurement with 29,12% or so.

I will download the script file and run through the german version and let you know what I have found out or not. I had only emphasized to get rid of all the translation and typo errors from the Mi app like “nice woman” or " jahre" …

I guess around noon you will see what I had found out.

I am stuck. First I did a backup of the current working js file just to be safe.

I opened the links, agreed to cooperation or so and came to what looks like a file.

I went into raw, ctrl + a, then copy and paste into the
/home/pi/HomeAssistant/www/community/lovelace-body-miscale-card/body-miscale-card.js

Save file and then I did
sudo docker stop homeassistant
sudo docker start homeassistant
I swapped to the browser and did a full refresh / cache via CTRL + F5

I build a new body miscale card but I could not see any change

What do I have to do once I had followed your link?

thx

I’m leaving for work but I just pushed another version because indeed hacs will correct if you modify the card.
file: /home/pi/HomeAssistant/www/community/lovelace-body-miscale-dev/body-miscale-dev.js
ressource: /local/body-miscale-dev/body-miscale-dev.js?v=0.0.1
file download here

Exemple:

type: custom:body-miscale-dev
entity: bodymiscale.aurelien
model: 181B
show_name: true
show_state: true
show_body: true
show_buttons: true
show_toolbar: true
show_attributes: true
image: /local/body-miscale-card/miscale2.jpg

Thanks, I 'll try my best and will complain if the scale is showing a higher weight !

Multiple issues and I guess this will not work
file: /home/pi/HomeAssistant/www/community/lovelace-body-miscale-dev/body-miscale-dev.js
#1 this refers to the hacs folder
#2 but the following ressource points to the local folder

I will move the script out of hacs territory matching your ressource point.

ressource: /local/body-miscale-dev/body-miscale-dev.js?v=0.0.1

And finally there is another bug burried in the 1 or 2 nd line cause if the file is stored in a /lovelace-body-miscale-dev/ folder than the resouce has to point that too and needs the leading “lovelace-”

UPDATE: AS EXPECTED, it did not work this way
I had moved the script out of hacs territory matching your ressource point.

UPDATE II: Don’t ask why, but the other way it worked out

file: /home/pi/HomeAssistant/www/community/lovelace-body-miscale-dev/body-miscale-dev.js
ressource: /local/community/lovelace-body-miscale-dev/body-miscale-dev.js?v=0.0.1

It works right now , but for me such things are a tough digging in the dark.

BEYOND CONFIGURATION of the dev. version:

I guess you and I are old enough to know, what 55,66 kg 180 cm and 31 years and male do mean.
If you agree then we do not need any of these labels anymore. We will get a clean and minimal design reduced to the max: figures and units only.

If you see on a scale 78,56 even without kg you instantly know that this is weight in kg and not size in cm nor age. If you agree do not delete those labels but comment those that you do not loose those translation and who knows if and where they might be usefull later.

Finally: Please adjust the following translations for your future “repository” cause we dont need the bulky “Körpergröße” (litteraly body size) cause Größe alone is enough.

75,84 kg
unavailable (or better hidden for all those 181D owners)
200 cm
31 Jahre
männlich

would be all we need next to a single status = Scale Icon and OK or warning and a message
You will also gain space for these warnings due to saved labels.

Now I will go down into the details you called attributes:

Yes, you’re right

/home/pi/HomeAssistant/www/lovelace-body-miscale-dev/body-miscale-dev.js