Code Monkey home page Code Monkey logo

bodymiscale's Introduction

bodymiscale

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

EN :

The purpose of this custom integration is to have additional information when weighing yourself with a Xiaomi Mi Scale (or any other smart scale). The input sensors for the custom integration are weight and optionally impedance (Mi Scale V2 only). You can use ESPHome or BLE monitor to collect the required data via Bluetooth. The calculations are done in the body_metrics.py file. The configuration is in bodymiscale.yaml where you define name, weight, height, age, gender and impedance (only for Mi Scale V2). The name of the component should be bodymiscale.username.

Information about the unit of measurement. All calculations are made using the unit of measurement KG. If your scale is set in lbs don't worry Bodymiscale will convert for you. If you want to display your data in lbs you can use the card here lovelace-body-miscale-card. Just click on Convert kg to lbs.

FR :

Le but de ce composant est d'avoir des informations supplémentaires lorsque l'on se pese avec une balance connectée Miscale Xiaomi. Actuellement le poids est envoyé sur Hassio avec un ESPHome ou BLE monitor. Le calculateur est le fichier body_metrics.py. La base de données est dans le fichier bodymiscale.yaml on y retrouve name, le poids, la taille, l'age, le genre et l'impedance (uniquement pour la Mi Scale V2). Le nom du composant devra être bodymiscale.username.

Information concernant l'unité de mesure. Tous les calcules sont réalisés à l'aide de l'unité de mesure en KG. Si votre balance est paramétré en lbs ne vous soucié pas Bodymiscale convertira pour vous. Si vous souhaitez afficher vos données en lbs vous pouvez utiliser la card ici lovelace-body-miscale-card. Il vous suffit de cliquer sur Convertir les kg en lbs.

DE :

Der Zweck dieser benutzerdefinierten Integration besteht darin, beim Wiegen mit einer Xiaomi Mi-Waage (oder einer anderen intelligenten Waage) zusätzliche Informationen zu erhalten. Die Sensoren für die benutzerdefinierte Integration sind "Gewicht" und optional "Impedanz" (nur Mi Scale V2). Sie können ESPHome oder BLE monitor verwenden, um die erforderlichen Daten über Bluetooth zu erhalten. Die Berechnungen erfolgen in der Datei body_metrics.py. Die Konfiguration befindet sich in bodymiscale.yaml wo Sie name, weight, height, age, gender und impedance definieren (nur für Mi Scale V2). Der Name der Komponente sollte bodymiscale.username lauten.

Informationen zur Maßeinheit. Alle Berechnungen werden mit der Maßeinheit KG durchgeführt. Wenn Ihre Waage in lbs eingestellt ist, brauchen Sie sich keine Sorgen zu machen, Bodymiscale wird das für Sie umrechnen. Wenn Sie Ihre Daten in lbs anzeigen möchten, können Sie die Karte hier lovelace-body-miscale-card verwenden. Klicken Sie einfach auf kg in lbs umwandeln.

The generated data is :

For miscale (181D)

  • Model Miscale
  • Weight
  • Height
  • Years
  • Gender
  • Bmi
  • Basal metabolism
  • Visceral fat
  • Ideal weight
  • Bmi label

For miscale 2 (181B) (with to impedance)

  • Model Miscale
  • Weight
  • Height
  • Years
  • Gender
  • Bmi
  • Basal metabolism
  • Visceral fat
  • Ideal weight
  • Bmi label
  • Lean body mass
  • Body fat
  • Water
  • Bone mass
  • Muscle mass
  • Fat mass ideal
  • Protein
  • Body type

Installation

Via HACS

  • Search "Bodymiscale" recently added Component under Integrations in the HACS Store tab

Manual installation

  • You can install it manually. Simply copy and paste the contents of the bodymiscale/custom_components folder in yourconfig/custom_components. For example, you will get the file __init __.Py in the following path: /config/custom_components/bodymiscale/__init__. py.

Configuration

key type description
plateform (Required) string bodymiscale
name (Required) string Custom name for the sensor. yourname
weight (Required) sensors / sensor.weight_ Your sensor returning your weight.
impedance (Optional) sensors / sensor.impedance_ Your sensor returning your impedance.
height (Required) number Your height in cm.
born (Required) string Your birthday. "YYYY-MM-DD"
gender (Required) string female or male. "male"
Model (Optional) string Define the scale model."181D" or "181B".

Example

Configuration YAML [configuration.yaml]

bodymiscale: !include components/bodymiscale.yaml

Create a file in /config/components/bodymiscale.yaml.

Configuration with default settings: [bodymiscale.yaml]

yourname:
  sensors:
    weight: sensor.weight_aurelien
  height: 176
  born: "1990-04-10"
  gender: "male"
  model_miscale: "181D"

Configuration with impedance (miscale2) settings: [bodymiscale.yaml]

yourname:
  sensors:
    weight: sensor.weight_aurelien
    impedance: sensor.impedance_aurelien
  height: 176
  born: "1990-04-10"
  gender: "male"
  model_miscale: "181B"

VERSION

v2.0.0

Big update offered by @edenhaus. It offers us a better quality code and especially to be able to work in devcontainer.

  • Add code quality tools, which run with pre-commit
  • removed unused code (e.g. holtek)
  • use @cached_property to run certain calculation only once
  • adjust names and code to python coding styles
  • update ci actions
  • Add devcontainer for easier development

Thanks to you for the work done.

v1.1.5

  • Convert weight from lbs to kgs if your scale is set to this unit (thank you @rale)
  • added portuguese brazilian language support (thank you @hudsonbrendon)

v1.1.4

  • Update getage function to correctly calculate age from DOB (thank you @borpin)
  • Use assignment expressions

v1.1.3

  • Update readme: default integration in Hacs is available
  • Update iot_class (thank you @edenhaus)

v1.1.2

Update for default integration in Hacs

v1.1.1

Update to fix startup errors (thank you @stefangries )

v1.1.0

Adding body score (thank you @alinelena )

v1.0.0

Update for the "181B" model: display the minimum score if the impedance sensor is unavailable.

v0.0.8

spelling update: Lack-exerscise => Lack-exercise

v0.0.7

  • Update decimal by @typxxi (Thanks)
  • Update readme by @typxxi (Thanks)

v0.0.6

  • Use snake_case format for attribute names (thanks to Pavel Popov dckiller51#13)

v0.0.5

  • Rename HomeAssistantType —> HomeAssistant for integrations n*- p* #49559

v0.0.4

  • Fixed a startup error.
  • Update readme by @Ernst79 (Thanks)

v0.0.3

Delete the units for the future custom card.

v0.0.2

Implantation of calculations. Thanks to lolouk44. I took the liberty of taking back these files.

v0.0.1

First version. Thanks to the designer of the component plant of homeassistant.

bodymiscale's People

Contributors

dckiller51 avatar edenhaus avatar tispokes avatar borpin avatar stefangries avatar uraniumdonut avatar

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.