diff --git a/Dockerfile b/Dockerfile index 3c615a4..4e33141 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.8-slim WORKDIR /opt/miscale COPY src /opt/miscale -RUN apt-get update && apt-get install --no-install-recommends -y \ +RUN apt-get update && apt-get install -y \ bluez \ python-pip \ libglib2.0-dev && \ diff --git a/src/Xiaomi_Scale.py b/src/Xiaomi_Scale.py index 398e512..58cf233 100644 --- a/src/Xiaomi_Scale.py +++ b/src/Xiaomi_Scale.py @@ -193,7 +193,7 @@ OLD_MEASURE = '' def discovery(): for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME): message = '{"name": "' + MQTTUser + ' Weight",' - message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json['weight'] }}",' + message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.weight }}",' message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}' publish.single( MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config',