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:
- Is it possible to connect this sensor without an ESP32?
- If yes, what am I not seeing? What am I doing wrong?
- Have you any tips for troubleshooting?
I would be very happy about an answer! Thank you very much!