diff --git a/mi-scale/CHANGELOG.md b/mi-scale/CHANGELOG.md index a199440..e856ee1 100644 --- a/mi-scale/CHANGELOG.md +++ b/mi-scale/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.1.15] - 2020-11-26 +### Changed +- Fixed MQTT Discovery Message + ## [0.1.14] - 2020-11-24 ### Changed - 2nd attempt to fix executable files (fixes https://github.com/lolouk44/hassio-addons/issues/23) diff --git a/mi-scale/Dockerfile b/mi-scale/Dockerfile index f38c447..e3f84fe 100644 --- a/mi-scale/Dockerfile +++ b/mi-scale/Dockerfile @@ -1,9 +1,9 @@ FROM python:3.8-slim -LABEL io.hass.version="0.1.14" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64" +LABEL io.hass.version="0.1.15" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64" WORKDIR /opt/miscale COPY src /opt/miscale -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install no-install-recommends -y \ bluez \ python-pip \ libglib2.0-dev && \ diff --git a/mi-scale/config.json b/mi-scale/config.json index 82f6edf..7952d0b 100644 --- a/mi-scale/config.json +++ b/mi-scale/config.json @@ -1,6 +1,6 @@ { "name": "Xiaomi Mi Scale", - "version": "0.1.14", + "version": "0.1.15", "slug": "xiaomi_mi_scale", "description": "Read weight measurements from Xiamomi scale via BLE", "url": "https://github.com/lolouk44/xiaomi_mi_scale_ha_add_on", diff --git a/mi-scale/src/Xiaomi_Scale.py b/mi-scale/src/Xiaomi_Scale.py index e57a8c3..398e512 100644 --- a/mi-scale/src/Xiaomi_Scale.py +++ b/mi-scale/src/Xiaomi_Scale.py @@ -193,8 +193,8 @@ 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+= '"json_attributes_topic": "miscale/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}' + 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', message,