Xiaomi BLE Temperature and Humidity sensor

@DendelX, yes, I’m able to connect esp32 w/o ble tracker to the bluecave, its stable for a long time.
issue. Btw: I’ve searched online and saw it happens w/other ASUS and Netgear models.

There should be a configuration switch, perhaps in the advance settings… checking

I have tried all settings that I can, but not all that I could because my home network is full of domotic devices and I can’t take some risks. If you found something would be fantastic, remember me please :wink:

@DendelX, sure, btw: what ESP32 board are you using?

Two of them, espressif esp32 wroom and mh-et live, same results with both

I’ve opened a service request w/ASUS. Will advise back if I hear anything.

Hey all,

I just received the circular Mijia temp sensor today and am running Hassio on a Raspberry Pi 3. I too had added the sensor settings in my configuration.yaml file and kept seeing “unavaliable” for the values. Also in the hassio logs it says “Polling Error.” I finally managed to get to the bottom of it after going around in circles for an hour!

I’m running Hassio 0.100.3

What you need to do is:

  1. I conntected to the mijia via bluetooth from my Android phone and noted down the MAC address via the previously connected devices menu

  2. Add the sensor to the configuration.yaml with the mac address from step 1

# Mijia Temp Sensor
sensor:
  - platform: mitemp_bt
    mac: 'xx:xx:xx:xx:xx:xx'
    name: LoungeRoom Temp
    force_update: true
    median: 1
    monitored_conditions:
      - temperature
      - humidity
      - battery
  1. Add your sensors to lovelace

  2. IMPORTANT
    Reboot your raspberry pi via Hassio > System > Reboot

  3. The sensor should update with the correct temperature

The problem seems to be that when you “Restart Hass” via the configurator it doesn’t actually do anything. Looks like the reboot of the host gets it going.

Hope this helps others!

1 Like

On ESP32 NodeMCU using ESPHome, is there anyway to have BLE turned off (really turned off) and only turned on for sensor reading and then turned off again?

I solved executing this command:
hciconfig hci0 down
hciconfig hci0 up

The problem is the raspbian BT, when HA dont update de themp if execute this:
sudo hcitool lescan
return this error:
Disable scan failed: Input/output error

Its a temp solution ofcourse.

It´s works! thanks you.

Thanks for the info marc, the key was to restart the raspberry and not just the home assistant container. After the full HW restart it started working (again).

I fixed all of my troubles with this:

Now I got my results from the devices instantly! Its awesome!

Does HA expose this device to google home?

My sensor was not connecting and I had to move it literally 10cm next to the Raspberry.
No joke, really low range for some reason.

Mine is sitting beside my pi

Nothing is happening. Sensor works with the Mijia lamp as a BLE gateway but cannot get it integrated into HA

I’ve even tried the reboot host suggestion above. I’ve ordered two of these and one of the v2…a bit frustrated now…

Can you connect with your phone to the sensor?

I wouldn’t be too worried about the ones you ordered, I’m confident most of them will work!

It would be interesting to know whether you notice significant difference between v1 versus V2, specially in range.

So I got it worked last night using the HACS BLE integration rather than the built in hassio one.
Range is a huge issue. When the device was sitting literally beside the pi, the 60s interval was fine
When it was about 2m away this changed to intermittently updating every 2-4min
When it was about 10m away but one wall apart, 9min updates
Its now 8m apart but 2 walls away and I’m pretty sure it’s lost range because eTG last update was 19min ago…

If I could get this connected to the Miji lamp gateway which I bought ages ago then this would be fine, the range on it is way better

I’ve updated HA to 0.115.2 and this intergration has stopped working.
Is anyone else having this problem?

Logger: homeassistant.components.mitemp_bt.sensor
Source: components/mitemp_bt/sensor.py:163
Integration: mitemp_bt (documentation, issues)
First occurred: 22 September 2020, 22:31:04 (7473 occurrences)
Last logged: 19:16:52

  • Polling error
  • Polling error Could not read data from Mi Temp sensor XX:XX:XX:XX:XX:XX

just started for me this morning as well

I’ve decided to switch over to the passive custom component.
This seems to have fixed the problem.

nice. thanks for the heads up - mine has started working again but this looks good