dckiller51 / lovelace-body-miscale-card

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
MIT License
81 stars 23 forks source link

Buttons do not work in firefox and iOS app #7

Open danieldotnl opened 3 years ago

danieldotnl commented 3 years ago

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!

danieldotnl commented 3 years ago

I just found an error in the logs that seems to be related:

Logger: frontend.js.latest.202106030 Source: components/system_log/init.py:190 First occurred: 10:09:58 AM (7 occurrences) Last logged: 10:10:08 AM

https://{{REDACTED}}/hacsfiles/lovelace-body-miscale-card/body-miscale-card.js?hacstag=358847829461:414:5719 TypeError: e is undefined
:0:0 ResizeObserver loop completed with undelivered notifications.
dckiller51 commented 3 years ago

hello, user switching is not functional. For the power button it is possible that it does not work under firefox I used a simple chekbox. I am in the process of migrating from the card to typescript this will correct this problem and will allow me to integrate the number format.

dckiller51 commented 3 years ago

Hello, I have made good progress on the migration. We will lose the replacement part of the attributes but the basic and functional map. The numbers reflect the local configuration. I added an up / down chevron to display the score. Works well on iOS. To test you can go to this address. this is available through hacs custom repos.

https://github.com/dckiller51/bodymiscale-card

danieldotnl commented 3 years ago

Thanks, but I still have lots of problems with the new card. Whenever I activate 'Show personal data', it just disappears (really strange) and the same happens with 'Offer further measurements'. This happens in all browsers..

PS: maybe this issue now needs to be moved to the new repo?

programmaker commented 2 years ago

It's a great job that has been done so far. but I have an issue with user switching. I've configured card like this

type: custom:body-miscale-card model: true show_name: true show_states: true show_attributes: true show_toolbar: true show_body: true show_buttons: true entity: bodymiscale.ilia buttons: ilia: icon: mdi:alpha-a-circle label: ILIA service_data: entity_id: input_boolean.bodymiscale.ilia_info_toggle dasha: icon: mdi:alien label: DASHA service_data: entity_id: input_boolean.bodymiscale.dasha_info_toggle

but can't get how to switch between users.

I have two entities: bodymiscale.iliaand entity: bodymiscale.dasha I've described them in bodymiscales.yaml as ilia: sensors: weight: sensor.ilia_ble_weight_scales impedance: sensor.ilia_ble_impedance_scales height: 173 born: "1985-03-19" gender: "male" model_miscale: "181B"

dasha: sensors: weight: sensor.dasha_ble_weight_scales impedance: sensor.dasha_ble_impedance_scales height: 164 born: "1986-03-11" gender: "female" model_miscale: "181B"

sensor.dasha(ilia)_ble_weight(impendance)_scales described as template sensor in config/sensors.yaml

Balance Connectée

ilia_ble_weight_scales: friendly_name: "ILJUSHA Weight" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 80 <= weight <= 110.99 %} {{ states('sensor.ble_weight_scales') }} {% else %} {{ states('sensor.ilia_ble_weight_scales') }} {% endif %} unit_of_measurement: 'kg' icon_template: mdi:weight-kilogram

dasha_ble_weight_scales: friendly_name: "Dashuha Weight" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 40 <= weight <= 68.99 %} {{ states('sensor.ble_weight_scales') }} {% else %} {{ states('sensor.dasha_ble_weight_scales') }} {% endif %} unit_of_measurement: 'kg' icon_template: mdi:weight-kilogram

ilia_ble_impedance_scales: friendly_name: "ILJYSHA IMPENDANCE" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 80 <= weight <= 110.99 %} {{ states('sensor.ble_impedance_scales') }} {% else %} {{ states('sensor.ilia_ble_impedance_scales') }} {% endif %} unit_of_measurement: 'ohm' icon_template: mdi:omega

dasha_ble_impedance_scales: friendly_name: "Dashuha IMPENDANCE" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 40 <= weight <= 68.99 %} {{ states('sensor.ble_impedance_scales') }} {% else %} {{ states('sensor.dasha_ble_impedance_scales') }} {% endif %} unit_of_measurement: 'ohm' icon_template: mdi:omega

can you help me start switching between users

Thank you very much.

dckiller51 commented 2 years ago

C'est un excellent travail qui a été fait jusqu'à présent. mais j'ai un problème avec le changement d'utilisateur. J'ai configuré la carte comme ceci

type: custom:body-miscale-card model: true show_name: true show_states: true show_attributes: true show_toolbar: true show_body: true show_buttons: true entity: bodymiscale.ilia boutons: ilia: icon: mdi:alpha-a-circle label: ILIA service_data : entity_id : input_boolean.bodymiscale.ilia_info_toggle dasha : icône : mdi:alien étiquette : DAHA service_data : entity_id : input_boolean.bodymiscale.dasha_info_toggle

mais je n'arrive pas à savoir comment basculer entre les utilisateurs.

J'ai deux entités : bodymiscale.iliaet entity : bodymiscale.dasha je les ai décrites dans bodymiscales.yaml comme ilia : sensor : weight : sensor.ilia_ble_weight_scales impédance : sensor.ilia_ble_impedance_scales taille : 173 né : "1985-03-19" genre : "male" model_miscale : "181B"

dasha : capteurs : poids : sensor.dasha_ble_weight_scales impédance : sensor.dasha_ble_impedance_scales taille : 164 né : " 1986-03-11 " sexe : " féminin " model_miscale : " 181B "

sensor.dasha(ilia)_ble_weight(impendance)_scales décrit comme modèle de capteur dans config/ sensors.yaml #Balance Connectée ilia_ble_weight_scales: friendly_name: "ILJUSHA Weight" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 80 <= poids <= 110,99 %} {{ states('sensor.ble_weight_scales') }} {% else %} {{ states('sensor.ilia_ble_weight_scales') }} {% endif %} unit_of_measurement : 'kg' icon_template: mdi:poids-kilogramme

dasha_ble_weight_scales: friendly_name: "Dashuha Weight" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 40 <= poids <= 68,99 %} {{ states('sensor.ble_weight_scales') }} {% else %} {{ states('sensor.dasha_ble_weight_scales') }} {% endif %} unit_of_measurement : 'kg' icon_template: mdi:poids-kilogramme

ilia_ble_impedance_scales: friendly_name: "ILJYSHA IMPENDANCE" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 80 <= poids <= 110,99 %} {{ states('sensor.ble_impedance_scales') }} {% else %} {{ states('sensor.ilia_ble_impedance_scales') }} {% endif %} unit_of_measurement : 'ohm' icon_template: mdi:omega

dasha_ble_impedance_scales: friendly_name: "Dashuha IMPENDANCE" value_template: >- {% set weight = states('sensor.ble_weight_scales') | float %} {% if 40 <= poids <= 68,99 %} {{ states('sensor.ble_impedance_scales') }} {% else %} {{ states('sensor.dasha_ble_impedance_scales') }} {% endif %} unit_of_measurement : 'ohm' icon_template: mdi:omega

pouvez-vous m'aider à commencer à basculer entre les utilisateurs

Merci beaucoup.

Hello, The option is not implemented.