mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 07:17:14 +00:00
Added bonus template sensors to convert kilograms to pounds (#11779)
* Added bonus template sensors to convert kilograms to pounds added bonus template sensors to convert kilograms to pounds. This will save users from having to re-invent the wheel on their own. * added {% raw %} tags * edited {% raw %} tags
This commit is contained in:
parent
6862d13244
commit
83280ea57a
@ -84,3 +84,56 @@ profiles:
|
||||
required: true
|
||||
type: map
|
||||
{% endconfiguration %}
|
||||
|
||||
## Bonus: Template Sensors to Convert Kilograms to Pounds
|
||||
|
||||
In a text editor, replace ```USER_PROFILE_NAME``` in the template sensors below with your withings User Profile Name defined in the Withings integration configuration.
|
||||
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
sensors:
|
||||
- platform: template
|
||||
sensors:
|
||||
withings_weight_lbs_USER_PROFILE_NAME:
|
||||
friendly_name: "withings weight_lbs_USER_PROFILE_NAME"
|
||||
unit_of_measurement: 'lbs'
|
||||
value_template: "{{ (states('sensor.withings_weight_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}"
|
||||
icon_template: mdi:weight-pound
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
withings_bone_mass_lbs_USER_PROFILE_NAME:
|
||||
friendly_name: "withings bone_mass_lbs_USER_PROFILE_NAME"
|
||||
unit_of_measurement: 'lbs'
|
||||
value_template: "{{ (states('sensor.withings_bone_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}"
|
||||
icon_template: mdi:weight-pound
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
withings_fat_free_mass_lbs_USER_PROFILE_NAME:
|
||||
friendly_name: "withings fat_free_mass_lbs_USER_PROFILE_NAME"
|
||||
unit_of_measurement: 'lbs'
|
||||
value_template: "{{ (states('sensor.withings_fat_free_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}"
|
||||
icon_template: mdi:weight-pound
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
withings_fat_mass_lbs_USER_PROFILE_NAME:
|
||||
friendly_name: "withings fat_mass_lbs_USER_PROFILE_NAME"
|
||||
unit_of_measurement: 'lbs'
|
||||
value_template: "{{ (states('sensor.withings_fat_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}"
|
||||
icon_template: mdi:weight-pound
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
withings_muscle_mass_lbs_USER_PROFILE_NAME:
|
||||
friendly_name: "withings muscle_mass_lbs_USER_PROFILE_NAME"
|
||||
unit_of_measurement: 'lbs'
|
||||
value_template: "{{ (states('sensor.withings_muscle_mass_kg_USER_PROFILE_NAME') | float * 2.20462262185) | round(2) }}"
|
||||
icon_template: mdi:weight-pound
|
||||
```
|
||||
|
||||
{% endraw %}
|
Loading…
x
Reference in New Issue
Block a user