Passive BLE Monitor integration (Xiaomi Mijia BLE MiBeacon monitor)

I think it is kernel issues personally. However, if it was standalone, if you get it working you can leave the OS alone - not really an option with HA OS.

Yes, probably it is a kernel issue. But what I still don’t understand is why Bluetooth works fine on a Raspberry with HA OS for most people, while some, like you, have issues. It is the same hardware, same OS. If it wouldn’t work at all on HA OS, github would be filled with issues, but that’s not the case. On the other hand, it’s not only you, from time to time there is someone who is having these unexplainable issues. Very frustrating, I agree.

It worked! After i set the app to CN it showed up in the Bluetooth scan.
Thanks a lot!

Xiaomi Mi Scales support (both V1 and V2)
Today, we have released 1.7.0. Since the latest announcement in this topic (1.5.2), we have added support for Xiaomi Mi Scales (both V1 and V2). Mi Scales report (stabilized) weight, non-stabilized weight, weight removed and impedance (V2 only).

Please note that the restore_state option isn’t working for scales, I’m working on that to be fixed in a future release.

If you want additional info like BMI, body fat, etc, you can e.g. use this integration.

If you want to split up your weight to individual persons, have a look here

1 Like

Hi, I’ve just come across this very cool component, and wanted to make a request to add a non Xiaomi (but well documented) device to the component?

I have a device in my kegerator called Kegtron that monitors keg volume and reports via passive BLE advertisement messages (0XFF). The protocol for the device is fully documented here:
Gen1BLEMessageFormat.pdf (kegtron.com)

There are two versions of the Kegtron device. One has a single sensor, and the other has two sensors to be able to monitor two different kegs. The latter alternates data messages between the two sensors on the 0xff advertisement broadcast every 500ms or so.

I know it is a different device type than much of what is already supported by this component, but it seems like it could be well suited for it. Would you consider it? Thanks in advance!

@millercentral Yes, I can add this, should be possible. We already have more non Xiaomi sensors, like the Qingping sensors, ATC sensors and Mi Scale sensors (yes, these are Xiaomi’s, but they don’t follow the MiBeacon format and have their own BLE format). To be able to add this device, please open an issue on github and if possible, please also add a HCIDUMP with some data. Instructions are in the faq

1 Like

Hi, New to HA and the forum. I would very much appreciate your advice.

I am reluctant between A- using BLE thermometer and using or B- RF temp sensor +s rtl-sdr dongle to sniff the code. (accurite) to monitor my campervan fridge freezer temperature.

How does the above solution compare to using an RF sensor given the freezer sub zero temperature (celicius) and its possible impact on battery life.

With regards to using a BLE monitor does one need and ESPhome or is the native bluetooth of the Pi3 or Pi3B+ enough? the Pi hosting HA is located right next to the fridge.

Many thanks

Hi, im running on a NUC , official image of HA, with core version 2021.4.4. All is running perfect.

Checking new version install, appears an error:

[20:33:37] INFO: Installed Home Assistant 2021.4.6
[20:33:37] INFO: Making a copy of your configuration for checking...
[20:33:37] INFO: Checking your configuration against this version...
[20:37:56] ERROR: Found an error in the log output of the check!
[20:37:56] ERROR: See the output below for more details.
ERROR:custom_components.ble_monitor:No Bluetooth interface found. Make sure Bluetooth is installed on your system
[20:37:56] INFO: The full output has been written to /share/check_config.txt
[cont-finish.d] executing container finish scripts...

Any idea to update without errors?. All my btooth sensors are working ok.

@makaveli7 I can only answer your last question, BLE monitor uses the native Bluetooth of e.g. your raspberry. I have no idea if a fridge is able to let pass Bluetooth signal or is acting like a cage of faraday and blocking signals.

@Luisico there is an issue on github about this as well. Still have to look into this it seems to be an issue in the config check only, it works fine if you just update. It’s related to not being able to do the HCICONFIG command in the temporarily installation which is made when testing the configuration.

1 Like

Thanks, I will give it a go and report :slight_smile:

i havent found that issue thread, but many thanks , i`ll update later

Here is the issue.

1 Like

@makaveli7 I have installed LYWSD03MMC units inside two fridges at home, and read them using an ESP32. I have not tested the maximum range, but the ESP32 is appx. 4-5 meters away and one floor above one of the fridges.

For my freezers I currently use RF433 thermometers with external sensors. I have yet to find a BLE thermometer rated for sub-zero temperatures. You will definitely need something with an external sensor - button-cell batteries will not work very well/long at -20C.

I have a MCCGQ02HL door/window sensor. Is there any way to get the encryption key without having a gateway?

All the documented methods seem to involve getting the key from the Xiaomi cloud, but I can’t add this device to the MiHome app. I don’t see this exact device, and both of the supported door/window sensors in the app tell me that I need a hub/gateway.

change region to china in mi home app.

Thanks! I have the MCCGQ02HL in the Mi Home app now.

1.7.0 seems to be last version working with my devices running pvvx version (all of them are using it - I can’t test with the original firmware). All 1.7.1, 1.7.2 (beta or not) or 1.8.0 beta don’t get any value. Reverting to 1.7.0 and all is fine again.
I’m seeing that exception in the core log :

2021-04-25 15:43:11 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/ble_monitor/sensor.py", line 176, in async_run
    sensors = await async_add_sensor(mac, sensortype, firmware)
  File "/config/custom_components/ble_monitor/sensor.py", line 138, in async_add_sensor
    if self.batt_entities and (v_i != 9) and "Xiaomi (MiBeacon)" not in firmware:
TypeError: argument of type 'NoneType' is not iterable

Thanks for reporting!. Fixed this issue in 1.7.3. New release has been released right now.

Thanks. Updated to 1.7.3 and it’s working great

There is now a new thread for this custom component.