From fcf0df3b32c13774e1ae2031ba569424a2aa0dfd Mon Sep 17 00:00:00 2001 From: lolouk44 Date: Tue, 8 Sep 2020 22:31:02 +0100 Subject: [PATCH] 0.1.9 --- mi-scale/README.md | 4 ++-- mi-scale/src/Xiaomi_Scale.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mi-scale/README.md b/mi-scale/README.md index c94a23e..d9b99f3 100644 --- a/mi-scale/README.md +++ b/mi-scale/README.md @@ -75,7 +75,7 @@ Under the `sensor` block, enter as many blocks as users configured in your envir - platform: mqtt name: "Example Name Weight" state_topic: "miscale/USER_NAME/weight" - value_template: "{{ value_json['Weight'] }}" + value_template: "{{ value_json['weight'] }}" unit_of_measurement: "kg" json_attributes_topic: "miscale/USER_NAME/weight" icon: mdi:scale-bathroom @@ -83,7 +83,7 @@ Under the `sensor` block, enter as many blocks as users configured in your envir - platform: mqtt name: "Example Name BMI" state_topic: "miscale/USER_NAME/weight" - value_template: "{{ value_json['BMI'] }}" + value_template: "{{ value_json['bmi'] }}" icon: mdi:human-pregnant unit_of_measurement: "kg/m2" diff --git a/mi-scale/src/Xiaomi_Scale.py b/mi-scale/src/Xiaomi_Scale.py index 3fc8df9..3076e82 100644 --- a/mi-scale/src/Xiaomi_Scale.py +++ b/mi-scale/src/Xiaomi_Scale.py @@ -189,7 +189,7 @@ OLD_MEASURE = '' def discovery(): for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME): message = '{"name": "' + MQTTUser + ' Weight",' - message+= '"state_topic": "miscale/' + MQTTUser + '/weight","value_template": "{{ value_json.Weight }}","unit_of_measurement": "kg",' + message+= '"state_topic": "miscale/' + MQTTUser + '/weight","value_template": "{{ value_json.weight }}","unit_of_measurement": "kg",' message+= '"json_attributes_topic": "miscale/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}' publish.single( MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config',