[Hass, OS X,...] Xiaomi BLE Temperature and Humidity sensor

Hi,

I am quite new to home automation. My idea is to have an automated heater switch for the winter.

As they are cheap, reliable and good-looking, I want to use the Xiaomi Bluetooth Sensors with a display.
Currently, I am running HA on a Mac as a Docker image.
I do not want to grant the sensors and other products access to the WiFi (so no calling Xiaomi home, though I have a modded Xiaomi Dafang cam that might act as a bridge, I do not want to use it).

I found the section of the home automation site https://www.home-assistant.io/components/sensor.mitemp_bt/
As I am on a Mac, I tried the Docker version.
But one prerequisite is the ā€œproperly configured Bluetooth on the hostā€.

As the usual Linux Bluetooth tools are not available on OSX, I tried (after searching for hours) the LightBlue App. This can discover and establish a Bluetooth connection, but I canā€™t get the MAC address but the UUID.
Apparently, this does not help me.

So now I am wondering if I shall migrate completely to a RasPi and run hass io on it.
BUT for this Xiaomi device it is stated: On Hass io: Not yet supported.

So, in theory: if I ran another linux on the RasPi and would establish a bluetooth connection from the host OS and would in turn run the docker image on the same RasPi, would this solve my problem?

The funny thing is: I tried Homebridge. And it simply works. But I cannot figure out how to get a temperature log and the functionality is limited (for example to establish a rule like: if the temp<18, power on wifi socket, if temp>21, power off wifi socket - I can only create a bunch of rules in the Elgato Eve app that check every x minutes if the temp is in the given range and then either power on OR power off. Meaning I currently have one rule at 0:00 check if temp <18, on, then 0:01 check if temp >21, off and that for every half an hourā€¦).

But reading other threads in this forum, it appears to be possible to integrate this device.
Do I need a full-blown linux machine for that? (Because VM on OSX with Linux probably wonā€™t solve the Bluetooth issue and I need my Bluetooth Keyboard/Mouse on OSX quite frequently :slight_smile:

Any insights are highly appreciated. I tried reading as much as possible and not asking the same question, but I canā€™t seem to find an answerā€¦

Thanks,
best wishes
Jens

I use a rpi zero to handle all the ble stuff and forward it to HA by mqtt. Simple and stable sollution.

1 Like

I use an rpi0 to do a lot of the bluetooth data work, including that sensor - here a few links that will give you some ideas. Itā€™s a very stable affordable solution - and itā€™s not a big deal at all to have two installations of Home Assistant talk to each other:

Thanks for the replies.
This is interesting.
So basically I need as RasPi Zero W (about 20USD from Aliexpress), I will print a 3D case, Powered by standard Micro USB, and a RasPi 3 (not B+) for about 40USD (for example this one Ali)
Do I have to pay special attention to something? Powersupplies/Heatsinks/ā€¦ is this voodoo or really needed (never ran a Pi before)

As I am living in a tiny apartment and I do not need the Bluetooth bridge functionality that the Zero is essentially doing, I am still wondering why github /hannseman/homebridge-mi-hygrothermograph using noble can so easily integrate the Xiaomi into Apple Home while HA is struggling and I have to run multiple Pi etc.?!

Thanks for the insights!

Hi, I am running hass.io on Rpi3 and Xiaomi BLE sensor works ok (despite official documentation). You need to install Bluetooth BCM43xx add-on and then find out MAC address of sensor. For that I simply used Android phone. No need for Rpi Zero.

Side note for anyone who is worried about the Xiaomi Gate way ā€œcalling homeā€ if you give it a static IP then block its internet access in your router (assuming your router can do that) the Gateway is happy to keep working away with out internet access been running like this for a few months with out issue, only thing is you will have to temporary give it access to the internet for firmware upgrades or when adding additional devices.

Hi,

I had problem, that my HA server is in boiler room and has very poor and unstable Bluetooth connection, so if anyone is interested, Iā€™ve created lightweight script, which reads Xiaomi BLE temperature and humidity sensor data, and transfers it to MQTT. Iā€™m running it on RPI 2 with BT USB Dongle. Iā€™ll add some features in future, but so far it works great.

1 Like

Lol, you are right, it is working! You have to wait at least 10 minutes after hassio restart and then it works! Hurray!
edit: But it has to be really close to rPi, like 1 meter. :frowning:

Ahoj Davide, mine is about 6m far from rpi and it is working fine. I also tried bathroom which is behind one (thin) wall, also with success.

Hello everybody.

Thanks for all the help.
My Raspberry Pi 3 arrived and I can confirm that the sensor works. Even on the sensorā€™s site it now reads: ā€œOn Hass.io: mitemp_bt will work out of the box.ā€

Now my perspective has changed a lot.
While I thought so far Bluetooth is the problem and WiFi is the solution (to this specific case) I now find the Xiaomi Bluetooth Temp. sensor better than the non-bluetooth one:

I just received a Xiaomi Smart Plug and the aqara (non display, wifi/zigbee) Temperature sensor.

I am still worried about using the Xiaomi MiHome app and granting all these devices access to my networkā€¦ As I only have a Huawai HG659b router, it appears that I can grant them access to a guest network, where they can only access the internet but not other devices in the home network. But this appears to me to be completely the wrong way around. I want them to talk to each other but not to call home.
A DMZ might be a solution. But as I am not a networking expert some insight from you guys would be amazing.
I also want to integrate a smoke detector. But the nest one is really expensive. I found solutions soldering a small board to a First Alert Z Wave detector (First Alert Z-Wave Smoke / Carbon Monoxide Detectors don't show up in Home-Assistant). So both of these solutions donā€™t seem to be as elegant and cost-effective as the Xiaomi-Honeywell smoke alarm.
Am I too paranoid? Should I just go for the gateway and the Mi app?

Thanks for the support,
best wishes
Jens

Edit: having read the https://en.wikipedia.org/wiki/Blackout_(Elsberg_novel) book does not exactly help :slight_smile: In this book the apocalypse is caused by smart meters being hackedā€¦

static IP + block its internet access