Connect Xiaomi Thermometer directly into Home Assistant without ESP32

I have bought 4 Xiamoi Thermometer of the 2nd generation. The name varies, but I think the correct one is “Mijia Bluetooth Thermometer 2”. The small 4$ sensors that are quadratical. They are using BLE.
I installed the latest image of Home Assistant on an micro SD Card, and put this into my Raspberry Pi 4 Model B with 4GB Ram.
Now I am trying to connect this sensors with Home Assistant, just to keep track of temperature and humidity. But it seems impossible for me.

There is the possibility to flash the Thermometer. As I am not allowed to add more than 2 links in this post, just look for “atc1441 / ATC_MiThermometer” in github!
From this flasher tool I could get the MAC-address, the “Device known id”, the “Mi Token” and the “Mi Bind Key”. As I think, it should be possible to connect the ATC without this flashing, just by using the MAC address and the bind-key, I have not done this yet. But I want to do it later, to save battery life of the sensors (every 10min is enough for me).

I find a lot of tutorials, that are using an ESP32 in between to extend the radius for the sensors. As my room is not too big, I want to connect it directly with my Pi. This should be not problem in my point of view.

What I have tried:
Add in the configuration.yaml the mitemp_bt platform (as written here Xiaomi Mijia BLE Temperature and Humidity Sensor - Home Assistant).
I also tried it like written here (Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)) to add the encryptors and in different variations. Without any success. I don’t get any values from the sensor in Home Assistant, and I also don’t know, how to do troubleshooting, as if they simply are not connecting, I have no idea to investigate the problem.
I also tried it with an sensor that is connected on the Xiaomi App on my phone, and with one sensor that is not connected. As I read, that maybe only sensors added to the Smartphone App are broadcasting their values.

One Example configuration.yaml from me:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

device_tracker:
  - platform: bluetooth_le_tracker

sensor:
  - platform: mitemp_bt
    name: Temperatursensor
    force_update: true
    median: 1
    mac: "A4:C1:38:xx:xx:xx"
    monitored_conditions:
      - temperature
      - humidity
      - battery

Questions:

  1. Is it possible to connect this sensor without an ESP32?
  2. If yes, what am I not seeing? What am I doing wrong?
  3. Have you any tips for troubleshooting?

I would be very happy about an answer! Thank you very much!

i’m trying to do the same, did you have any success yet ?

In the end it was possible by using the " Passive BLE Monitor integration" from here:

But to be honest, I got it running late at night sometime 3 months ago. And of course, by now I’ve forgotten what the trick was. I do, however, have a new temperature sensor that I want to add as well. There I try to document the steps and I will write it down here. At the moment I am again struggeling adding the sensor.
Lesson learned: Documentation is important!

Ok, I think I made it.

Steps:

  1. Using the “Telelink Flasher” to get the software on the ATC: Telink Flasher

  2. Write down the MAC-Address and the “Mi Bind Key”

  3. The custom-components/ble_monitor has to be installed correctly to HomeAssistant: GitHub - custom-components/ble_monitor: BLE monitor passively monitors BLE sensors (Xiaomi, Qingping, ATC, BlueMaestro, Brifit, Govee, Kegtron, Moat, iNode, Yeelight, RuuviTag, SensorPush, Teltonika and Thermoplus)

  4. It should look like this under Configuration -> Devices & Services:
    Bildschirmfoto 2022-01-03 um 22.24.38

  5. Restart HomeAssistant (Configuration → Settings → “Restart” under the section " Server management"). Sometimes adding was only possible after restart. Don’t know why.

  6. Click on Configure
    Bildschirmfoto 2022-01-03 um 22.24.38 Kopie

  7. Chose Xiaomiand then click on the second drop down menu.

  8. Click Add device and then submit (I let all the other options on default)

  9. Enter MAC-address and bind-key, click submit (I let all the other options on default)

  10. You are back on the window before, click here also submit

  11. Click finish on the small window appearing
    Bildschirmfoto 2022-01-03 um 22.38.26

  12. I think it needed some time to get the data from the ATC, and also I made a reboot of HomeAssistant.

Somehow like this it should work. Hope it will help you :slight_smile:

Does anyone of you know if this addon works together with the new bluetooth-proxy in Esphome?

You can use the Xiaomi-Thermometer with the bluetooth proxy in esphome.
I am testing this at the moment via an ESP32 and one Xiaomi Mijia 2. The Test-Thermometer is flashed with “BTHome”. And the BThome lines are just added to my ESP32 in ESPhome.

You can find more Info on that here. There is also the link for the flasher.