Xiaomi BLE Temperature and Humidity sensor


anyone got this working in HASSIO? on a pi b+

cant seem to poll. I got the BLE mac via android app and added to config but no joy.

> Log Details (WARNING)
> Thu Jul 26 2018 13:35:00 GMT+1000 (Australian Eastern Standard Time)
> 
> Polling error Could not read data from Mi Temp sensor 4c:65:a8:d3:d5:ca

Iā€™ve the same issue. No idea what Iā€™m doing wrong. I followed the following steps:

  1. Discovered the MAC address using my Android phone (by pairing with the BLE sensor)
  2. Added the below to my configuration
  3. The error logs show that Hassio is unable to retrieve any values from the sensor.
  4. Placed the BLE sensor within 1m of the Raspberry Pi
  5. Restarted the Raspberry Pi

Iā€™m on Hassio 0.71 btw. Do I need to pair the sensor with the Raspberry Pi? Seems unusual that all one needs is the MAC address and voila, you can read the BLE sensor readouts.

sensor:
  - platform: mitemp_bt
    mac: '4C:65:A8:D8:7F:58'
    name: Xiaomi BLE Sensor


2018-07-28 13:21:32 WARNING (SyncWorker_8) [homeassistant.components.sensor.mitemp_bt] Polling error 
2018-07-28 13:21:32 WARNING (SyncWorker_17) [homeassistant.components.sensor.mitemp_bt] Polling error Could not read data from Mi Temp sensor 4C:65:A8:D8:7F:58
2018-07-28 13:21:34 WARNING (SyncWorker_14) [homeassistant.components.sensor.mitemp_bt] Polling error Could not read data from Mi Temp sensor 4C:65:A8:D8:7F:58

using a ble app on android i can see the temp and humid reading so it must just advertise without really having to pair to it

I have had no issues apart from taking over 10 seconds sometimes.
From having a look it seems you donā€™t need to ā€œpairā€ it. Once the MAC address is found it should be fine.

With the code (just thinking out loud) does it work if you include the ā€˜monitored conditionsā€™ even though itā€™s optional?

good idea - didnā€™t work sadly. are you running the latest hassio build?

Not brave enough for Hassio yet. Still on hassbian.

Hey all, mine is working now. Turns out the bluetooth range between the raspberry pi and the sensor isnā€™t great. Iā€™ve to have both in the same room to get the sensor data into Hass

did you install the BLE addon? I have it working

no the new hassio blog said donā€™t install it itā€™s on by default.

do you have a link to the ble addon. i canā€™t find it in the hassio addon lists

Ohhh sorry Iā€™m still on resinOS. if youā€™re on HassOS you need to keep it disabled

edit: grammar

Hi,

Iā€™m having the same issueā€¦ anyone found a solution yet?

I moved mine closer to my
Pi and rebooted and itā€™s working

Bluetooth range of the raspberry pi isnā€™t great

i have nearly the same issue, but i didnā€™t see any warning in logs.

i have no value received and no warning in log

I have the same error here.

Could it be due the fact, that those sensors are from Aliexpress (region mainland China)? I mean I cant use them in mainland Europe in Android app Mi Home, but I cant successfully use them in region mainland china.

Could be this limitation directly in the firmware of the sensors?

A spark from my log:

I used the config from here:

The topic is already discussed here. For Domoticz there is a python script, which by the comments of other looks like, that reading of the sensor can be done. Does it mean, that there is an error in Home Asistant add-on?

https://www.domoticz.com/forum/viewtopic.php?t=21904
https://www.domoticz.com/forum/viewtopic.php?f=56&t=20925

Oh manā€¦ one of ours is playing up all of a sudden. I put the sensor RIGHT NEXT to the pi but just get the ā€œPolling error Could not read data from Mi Temp sensorā€

EDIT: Turns out the program I use to find the Mac address wasnā€™t showing me the correct one. I had to take the batteries out of all my other devices and then it found it.
Helps when you have the right Mac address huh!

Same issues here. +some fails.

Log snip:

Update for sensor.outside_humidity fails
11:40 components/sensor/mitemp_bt.py (ERROR)
Update for sensor.outside_temperature fails
11:40 components/sensor/mitemp_bt.py (ERROR)
Update for sensor.outside_temperature fails
11:40 components/sensor/mitemp_bt.py (ERROR)
Update for sensor.outside_humidity fails
11:40 components/sensor/mitemp_bt.py (ERROR)
Update for sensor.outside_temperature fails
11:40 components/sensor/mitemp_bt.py (ERROR)
Updating mitemp_bt sensor took longer than the scheduled update interval 0:00:30
11:39 helpers/entity_platform.py (WARNING)
Update of sensor.kueche_humidity is taking over 10 seconds
11:39 util/async_.py (WARNING)
Update for sensor.outside_humidity fails
11:39 components/sensor/mitemp_bt.py (ERROR)
Update of sensor.wohnzimmer_humidity is taking over 10 seconds
11:39 util/async_.py (WARNING)
Update for sensor.outside_temperature fails
11:39 components/sensor/mitemp_bt.py (ERROR)
Update of sensor.flur_humidity is taking over 10 seconds
11:39 util/async_.py (WARNING)
Update for sensor.outside_humidity fails
11:38 components/sensor/mitemp_bt.py (ERROR)
Updating mitemp_bt sensor took longer than the scheduled update interval 0:00:30
11:38 helpers/entity_platform.py (WARNING)
Updating mitemp_bt sensor took longer than the scheduled update interval 0:00:30
11:38 helpers/entity_platform.py (WARNING)

My config:

sensor:
  - platform: yr
#xiaomi bt temp und hygro sensoren
  - platform: mitemp_bt
    mac: '4C:65:A8:REMOVED'
    name: Outside
    monitored_conditions:
      - temperature
      - humidity
      - battery
  - platform: mitemp_bt
    mac: '4C:65:A8:REMOVED'
    name: Wohnzimmer
    monitored_conditions:
      - temperature
      - humidity
      - battery
  - platform: mitemp_bt
    mac: '4C:65:A8:REMOVED'
    name: Flur
    monitored_conditions:
      - temperature
      - humidity
      - battery
  - platform: mitemp_bt
    mac: '4C:65:A8:REMOVED'
    name: Kueche
    monitored_conditions:
      - temperature
      - humidity
      - battery

Hardware: RPi3 B+
Bluetooth: OnBoard
Network over: LAN

I try this here: Xiaomi Thermostat (with display) - Page 2 - Domoticz

myUser@raspberrypi:~ $ dpkg --status bluez | grep ā€˜^Version:ā€™
Version: 5.43-2+rpt2+deb9u2

So, if this is still a bug, my 5.43-2 should be a ā€˜bug-versionā€™.
Then I disable pnat plugin, by editing /etc/bluetooth/main.conf with sudo and add + reboot:

DisablePlugins=pnat

Another problem could just be the low rPi3 antenna. A solution could be to attach sma connector to it:

alt text

Source (in german)

What is the base of the HA mitemp-hygro-temp implementation? This here:

Greetings by JamieMe

Can anybody help with this issue?

Greetings by JamiueMe