Skip to content

Commit

Permalink
0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lolouk44 committed Sep 8, 2020
1 parent e3b5f12 commit fcf0df3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mi-scale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ 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

- 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"

Expand Down
2 changes: 1 addition & 1 deletion mi-scale/src/Xiaomi_Scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
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',
Expand Down

0 comments on commit fcf0df3

Please sign in to comment.