lolouk44 / hassio-addons Goto Github PK
View Code? Open in Web Editor NEWXiaomi Mi Scale Add On for Home Assistant
License: MIT License
Xiaomi Mi Scale Add On for Home Assistant
License: MIT License
Optional parameters like USER3_XXX in config.json are not marked as optional.
As described here, you should just add an questionmark to the datatype in the schema object in config.json.
https://developers.home-assistant.io/docs/add-ons/configuration#options--schema
Describe the bug
Warning in supervisor log:
21-02-10 08:20:41 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of Xiaomi Mi Scale
21-02-10 08:20:41 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'devices' use a deprecated format, the new format uses a list of paths only. Please report this to the maintainer of Xiaomi Mi Scale
21-02-10 08:20:41 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of Dropbox Sync
21-02-10 08:20:42 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of Xiaomi Mi Scale
Desktop/Server (please complete the following information):
HomeAssistant core-2021.2.2
supervisor-2021.02.6
Select Add-On (place a lowercase x
for the relevant add-on)
When I'm try to add the sensor to ESPHome, I cannot compile it.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Wrong results for Visceral Fat and Body Fat
I have a Mi Body Composition Scale 2 (XMTZC05HM) and get wrong results when calculating, especially for Visceral Fat and Body Fat. If I query these values from other scales, then they are correct.
What can be the reason? Is it the scales or the application cannot be used for the Mi Body Composition Scale 2 (XMTZC05HM)?
To Reproduce
Running python 3.8 on a raspberry pi
Expected behaviour
Maybe based on the Mi Body Composition Scale 2 ??
Screenshots
NOP
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Raspberry PI
Additional context
## Person 1:
{
"Weight": "72.50",
"BMI": "22.88",
"Basal Metabolism": "1248.68",
"Visceral Fat": "15.37", <----- ! ERROR
"Lean Body Mass": "57.20",
"Body Fat": "23.76", <----- ! ERROR
"Water": "52.30",
"Bone Mass": "2.87",
"Muscle Mass": "52.40",
"Protein": "19.98",
"Body Type": "Balanced",
"Metabolic Age": "41",
"TimeStamp": "2020-09-03 11:59"
}
## Person 2:
{
"Weight": "51.05",
"BMI": "18.09",
"Basal Metabolism": "930.34",
"Visceral Fat": "1.00", <----- ! ERROR
"Lean Body Mass": "47.17",
"Body Fat": "23.36", <----- ! ERROR
"Water": "52.57",
"Bone Mass": "2.09",
"Muscle Mass": "37.04",
"Protein": "19.98",
"Body Type": "Balanced-skinny",
"Metabolic Age": "27",
"TimeStamp": "2020-09-03 11:59"
}
Xiaomi_Scale.py | mi.app | Medisana TargetScale | ||
---|---|---|---|---|
Weight | 72.50 | 72.50 | 72.50 | |
BMI | 22.88 | 22.60 | 22.80 | |
Basal Metabolism | 1.248.68 | 1.222.00 | 1569.00 | |
Visceral Fat | 15.37 | 14.00 | 6.10 | |
Lean Body Mass | 57.20 | -- | -- | |
Body Fat | 23.76 | 21.50 | 13.10 | |
Water | 52.30 | 53.80 | 55.40 | |
Bone Mass | 2.87 | 2.80 | 3.60 | |
Muscle Mass | 52.40 | 52.20 | 44.20 | |
Protein | 19.98 | 20.60 | -- | |
Body Type | Balanced | Balanced | -- | |
Metabolic Age | 41 | 39 | -- |
Xiaomi_Scale.py | mi.app | Medisana TargetScale | ||
---|---|---|---|---|
Weight | 51.05 | 51.05 | 51.20 | |
BMI | 18.09 | 18.00 | 18.5 | |
Basal Metabolism | 930.34 | 934.00 | 1260.00 | |
Visceral Fat | 1.00 | 3.00 | 3.00 | |
Lean Body Mass | 47.17 | -- | -- | |
Body Fat | 23.36 | 19.03 | 14.60 | |
Water | 52.57 | 55.30 | 56.90 | |
Bone Mass | 2.87 | 2.00 | 2.65 | |
Muscle Mass | 37.04 | 39.00 | 32.56 | |
Protein | 19.98 | 20.60 | -- | |
Body Type | Balanced-skinny | Balanced-skinny | -- | |
Metabolic Age | 27 | 26 | -- |
Some other values also deviate, but this is not so critical.
What can I do so that the values are evaluated in a similar way to other scales?
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Unable to connect if default mqtt port 1883 is disabled
To Reproduce
Set the configuration with non default mqtt ports to use SSL encryption.
Expected behaviour
Connect to mqtt with SSL on mqtt secure port
Screenshots
--- - Starting Xiaomi mi Scale...
---- Loading Config From Add-On Options...
--- - Config Loaded...
Traceback (most recent call last):
File "/opt/miscale/Xiaomi_Scale.py", line 270, in
main()
File "/opt/miscale/Xiaomi_Scale.py", line 236, in main
discovery()
File "/opt/miscale/Xiaomi_Scale.py", line 123, in discovery
publish.single(
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/publish.py", line 227, in single
multiple([msg], hostname, port, client_id, keepalive, will, auth, tls,
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/publish.py", line 163, in multiple
client.connect(hostname, port, keepalive)
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 937, in connect
return self.reconnect()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1071, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/local/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/local/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
A clear and concise description of what the bug is.
My scale is set to lbs. And the reading is properly done in lbs but the entity's unit_of_measurement is hardcoded to kg.
To Reproduce
Steps to reproduce the behaviour, including error message if any.
Set a scale to lbs and link to this plugin
Expected behaviour
A clear and concise description of what you expected to happen.
Expected unit_of_measure to be lbs
Scale (please complete the following information):
My Body Composition Scale
Firmware: 0.3.2
Device running Home Assistant (please complete the following information):
Rapsberri Pi 4 (built in bluetooth)
Additional context
This is where kg gets hardcoded...
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+= '"json_attributes_topic": "miscale/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}'
publish.single(
MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config',
message,
retain=True,
hostname=MQTT_HOST,
port=MQTT_PORT,
auth={'username':MQTT_USERNAME, 'password':MQTT_PASSWORD}
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
In the config, you always need to use KG even if the Display and MQTT output is in lbs
This isn't a big deal - but it isn't documented
To Reproduce
The MQTT output will be the following only if the config is set using KG
{"weight":171.50,"weight_unit":"lbs","bmi":24.55,"basal_metabolism":1527.84,"visceral_fat":14.65,"timestamp":"2021-05-06 10:19:52.539306"}
Config
If the config is done using the values from lbs - no MQTT message will be output.
Expected behaviour
Screenshots
N/A
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
N/A
Will need to change variable names otherwise Home Assistant does not write data to them.
Basal Metabolism -> Basal_Metabolism
Visceral_Fat -> Visceral_Fat
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
On update/install getting an error: Can't install lolouk44/xiaomi-mi-scale-ha-add-on:0.2.7: 404 Client Error for http+docker://localhost/v1.41/images/create?tag=0.2.7&fromImage=lolouk44%2Fxiaomi-mi-scale-ha-add-on: Not Found ("manifest for lolouk44/xiaomi-mi-scale-ha-add-on:0.2.7 not found: manifest unknown: manifest unknown")
This only seems to use Bluetooth controllers directly connected to the machine running the HA server.
Can it be set up to use the Xiaomi Gateway to read the Bluetooth data coming from the scales? I mean it's even physically connected to the HA server but for some reason there doesn't seem to be any way of making it choose the Gateway as the default bluetooth controller so it can't read the data from the scales. Feel like a schmuck buying into their ecosystem thinking it would be less work setting it all up, only to find out there's no actual way of reading the scales data via their bluetooth controller...
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Can't get any data values. I don't see anything via MQTT Explorer, either. Not sure if my Pi4 is even connecting to my scale via btle or not. Also, when I try to put my bt mac address in single quotes and hit save, it removes the single quotes.
To Reproduce
rpi4 with hassio and a bluetooth dongle, installed addon, configured and added sensor data and configured addon. restarted HAS.
Expected behaviour
no data in sensors, they state unknown
Screenshots
If applicable, add screenshots to help explain your problem.
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
# configuration.yaml
sensor:
- platform: mqtt
name: "My Weight"
state_topic: "miscale/Jimmy/weight"
value_template: "{{ value_json['weight'] }}"
unit_of_measurement: "Lbs"
json_attributes_topic: "miscale/Jimmy/weight"
icon: mdi:scale-bathroom
- platform: mqtt
name: "My BMI"
state_topic: "miscale/Jimmy/weight"
value_template: "{{ value_json['bmi'] }}"
icon: mdi:human-pregnant
unit_of_measurement: "kg/m2"
addon config:
HCI_DEV: hci0
BLUEPY_PASSIVE_SCAN: false
MISCALE_MAC: 5C:CA:D3:EF:11:4B
MQTT_PREFIX: miscale
MQTT_HOST: 127.0.0.1
MQTT_USERNAME: mqtt
MQTT_PASSWORD: password
MQTT_PORT: 1883
TIME_INTERVAL: 30
MQTT_DISCOVERY: true
MQTT_DISCOVERY_PREFIX: homeassistant
USERS:
- NAME: Jimmy
SEX: male
GT: 120
LT: 150
HEIGHT: 128
DOB: '1901-01-01'
addon log:
-------------------------------------
2021-08-19 04:26:41 - Starting Xiaomi mi Scale...
2021-08-19 04:26:41 - Loading Config From Add-On Options...
2021-08-19 04:26:41 - Config Loaded...
2021-08-19 04:26:41 - Discovery Completed...
After update new version 0.1.13 on HASSIO addon not working. I have message in log:
[FATAL tini (7)] exec /entrypoint.sh failed: Permission denied
I don't use docker.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
the log shows this most times
Bluetooth connection error: Failed to execute management command 'scanend' (code: 11, error: Rejected)
the odd occasion it downloads data (1 out of 5)
To Reproduce
let the add on do its thing
Expected behaviour
sync data
Scale (please complete the following information):
Mi Body Composition Scale 2 | XMTZC05HM
Device running Home Assistant (please complete the following information):
Raspberry pi 3 with built in Bluetooth
Additional context
Add any other context about the problem here.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I have use diacritic in configuration. Which lead to error. The error still persists although i have changed name from "Tomáš" to "Tomas" in configuration.
Where is possible to repair it?
Logger: homeassistant.components.mqtt.discovery
Source: components/mqtt/discovery.py:104
Integration: MQTT (documentation, issues)
First occurred: 14:22:33 (1 occurrences)
Last logged: 14:22:33
Received message on illegal discovery topic 'homeassistant/sensor/miscale/Tomáš/config'
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
I use an ESP32 to read the data from the scale. It returns the weight, and the impedance as a sensor.
Is it possible to use this sensor data as an alternative source ?
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
I have an ESP32 board with OpenMQTTGateway configured and working correctly. I would like to know if it is possible not to use HCI_DEV, but ESP32 with its add-on.
Describe the solution you'd like
Have another version of the add-on for use with an ESP32 board and OpenMQTTGateway. I have a scale topic at OpenMQTTGateway: home/OpenMQTTGateway_ESP32_BLE/BTtoMQTT/5CCRD372A23R.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
When removing a parameter like "USER3_SEX" and clicking "save", the parameter reappears when reentering the config page. The parameter gets filled with its default.
Expected behaviour
The optional parameter should be removeable instead of readding it with its default value.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
the timestamp is not timezoned, so home assistant cannot convert it
To Reproduce
xiaomi mi scale v0.2.7
mqtt 6.0.1
xiaomi composition scale 2
Home assistant 2022.2.0
Expected behaviour
a correct timestamp
Screenshots
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
-virtual machine
Additional context
my sensor configuration :
- platform: mqtt
name: "Max Derniere pesee"
state_topic: "miscale/Max/weight"
value_template: "{{ value_json['timestamp'] }}"
device_class: timestamp
icon: mdi:calendar-clock
the logs :
Exception in message_received when handling msg on 'miscale/Max/weight':
'{"weight":109.50,"weight_unit":"kg","bmi":32.34,"basal_metabolism":2038.10,"visceral_fat":27.91,"lean_body_mass":72.78,"body_fat":34.26,"water":46.94,"bone_mass":3.67,"muscle_mass":68.31,"protein":15.45,"body_type":"Thick-set","metabolic_age":56,"timestamp":"2022-01-04 21:39:00.655824"}'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 37, in wrapper msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 280, in message_received self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in async_write_ha_state self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 563, in _async_write_ha_state state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 536, in _stringify_state if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 419, in state raise ValueError( ValueError: Invalid datetime: sensor.max_derniere_pesee provides state '2022-01-04 21:39:00.655824', which is missing timezone information
and
Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:419
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 3:06:59 PM (6 occurrences)
Last logged: 3:07:00 PM
Error adding entities for domain sensor with platform mqtt
Error while setting up mqtt platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 773, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 563, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 536, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 419, in state
raise ValueError(
ValueError: Invalid datetime: sensor.max_derniere_pesee provides state '2022-01-04 21:39:00.655824', which is missing timezone information
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Only a part of the data is transmitted to Home Assistant.
To Reproduce
I am not able to switch between transmitting all and the partial data, so I don't know what causes it.
Expected behaviour
The usual data is transmitted, which is also listed in the addon description.
Screenshots
Publishing data to topic miscale/Name/weight:
{
"weight": 73.0,
"weight_unit": "kg",
"bmi": 22,
"basal_metabolism": 1600.0,
"visceral_fat": 8.0,
"timestamp": "2021-12-03 00:00:00.0"
}
I edited the data a bit, but that's what is received.
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Hi, thanks for the perfect working solution. Can you help me finish what I started?
Goal: not just get only MQTT, but also have the ability to upload values to Garmin connect.
Reference: https://github.com/RobertWojtowicz/miscale2garmin has a very similar code with only several changes. We could add this as a feature to your repo.
Two ways I could reach the needed result:
if selected_user is not None and SENDTOGARMIN is true and GARMINCONNECTPASSWORD is not empty:
lib = Xiaomi_Scale_Body_Metrics.bodyMetrics(weight, selected_user.height, selected_user.age, selected_user.sex, int(miimpedance))
bone_percentage = (lib.getBoneMass() / weight) * 100
muscle_percentage = (lib.getMuscleMass() / weight) * 100
message = (path) + '/bodycomposition upload '
message += '--bone ' + "{:.2f}".format(bone_percentage) + ' '
message += '--calories ' + "{:.2f}".format(lib.getBMR()) + ' '
message += '--bmi ' + "{:.2f}".format(lib.getBMI()) + ' '
message += '--email ' + selected_user.email + ' '
message += '--fat ' + "{:.2f}".format(lib.getFatPercentage()) + ' '
message += '--hydration ' + "{:.2f}".format(lib.getWaterPercentage()) + ' '
message += '--metabolic-age ' + "{:.0f}".format(lib.getMetabolicAge()) + ' '
message += '--muscle ' + "{:.2f}".format(muscle_percentage) + ' '
message += '--password ' + selected_user.password + ' '
message += '--physique-rating ' + "{:.2f}".format(lib.getBodyType()) + ' '
message += '--unix-timestamp ' + mitdatetime + ' '
message += '--visceral-fat ' + "{:.2f}".format(lib.getVisceralFat()) + ' '
message += '--weight ' + "{:.2f}".format(weight) + ' '
os.system(message)
print("Processed file: " + (mitdatetime) + ".tlog")
I assume the changes are minimal and I would be glad to do the testing if you would be willing to help :)
Please let me know if it's something that could be done.
Hello again! Just updated to the last version.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Xiaomi Mi Scale crashes while reading the config file with this error:
-------------------------------------
2020-09-09 09:42:40 - Starting Xiaomi mi Scale...
2020-09-09 09:42:40 - Loading Config From Add-On Options...
2020-09-09 09:42:40 - Config Loaded...
Traceback (most recent call last):
File "/opt/miscale/Xiaomi_Scale.py", line 344, in <module>
main()
File "/opt/miscale/Xiaomi_Scale.py", line 312, in main
if MQTT_DISCOVERY.lower() in ['true', '1', 'y', 'yes']:
AttributeError: 'bool' object has no attribute 'lower'
To Reproduce
Update to the last version and try to start the add-on.
Expected behaviour
I would expect it to load the configuration file without crashing. Also, seeing that you are treating the MQTT_DISCOVERY paramater as string I tried to put that parameter in the config file between quotation marks, but didn't help. It was like this:
MQTT_DISCOVERY: true
And tried like this:
MQTT_DISCOVERY: 'true'
None of them worked
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I use Home Assistant supervised, saw today that there's an updatefor Xiaomi Mi Scale add-on from 0.2.4 to 0.2.5. tried to upgrade and this error occurs:
Can't install lolouk44/xiaomi-mi-scale-ha-add-on:0.2.5: 404 Client Error for
http+docker://localhost/v1.41/images/create?tag=0.2.5&fromImage=lolouk44%2Fxiaomi-mi-scale-ha-add-on:
Not Found ("manifest for lolouk44/xiaomi-mi-scale-ha-add-on:0.2.5 not found: manifest unknown: manifest unknown")
then tried to uninstall 0.2.4 and make a clean install of 0.2.5 - the same error occurs.
tried to re-add repository and make a clean install - the same error occurs.
To Reproduce
Expected behaviour
correct update of the addon to latest version
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
n/a
If you add a repository.json, it is very easy to install this addon for users. Then users only have to add a repository URL to their Home Assistant installation and can easily install and update the addon.
Developers guide can be found here:
https://developers.home-assistant.io/docs/add-ons/repository/
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
When I'm trying to add a sensor an error is displayed
To Reproduce
end of the stream or a document separator is expected at line 2, column 1: - platform: mqtt ^
Cannot read property 'setConfig' of undefined
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Does not start, in log:
[FATAL tini (6)] exec /entrypoint.sh failed: Permission denied
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
As the Add-On installation guide describes, not required configuration environment variables should be comment out. E.g. "MQTT_USERNAME: user", "MQTT_PASSWORD: passwd" (when using default/not auth. mqtt broker on HA) or the "USER3_[....]" variables when only running a 2-Person-Configuration. In the current Add-On version commenting out such env. lines and saving these changes with the HA GUI under "Supervisor > Xiaomi Mi Scale > Configuration" will recreate the lines instead of accepting comment out/deleted values.
This leads to connection faults when using the default settings for HA MQTT broker without user and pass.
To Reproduce
MQTT Log:
1606558445: New connection from x.x.x.x on port 1883.
[ERROR] Auth error with user
1606558446: Socket error on client <unknown>, disconnecting.
Additional Context
Failed to save addon configuration, not a valid value for dictionary value @ data['options']. Got {'HCI_DEV': 'hci0', 'MISCALE_MAC': ...}
sudo vi /usr/share/hassio/addons/data/79ff755f_xiaomi_mi_scale/options.json
. After restarting the addon, the variables are added back again with the default values in options.jsonDevice running Home Assistant (please complete the following information):
System Health
Home Assistant Core Integration
version: 0.118.4
installation_type: Home Assistant Supervised
dev: false
hassio: true
docker: true
virtualenv: false
python_version: 3.8.6
os_name: Linux
os_version: 5.4.77-v7l+
arch: armv7l
Hass.io
host_os: Raspbian GNU/Linux 10 (buster)
update_channel: stable
supervisor_version: 2020.11.0
docker_version: 19.03.13
installed_addons: Xiaomi Mi Scale (0.1.16), Mosquitto broker (5.1)
First, thanks very much for your add-on, it works wonders! Now to the template:
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
Not really a problem. The other day a read that the Xiaomi Mi Body Composition Scale, stored all the measurements made inside the scale. I was able to check this by using the app Open Scale. It downloaded months worth of measurements.
Describe the solution you'd like
It would be great being able to download all this data and include it in home assistant so I don't have to check old data in the xiaomi app.
Describe alternatives you've considered
Maybe just a way to upload this information as CSV or somethingn like that, there are ways to download the old values as CSVs.
Additional context
Using HA 114.4 with xiaomi mi scale 0.1.7 in a Pi4, everything working like a charm. Also, I don't know if there is another way of doing that, I just thought that it would be a nice feature.
updating or removing then installing now gives this new error from latest version of hassio 2021.5.1
404 Client Error for http+docker://localhost/v1.41/images/create?tag=0.2.2&fromImage=lolouk44%2Fxiaomi-mi-scale-ha-add-on: Not Found ("manifest for lolouk44/xiaomi-mi-scale-ha-add-on:0.2.2 not found: manifest unknown: manifest unknown")
it has internet, i can add the repo - i removed and re-added.
installed and removed a couple of others to see if they were ok, they were
Log:
21-05-10 12:20:31 INFO (SyncWorker_0) [supervisor.docker.interface] Updating image lolouk44/xiaomi-mi-scale-ha-add-on:0.2.0 to lolouk44/xiaomi-mi-scale-ha-add-on:0.2.2
21-05-10 12:20:31 INFO (SyncWorker_0) [supervisor.docker.interface] Downloading docker image lolouk44/xiaomi-mi-scale-ha-add-on with tag 0.2.2.
21-05-10 12:20:33 ERROR (SyncWorker_0) [supervisor.docker.interface] Can't install lolouk44/xiaomi-mi-scale-ha-add-on:0.2.2 -> 404 Client Error for http+docker://localhost/v1.41/images/create?tag=0.2.2&fromImage=lolouk44%2Fxiaomi-mi-scale-ha-add-on: Not Found ("manifest for lolouk44/xiaomi-mi-scale-ha-add-on:0.2.2 not found: manifest unknown: manifest unknown").
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
I'm using python-based HA. I'm not sure how to use your addon - i've extracted repo into custom_components
and changed configuration - but HA sensors are not updated and there is nothing in MQTT.
Describe the solution you'd like
Please do actions release or graft some instruction on how to use with HA.
Describe alternatives you've considered
None at the moment.
Additional context
Add any other context or screenshots about the feature request here.
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
I have bug:
Unable to parse JSON Kamil: '{"name": "Kamil Weight","state_topic": "miscale/Kamil/weight","value_template": "{{ value_json.weight }}""json_attributes_topic": "miscale/Kamil/weight","icon": "mdi:scale-bathroom"}'
Unable to parse JSON Monika: '{"name": "Monika Weight","state_topic": "miscale/Monika/weight","value_template": "{{ value_json.weight }}""json_attributes_topic": "miscale/Monika/weight","icon": "mdi:scale-bathroom"}'
Unable to parse JSON Maja: '{"name": "Maja Weight","state_topic": "miscale/Maja/weight","value_template": "{{ value_json.weight }}""json_attributes_topic": "miscale/Maja/weight","icon": "mdi:scale-bathroom"}'
because in file Xiaomi_Scale.py a comma is missing:
original
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.weight }}"'
message+= '"json_attributes_topic": "miscale/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}'
need:
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.weight }}"'
message+= ',"json_attributes_topic": "miscale/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}'
Due to this error, the entities do not show up
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
I see only the last weight with all the attributes comparing with previous.
Describe the solution you'd like
How can I see my weight in longterm. Some chart or table
Describe alternatives you've considered
Additional context
MQTT Discovered entities lost after ha restart because the retain flag was not set to true.
Fixed in git, to be added to 0.1.7 (TBA)
Docker fix to follow shortly...
Hello,
Thanks for good job!
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I have a errors in log
and it do not work.
Once it seems that has read my last measuremt under the name of Jo, when i have not corrected my config
But then, do not work.
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Thanks a lot!
Select Add-On (place a lowercase x
for the relevant add-on)
Is your feature request related to a problem? Please describe.
The sensors from the addon isnt supported for long term statistics card right now.
Describe the solution you'd like
https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics
Describe alternatives you've considered
Additional context
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I am trying to add the add-on through the Add-ons Store, by the option Manage add-on repositories, but when trying, it generates the following message "Invalid Add-on repository!"
To Reproduce
I am trying to add the add-on through the Add-ons Store, by the option Manage add-on repositories, but when trying, it generates the following message "Invalid Add-on repository!"
Expected behaviour
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
Add any other context about the problem here.
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Addon not starting, with the error
File "/opt/miscale/Xiaomi_Scale.py", line 196
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json['weight'] }}",'
^
SyntaxError: invalid syntax
To Reproduce
After updating the configuration file, that error is all I get
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I get updates in addons log, but sensor is "no data"
To Reproduce
I installed plugin from repo(using easy way as addon)
Set up my config
HCI_DEV: hci0
MISCALE_MAC: 'C8:47:8C:A0:XX:XX'
MQTT_PREFIX: miScale
MQTT_HOST: 192.168.1.2
MQTT_USERNAME: mqtt
MQTT_PASSWORD: mqtt
MQTT_PORT: 1883
TIME_INTERVAL: 30
MQTT_DISCOVERY: true
MQTT_DISCOVERY_PREFIX: homeassistant
USER1_GT: 80
USER1_SEX: male
USER1_NAME: Ilya
USER1_HEIGHT: 175
USER1_DOB: '1990-08-02'
USER2_LT: 79
USER2_SEX: female
USER2_NAME: Anastasiia
USER2_HEIGHT: 165
USER2_DOB: '1990-10-03'
USER3_SEX: male
USER3_NAME: emptyuser
USER3_HEIGHT: 150
USER3_DOB: '1990-01-01'
Get a log
2020-07-06 19:59:21 - Starting Xiaomi mi Scale...
2020-07-06 19:59:21 - Loading Config From Add-On Options...
2020-07-06 19:59:21 - Config Loaded...
2020-07-06 19:59:22 - Discovery Completed...
2020-07-06 20:07:34 - Publishing data to topic miScale/Ilya/weight: {"Weight":"104.60","BMI":"34.16","Basal Metabolism":"2042.15","Visceral Fat":"27.03","TimeStamp":"2020-07-06-20:07:34"}
2020-07-06 20:07:34 - Data Published ...
In mqtt explorer also get updates
Then make sensors
platform: mqtt
name: "Илья Вес"
state_topic: "miscale/Ilya/weight"
value_template: "{{ value_json['Weight'] }}"
unit_of_measurement: "kg"
json_attributes_topic: "miScale/Ilya/weight"
icon: mdi:scale-bathroomplatform: mqtt
name: "Настя Вес"
state_topic: "miScale/Anastasiia/weight"
value_template: "{{ value_json['Weight'] }}"
unit_of_measurement: "kg"
json_attributes_topic: "miScale/Anastasiia/weight"
icon: mdi:scale-bathroom
After restart in object explorer find new sensors, but they have no data
Expected behaviour
Get data
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
When i startup the addon, it successfully connects to my mosquitto mqtt addon.
But i disconnects again super fast. I got data from my Mi scale on first setup a few times but without changing anything, it now does not work anymore.
Is that a known Bug or can i somehow fix that?
Thanks in advance!
Mosquitto Log:
1630609524: New connection from 172.30.32.1 on port 1883.
1630609524: New client connected from 172.30.32.1 as auto-********* (p2, c1, k60, u'mi****').
1630609524: Client auto-********* disconnected.
Do you do you could add-on for mikettle YM-K1501, for yeelight YLFW01YL, for amazfit BIP, Amazfit Verge and vaccum SDJQR02RR?
Select Add-On (place a lowercase x
for the relevant add-on)
Hi!
I was wandering if is possible to translate all the description from the balance (eg. basal metabolism, visceral fat, lean body mass...).
I can help with italian if you want...
Thank you!
I think you should add to configuration , the bluetooth_le tracker
device_tracker:
Best Regards,
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
i get in log
-------------------------------------
2020-11-25 14:59:18 - Starting Xiaomi mi Scale...
2020-11-25 14:59:18 - Loading Config From Add-On Options...
2020-11-25 14:59:18 - Config Loaded...
2020-11-25 14:59:18 - Discovery Completed...
2020-11-25 15:10:59 - Publishing data to topic miscale/Ilya/weight: {"weight":103.90,"weight_unit":"kg","bmi":33.93,"basal_metabolism":2028.22,"visceral_fat":26.74,"timestamp":"2020-11-25 15:10:59.084743"}
2020-11-25 15:10:59 - Data Published ...
i see new info in mqtt explorer
Device running Home Assistant (please complete the following information):
Additional context
HA 0.118.3
MQTT Discovery is enabled
Mosquitto broker 5.1
I have problems finding the add-on in in the Add-on store.
I have added
"https://github.com/lolouk44/hassio-addons"
to the repositories and restarted home assistant and than searched for Xiaomi Mi Scale in the add-on store without luck.
BR.,
Hello there, after lot of hour searching what is wrong, I come there for some help please.
Nothing happen when I go on the scale.
My CFG :
https://postimg.cc/gallery/7fXq8MN
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
I pasted the demo settings into the yaml. Later I deleted the demo users, unfortunately I'm unable to get rid of them as they still appear as entities and they cannot be deleted.
To Reproduce
When I click on them I get this message:
This entity ("sensor.mary_weight") does not have a unique ID, therefore its settings cannot be managed from the user interface. See documentation for more details.
Expected behaviour
Wish I was able to delete unnecessary users
Screenshots
screenshots .
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
Select Add-On (place a lowercase x
for the relevant add-on)
Describe the bug
Bluetooth connection error: Failed to execute management command 'scanend' (code: 13, error: Invalid Parameters)
To Reproduce
Not possible
Expected behaviour
Get all data from Mi scale
Screenshots
no
Scale (please complete the following information):
Device running Home Assistant (please complete the following information):
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.