Giter Club home page Giter Club logo

lovelace-body-miscale-card's Introduction

body-miscale-card

GH-release GH-downloads GH-last-commit GH-code-size hacs_badge

Card for data of Xiaomi scales in the Lovelace user interface of Home Assistant

The card is linked to the Bodymiscale custom components for Xiaomi scales. https://github.com/dckiller51/bodymiscale

Installation

Manually add body-miscale-card.js to your <config>/www/ folder and add the following to the configuration.yaml file:

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

OR install using HACS and add this (if in YAML mode):

lovelace:
  resources:
    - url: /hacsfiles/lovelace-body-miscale-card/body-miscale-card.js
      type: module

The above configuration can be managed directly in the Configuration -> Lovelace Dashboards -> Resources panel when not using YAML mode, or added by clicking the "Add to lovelace" button on the HACS dashboard after installing the plugin.

If you want to use the scales background image, download and add src/images/miscale2.jpg to <config>/www/images/ or configure your own preferred path.

For body score icons, download and add [src/images/bodyscoreIcon/*.png]https://github.com/dckiller51/lovelace-body-miscale-card/tree/main/src/images/bodyscoreIcon to <config>/www/images/bodyscoreIcon/.

Configuration

Name Type Default Description
type string Required custom:body-miscale-card
entity string Required bodymiscale.name
name string/bool friendly_name Override friendly name (set to false to hide)
image string/bool false Set path/filename of background image (i.e. /local/img/miscale2.jpg)
attributes [Entity Data](#entity data) (see below) Set to false to hide all attributes
buttons [Button Data](#button data) (see below) Set to false to hide button row

Entity Data

Default bodymiscale attributes under each list:

  • attributes (right list) include weight, impedance (Optional), height, age and gender.
  • body (below list) include water (miscale 181B), visceral_fat, body_fat (miscale 181B), bmi, muscle_mass (miscale 181B), protein (miscale 181B), basal_metabolism, bone_mass (miscale 181B), metabolic_age (miscale 181B), ideal, body_type.

See examples on how to customize, hide or add custom attributes.

Name Type Default Description
key string Required Attribute key on bodymiscale entity
icon string Optional icon
label string Optional label text
unit string Optional unit

Button Data

Default buttons include user1, user2, user3, user4 and user5. See examples on how to customize, hide or add custom buttons/actions.

Name Type Default Description
icon string Required Show or hide stop button
service string Required Service to call (input_boolean.toggle)
show bool true Show or hide button
label string Optional label on hover
service_data object entity_id: input_boolean.bodyscale_user1_info_toggle

Other models

Define your model. false (181D) or true (181B) (with to impedance)

Name Type Default Description
model bool false Supported models: with or without impedance

Screenshots

body-miscale-card

body-miscale-card-image

Examples

Basic configuration:

- type: custom:body-miscale-card
  entity: bodymiscale.name
- type: custom:body-miscale-card
  entity: bodymiscale.name
  image: /local/custom/folder/background.jpg
  name: My Bodymiscale
  model: false

Hide specific attributes and/or buttons:

- type: custom:body-miscale-card
  entity: bodymiscale.name
  attributes:
    age: false
    gender: false
  buttons:
    user1: false

Customize specific buttons:

- type: custom:body-miscale-card
  entity: bodymiscale.name
  buttons:
    user1:
      icon: 'mdi:alpha-a-circle'
      label: Aurélien
      service_data:
        entity_id: input_boolean.bodyscale_aurelien_info_toggle

Add custom attributes:

- type: custom:body-miscale-card
  entity: bodymiscale.name
  attributes:
    body_type:
      key: body_type
      label: 'Body type: '
    water:
      key: water
      label: 'Eau: '
      unit: '%'

Add custom buttons and service calls:

- type: custom:body-miscale-card
  entity: bodymiscale.name
  buttons:
    new_button:
      icon: mdi:light-switch
      label: Custom button!
      service: light.turn_off
      service_data:
        entity_id: light.living_room

Add custom bar options (To know the start, destination, color and target values, open your Mi Fit app on your smartphone.)

Options

Name Type Default Description
color string var(--score-card-color, var(--ha-card-background)) Color of the bar.
height string 30px Defines the height of the bar.
max number 100 Defines maximum value of the bar.
min number 0 Defines minimum value of the bar.
positions object none Defines the positions of the card elements. See Positions Options.
severity object none A list of severity values. See Severity Options.
target number none Defines and enables target marker value.
width string 100% Defines the width of the bar (Required the name must be on outside).

Severity Options

Name Type Default Description
from number Required Defines from which value the color should be displayed.
to number Required Defines to which value the color should be displayed.
color string Required Defines the color to be displayed.

Positions Options

Name Type Default Description
icon string outside inside, outside, off
name string inside inside, outside, off
minmax string off inside, outside, off
value string inside inside, outside, off
type: custom:body-miscale-card
entity: bodymiscale.test
model: false
show_name: true
show_states: true
show_attributes: true
show_toolbar: true
show_body: true
show_buttons: true
entity_row: true
buttons:
  user1:
    show: true
body:
  bmi:
    positions:
      name: outside
      minmax: inside
    width: 50%
    target: 21
  bmi_label:
    color: blue
    height: 40px
  visceral_fat:
    severity:
      - from: 0
        to: 4.99
        color: blue
      - from: 5
        to: 10
        color: green
      - from: 10.01
        to: 15
        color: red
    target: 15
    min: 0
    max: 25

Translations: Automatic (setting of your homeassistant) or manual Currently the languages available are DE,EN,FR,IT,NL,PT-BR,ZH-HANS, you can contact me to integrate your native language

- type: custom:body-miscale-card
  entity: bodymiscale.name
  body:
    water:
      label: 'Eau: '
    bmi:
      label: 'IMC: '
  attributes:
    weight:
      label: 'Poids: '
      unit: ' kg'
    height:
      label: 'Taille: '
      unit: ' cm'
    age:
      label: 'Age: '
      unit: ' ans'
    gender:
      label: 'Genre: '
  buttons:
    user1:
      label: Aurélien
    user2:
      label: Siham
      show: true

Credits

The card is based on the work of Ben Tomlin https://github.com/benct/lovelace-xiaomi-vacuum-card The card is based on the work of Denys Dovhan https://github.com/denysdovhan/purifier-card

Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with the Xiaomi Corporation, or any of its subsidiaries or its affiliates. The official Xiaomi website can be found at https://www.mi.com/global/.

lovelace-body-miscale-card's People

Contributors

dckiller51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lovelace-body-miscale-card's Issues

404 on icon images

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
5.9.3

Last working release (if known):

Browser and Operating System:
HA: Manged Raspberry Pi OS

Client:
Windows 10 64b Pro - Chrome 109.0.5414.120
Also happens with the android app

Description of problem:

The card is unable to load it's icons, returning a 404.
Also I was unable to set the background image to a local route, had to link to an external image to get it to work.
Might be helpful to know that I'm using the duckdns addon.

image

Javascript errors shown in the web inspector (if applicable):

body_type.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/body_type.png 404 (Not Found)
bmi.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/bmi.png 404 (Not Found)
protein.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/protein.png 404 (Not Found)
visceral_fat.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/visceral_fat.png 404 (Not Found)
body_fat.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/body_fat.png 404 (Not Found)
water.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/water.png 404 (Not Found)
muscle_mass.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/muscle_mass.png 404 (Not Found)
ideal.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/ideal.png 404 (Not Found)
basal_metabolism.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/basal_metabolism.png 404 (Not Found)
bone_mass.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/bone_mass.png 404 (Not Found)
metabolic_age.png:1          GET https://[[myduckdns]]/local/images/bodyscoreIcon/metabolic_age.png 404 (Not Found)

Additional information:

Fully hide the card header

Is it possible to hide the entire attribute header? I mean not show the background image or any of the main attributes on the top. I was able to hide everything, but the block was still there, empty but still there.

For me the header informations are useless and would be nice to show only the body of the card, saving some space on my dashboard.

If already is possible and I missed this feature, could you point me the configuration entry for that?

I don't find your card module on HACS.

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:

Last working release (if known):

Browser and Operating System:

Description of problem:

Javascript errors shown in the web inspector (if applicable):


Additional information:

Show values to lbs

I usually use pounds(lbs) but the output is only in kg. Could you give a choice in the lovelace configuration to display lbs?

Ukrainian Language

Hi!
That's a really cool card! Let's add support for the Ukrainian language
Glory to Ukraine!

I can't change user

I have 3 users I can't switch between them on the use1 use2 use3 button. How do I do this?

more user

is it possible to add more user??

Breaking out additional info into own entities?

Hi, thanks for the component. How would I break out the individual measurements such as Body fat, Visceral fat or BMI into their own entities so I can track them over time with things like Grafana? Thank you!

Icons do not work on Firefox

Icons use webkit-mask-box-image, which is a nonstandard property without Firefox support (source).

As suggested by this source, would it be possible to use mask-border instead?

Many thanks for all your hard work so far!

Add date of measurement to card

I would like to show the date of the last measurement an the card. Is this already possible and I just don't see how?
Thanks for all help!

Adding Russian

Hello, I made a translation of your awesome card to Russian (see an attached ru.json). Can you add Russian to your card? Thank you.

ru.zip

Home Assistant can't load the custom element

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
v5.9.2

Last working release (if known):
It's my first installation

Browser and Operating System:

Browser: Chrome Version 105.0.5195.125 (Official Build) (64-bit)

Operating System: Manjaro Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.15.65-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 15.4 GiB of RAM
Graphics Processor: llvmpipe
Manufacturer: Dell Inc.
Product Name: XPS 13 7390 2-in-1

Description of problem:
Error loading the file body-miscale-card.js, whe I use it in the lovelace It don't load and show an error.

Javascript errors shown in the web inspector (if applicable):

Uncaught SyntaxError: Unexpected reserved word (at body-miscale-card.js?v=1.0.0:306:77)

When I push in this message, it shows this line:

function me(e){return le({descriptor:t=>({async get(){var t;return await this.updateComplete,null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(e)},enumerable:!0,configurable:!0})})}

Additional information:
Visual Code showme a message with an error in the file:

'await' expressions are only allowed within async functions and at the top levels of modules.ts(1308)
body-miscale-card.js(537, 50): Did you mean to mark this function as 'async'?

Card not working, only picture shown

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
v 5.6.5

Last working release (if known):
none, newly installed today

Browser and Operating System:
Chrome 94.0.4606.61 (Official Build) (64-bit) (cohort: Stable) on Windows 10

Description of problem:
With the config below, I only get a nice picture of my scale, but no data.
Without the picture config, I only get a empty rectangle

  - type: custom:body-miscale-card
    entity: bodymiscale.martijn
    image: /local/pictures/miscale2.jpg
    model: true

image

The entity works fine:
image

Javascript errors shown in the web inspector (if applicable):
None as far as I can see. Only related thing I see in the inspector is this:
image

german translations author typxxi

EVALUATION OF LATE NIGHT BUILT 0620

First note goes to the built number: 0620-hh should be the new sheme where hh are representing the hour of release cause I had yesterday only gotten 0620s

I will start with pure translation points except that I wanted to start from top to bottom and therefore begin with a non translation issue but a more general one which you had already answered and I added your reply as state: not possible yet.

I. TRANSLATIONS

#1
card configuration title should be
"Lovelace body miscale Card Configuration"

For me it should be the spot #1 for the BUILT number like cause I was struggling a lot what code my card was relying on which is very frustrating to not be able to get behind which code is running except by differentiating that due to its translation errors
"Lovelace body miscale [0620-hh] Card Configuration"
STATE: post poned cause right now not possible

#2
A new error or untranslated term had appeared behind the scale icon "unknown"
image

I guess we need to call that "STATUS: unbekannt" (means "STATE: unknown")
Therefore the previous "OK" value has to change too into "MESSUNG: OK" (means "MEASUREMENT: OK").
That way both messages are accurate for its purpose, first for scale in general, second is about the measurement results.

Search for
"OK"
and replace the whole german term by this
"MESSUNG: OK"

And regarding "unknown" you have to implement that on your own as "State: unknown" - for german "STATUS: unbekannt"
Do not forget in case of errors to show behind the scale icon the state message "State: error" - for german "STATUS: Fehler", at least as long as both icons are shown at the same time.

#3
Search for
"Auswahl der Waage / Person erforderlich"
and replace the whole german term by this
"Bitte ein Waagen Konto auswählen [erforderlich] !"

After being unsatisfied with the previoius term (which is right but feels weird to read and explain) we now could go the technical way which would mean a "Sensor - user name" combination or much easier "Please choose your scale account [mandatory] !"

You have a scale and even if you are alone the system it can only work if you have created at least 1 account in that bodymiscale.yaml file - can you tell me that a second user has to be added in that file too ?

#4
Search for
"Bild (Optional)"
and replace the whole german term by this
"Hintergrundbild [optional]"

For me it is not about "pic" but about a "background pic" cause the figures will lay in front that (background image).

#5
Search for
"Detaillierte Messergebnisse anbieten"
and replace the whole german term by this
"Detaillierte Messergebnisse anbieten (untere Hälfte - per Power Button einblenden)"

This means "Offer detailed measurement results (lower part - press power button to show)"

As said before it would be nice if there is a way to add a carriage return line feed / new line after "... anbieten"
"Detaillierte Messergebnisse anbieten
(untere Hälfte - per Power Button einblenden)"
I had seen that before but I can not tell you where.

#6
Search for
"Schaltfläche anzeigen"
and replace the whole german term by this
"Schalter (U) anzeigen (rechts unten)"

Previous "Schaltfläche" means a (bigger) switch area like 'cancel' or so, but what you mean is that U spot / button which is called in german "Schalter" / button and where I added (U) cause it looks like an "U" in a white circle switch.

#7
Search for
"Symbolleiste"
and replace the whole german term by this
"Symbolleiste anzeigen (Power Button und Schalter)"

I had to change the terms inside to "Power Button" (the translation "Einschaltknopf" sounds weird in that context cause it would mean to turn the whole scale on / off which it does not do).

Therefore I still suggest to use any different kind of button instead that particular turn on / off button which will cause questions.

I still recommand an icon that represents to hide / unfold something like a triangle or twister ᐅ to press for more details and if that had been pressed I suggest to replace that previous ᐅ with the opposite twister / triangle like this ▼ cause this switch has a toggling meaning to show or hide details.
A power button on the other side would always target on a device as a whole like turn on / off your complete HiFi not a particular feature on that stereo.

#8
Search for
"Bitte beachten ...."
and replace the whole german term by this
"ACHTUNG: Weitere Optionen sind nur im Code Editor verfügbar. [0620-hh]"

which means
"ATTENTION: Further options are only available in the code editor. [0620-hh]"

QUESTION: I have deleted the word "actions" cause I was not sure if there are any actions available or not and if actions have to be mentinoned there cause usually it will cause questions like "What actions ?"

I'd prefer the short and simple one cause that would work better on tablet or smartphones too and would not lead to ask what other "actions" are available.

UPDATE: 21st 17:00
#9#
This translation in the beginning of the former translation file has been lost cause the translation had been already there and is now replaced by the oldest or first one.
"name": "BodyMiScale Karte",
"description": "Die BodyMiScale Karte kann Ihnen Ihren gewichtsmäßigen Körperstatus anzeigen."

II. GENERAL CONFIGURATION

This chapter is beyond translations, more integral questions in general like in which order why option should appear or even been hidden cause it makes no sense to offer switches that will not be shown if the general symbol bar is off, but that explanation will follow below.

Just an example that you first need a symbol bar that is turned on to then make those other switches available.

I.
You need a new first line as explanation of the general behaviour
BIG LETTERS: CHANGES WILL ONLY APPEAR AFTER BEING SAVED.

Why is that important ?
I had struggled with it but only in certain cases. While in configuration you can press any of those 6 switches but nothing will change before you will have saved it. But on the right half iof the configuration dialog you have a preview and for example that power button in the preview will be working regardless how the switches are switched or not.

II.
Please move that "model number" input line above that "Background image" line for the simple reason that all mandatory inputs should get the highest amount of attention in the top section and should be selected first followed by the less important optional ones like that Background image.

III.
I would love to see a better structure in the configuration especially regarding these in total 6 switches.

image

Therefore can you please add an empty line (or separator line out of ----) above the first switch which is followed by this line
"Options for card header" = "Kartenkopf Optionen"

IV.
After these first 3 switches I would love to see
an empty line
followed by this additional
"Further card options (measurement details / switches)" or in german "Weitere Kartenoptionen (Messung Details / Schalter)"
Yes, both german versions are this time shorter !

It will make it a lot easier in the beginning to understand where the targets of the upper half are and what each switch is for while we both do it know now blindly due to daily training but the average user will struggle which swtich is what for (therefore I had pointed out where those things are located).

V.
Right now the switches 4, 5, 6 are not in the RIGHT and an INTUITIVE order !
4 show button for more measurement details
5 show switch
6 show symbol bar

But that LAST SWITCH "show symbol bar" has to be the first choice in the lower section cause without showing the symbol bar switches 4 and 5 are useless to click on and therefore should stay hidden / unavailable, right ?

Only once "symbol bar" is activated the other 2 switches should appear cause only then they can work.
Without icon bar enabled the "show button" and "show switch" are running into the emptineess as we called it here.
4 Show symbol bar
5 Offer button for more measurement details
6 Show switch

I chose "offer button for more measurement details" cause you only offer a button which has to be pressed to show further measurement details. This is not a general switch to always show the measurement details. "show" instead "offer" will be misunderstood cause if you would activate that switch "show button for more measurement details" people will mostly only read and expect "show more measurement details"

VI.
The "Switch (U)" should get a title like "Show scale account selector(s)" and that would finally mean to replace "show switch" by "Show scale account selector(s)" ?
ATTENTION: if you already have done the translation tasks mentioned above in the first section then you will have to do this

Search for
"Schalter (U) anzeigen (rechts unten)"
and replace the whole german term by this
"Den / Die Waagekonten Auswahl Schalter (U) anzeigen (rechts unten)"

VII.
Regarding the model number input I was not happy too and I am not convinced about that way you had implemented cause in reality it is - at least right now - just a choice between 2 scales and nothing more. Therefore:

Isn't a switch a better solution to chose between 2 models where '181D' should be the default setting?
I suggest as title "Do you own model 181B incl. impedance measurement?"

By default it is turned of and therefore it will run as a model 181D user.
Everyone with a better model does not loose much with such basic setting and can switch easily to the better 181B to get more measurement details.
If the "poor" 181D owner turns on this switch for the 181B model he will get a lot more label but no values and learns what the differences are between those similar looking scales - as I had learned it too from you and your code / data.

That typing solution is not ideal and it would never be my first choice even though you read the initial value out of the yaml file and you might write that value back too. Such switch would work at least right now a lot better and looks nicer too for sure.

AND: a switch does not need the additional "mandatory" term too cause with a switch the card would start by default as 181D.

VIII.
I guess we have to change the order of the detailed measurement results in the lower half.

BMI should be followed by
BMI classification
FINALLY: Age can be deleted from that measurement detail page cause it is not really needed there.

III. POINTS TO NOT FORGET

1. VARIABLE OR LABEL NAME with TYPO
I saw in the translation file this "Lack-exerscise": "Bewegungsmangel" and exercise is spelled without the s in "rsc"

2. ALL ABOUT FIGURES AND FORMATS

  • usefull, consistent decimals like 2 decimals for weight
  • metabolism kcal figure with national / domestic thousand separators like german 1.856 kcal instead of 1,856 kcal
  • central european figures with a "," as decimal separator cause 102.3 is not right here
  • long term: user CONFIGUREABLE DECIMALS in bodymiscale.yaml

3. Aligned lines for Status (upper left)
For the left upper status we should make sure that the users gets just 1 icon (scale or warning, but never both cause they are contradicting) in case things are going wrong like for example in a measurement.
181B owners can get longer and misaligned error messages that go over 2 lines where the 2nd line starts
even below that warning icon instead of being aligned to the first line.
image

Boutton séléction

Bonjour,
Pour commencer merci pour le travail fourni l'intégration et le lovelace sont parfait.
J'ai une petite question concernant les bouton pour changer les infos de l'utilisateur j'ai lu tout les ticket et de ce que j'ai compris je devrais mettre les choses comme ça

type: custom:body-miscale-card
entity: bodymiscale.giovanni
model: true
image: /local/miscale2.jpg
buttons:
  Giovanni:
    label: Giovanni
    show: true
  Melissa:
    label: Melissa
    show: true

j'aimerais s'avoir si je me trompe ou non car impossible de les afficher en vous remerciant d'avance

PS: je me suis permis d'écrire en français car il me semble que vous l'êtes.

Issue with translation again

I have red all the issue reports about the translation and can't understand the following. The author states that there is no way yet to set the translation language manually, it follows the system settings. But despite that there are a lot of language files in the 'translation' folder of the custom component. In my setup I have only one entry that can't be translated, it's shown in the screenshot. This entry (State of the BMI interpretation) is translated in the corresponding language file, but not updated in the card. Actually, the card is not using the language files at all, because even if you delete the language file and clear the cache of the browser the card stays translated with that only entry missing, as in the screenshot. So how it actually works and how it can be corrected?
Bodymiscale

Card not showing

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue: 2023:11.0

Last working release (if known): None, just trying to set this up the first time.

Browser and Operating System: Chromium, Firefox, Linux, Android

Description of problem:

Installation is done through HACS, but the card doesn't show up for me. I tried different browsers, I don't see any errors in the JS console. Any pointers on how to attempt to debug this?

image

Javascript errors shown in the web inspector (if applicable):


Additional information:

Custom language set manually.

I have english local on my OS. How i can setup manually Ru translation for lovelace-body-miscale-card?
Thanks advance!

Always show details

Hi,

I was wondering if it is possible to always show the details and remove the button?

Greetings,
Jos

Image and Icons not shown

Hi,
for me the image is not showing and neither the icons are.
I have copied the image into ~/config/www/images/ and the Icons to ~/config/www/images/bodyscoreIcon/

In the card config I have set the path as /local/images/miscale2.jpg or /local/miscale2.jpg both do not work. Any tips? Probably I just can not type the right path I guess.

Cannot find this in HACS default

When checking in my HACS integration for Frontend addons, I cannot find this card. Would love to install it though. Manual install seams also not possible as the link to the .js file returns a 404 error.
Thanks for any help in advance

make show "advanced" visible by default

at the moment by default the card shows only a synopsis. with the nicer more visual part hidden by default... make it configurable to have the possibility to have the card starting with this section expanded.

Readme updates in the configuration author typxxi

CONFIGURATION TABLE
#1
plateform (Required) | string | bodymiscale
Typo cause you meant platform

#2
name (Required) | string | Custom name for the sensor.&nbsp;bodymiscale.nom
at the end it should be most likely like in the card mean name instead of nom, so bodymiscale.name

#3
Then in the yaml file description I'd suggest to change the definition to the source sensor that is there when you had installed the miscale instead of using a specific one. I had struggled a lot, really about 10 hours to get it working simply due to my misunderstanding about the meaning of nom / name and the sensor. I did not get anything further without your help but I guess I would not have struggled if that would have been changed.

instead of weight: sensor.weight_aurelien then sensor.ble_weight_mi_scale2

#4
and maybe a tiny bit more explanations below these 2 settings

[configuration.yaml]
bodymiscale: !include components/bodymiscale.yaml
[bodymiscale.yaml]
aurelien:
  sensors:
    weight: sensor.ble_weight_mi_scale2
height: 176
...

The configuration.yaml entry will create a plattform sensor called bodymiscale.
The name of the sensor itself is defined in the bodymiscale.yaml file in the first line by aurelien:

To check if the configruation is working properly go to the developer tools and look for the values of the
bodymiscale sensor by typing bodymiscale . You should see a sensor in this case called bodymicale.aurelien which has a lot of values (number of values shown is depending on your scale model).

Not so many changes but will reduce the demand of support and struggles - hopefully.

open for other integrations?

Is your feature request related to a problem? Please describe.
probably not.

Describe the solution you'd like
I am using the Withings Integration, since I am using a Withings BodyScale at home.
I would love to know if the card would also be open for other integrations that provide similar information... I think, it should be not too hard to allow manual configuration for entities?

Describe alternatives you've considered
not sure if there are alternatives...

Additional context

Translate

Good morning again, if you want I can also translate the values given by the scale into Spanish.

Buttons do not work in firefox and iOS app

Thanks for the great card and integration!
Unfortunately, the buttons (for showing the lower part of the card and for changing users) don't work for me in firefox and also not in the home assistant ios app.
In chrome/edge everything works fine!

Age Unavailable years

Very strange thing happened.

3 Users all show "Age: Unavailable years"

Troubleshoot step:

  1. Check entity attributes.
  • Got metabolic_age:xx
  1. Reload intergration for user.
  • After reload, this user display all good. But all other user become unavailable including kg, age all attributes.
    So reload User A, User B and C will become unavailable. After that, reload User B, User A and User C will become unavailable.
  1. Restart HA
  • All age become Unavailable. But Weight and Impedance display correct.

One more question:
User C age is 4 years old. When add user via UI, there is no metabolic_age:xx shows under attribute.
Not sure if there is age limited.

How to make it support Traditional Chinese support on this card?

Hello dckiller51,

Suppose Home Assistant Traditional Chinese Code is zh-Hant or zh-tw
and I modifty your translate json and rename to zh-Hant.json
but didn't work, I switch my account to S.Chinese it can show the S.Chinese , mean the zh-Hans is work
but when I switch back to T.Chinese , it display the english language not the zh-Hant
how can I use T.Chinese in this card??

I also upload my modified zh-Hant.json for your reference
zh-Hant.json

Thanks~

How to change language?

Hi, thank you for your contribution on miscale lovelace, but I don't know how to config this card to make it shown as Chinese, could you help me

Share configuration

Hi @dckiller51,

thanks for the nice card :)
Can you please share the config of the card in the image below?
I get only bars and I like the one in the screenshot :)

Configuration card

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.