lolouk44 / hassio-addons

Xiaomi Mi Scale Add On for Home Assistant
MIT License
125 stars 42 forks source link

Can't add a sensor #10

Closed goldtnt closed 4 years ago

goldtnt commented 4 years ago

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):

lolouk44 commented 4 years ago

In which logs do you see this? HA or Add-On? Can you share your sensor config? Sounds like there may be an extra space here or data is missing

goldtnt commented 4 years ago

In which logs do you see this? HA or Add-On? Can you share your sensor config? Sounds like there may be an extra space here or data is missing

HA I think the problem is the platform: mqtt

type: sensor

The erros is: end of the stream or a document separator is expected at line 2, column 1: - platform: mqtt ^

lolouk44 commented 4 years ago

the above looks fine. Can you also share your add-on config? Are you sure you've set up your MQTT broker correctly? Have you tried a 3rd party tool like MQTT Explorer to make sure all the data shows up under the right topics (they're case sensitive)

goldtnt commented 4 years ago

the above looks fine. Can you also share your add-on config? Are you sure you've set up your MQTT broker correctly? Have you tried a 3rd party tool like MQTT Explorer to make sure all the data shows up under the right topics (they're case sensitive)

Here's my config.

HCI_DEV: hci0 MISCALE_MAC: '0C:95:41:89:B9:29' MQTT_PREFIX: miscale MQTT_HOST: 192.168.1.143 MQTT_USERNAME: homeassistant MQTT_PASSWORD: maek4eevosie3oJa6shioc2e MQTT_PORT: 1883 TIME_INTERVAL: 30 MQTT_DISCOVERY: true MQTT_DISCOVERY_PREFIX: homeassistant USER1_GT: 70 USER1_SEX: male USER1_NAME: Paulo USER1_HEIGHT: 180 USER1_DOB: '1977-12-24' USER2_LT: 50 USER2_SEX: female USER2_NAME: Teresa USER2_HEIGHT: 176 USER2_DOB: '1978-07-27' USER3_SEX: female USER3_NAME: None USER3_HEIGHT: 160 USER3_DOB: '1950-01-01'

The MQTT broker is working with ESPHome. I have tested too, with MQTT.fx I have ESPs working with MQTT.

lolouk44 commented 4 years ago

Your issue is you have the topic "miscale" set in your add-on config but the topic "mi-scale" in your HA config