Xiaomi BLE Temperature and Humidity sensor

its updating instantly, works amazing, how about battery life?

Battery life not affected, because this sensor is designed so that it sends data once a second itself, without the need to poll it. The only problem this code can lead to - is the fast increase in database size, especially if you have a lot of these sensorsā€¦ Sorry for bad English.

1 Like

Any one has an idea how to avoid the database to increase? its got large in no time

No you need custom files in your config/custom_componets/mitemp_bt folder from github.
then this will work.

Running ESPHome esp32_ble_tracker w/platform: xiaomi_mijia on ESP32 NodeMCU makes my router loose its 2.4GHz bands and requires a router restart.

Seems like the BLE is interfering with my Wi-Fi. Anyone having this issue / Any way to limit the BLE scan?

That looks like ultra shitty router :smiley: I can understand that is looses connection but requiring restart? That weirdā€¦ Try changing wifi channel to different one.

This is an issue with the mitemp_bt_poller.py, namely the way the outhor parses the string. It assumes two digits without a sign. As soon as you get below 10C it will fail.

Hi!!! I have same issue since march / april! Iā€™ve searched without success. Whatā€™s your router model?

ASUS Bluecave. Iā€™ve tried both setting control channel to AUTO and to set it to a fixed channel. Result was the same in both.

Confirmed, i have a blue cave too. Itā€™s a router issue. Iā€™ve tried that too but same result, Iā€™ve searched logs and I only found a thread with no solution, and Iā€™ve reported to Asus but I have not received answer. You can connect esp32 without ble tracker?

@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).