Passive BLE Monitor integration

Go to HACS, click on the tile of BLE monitor, click on the three dots (top right), click on “download again” (or some similar name, I don’t have the English version). There you can turn of the beta versions by clicking the slider).

Did you experience problems with the latest beta?

1 Like

@Ernst - many thanks (as ever).

No issues; I was on a pretty old version (ain’t broke don’t fix) and just catching up and didn’t want to risk breaking things. The integration works so well and is rather fundamental for what I use HA for (heating control)!

My integration don’t start, logs:

May 19 01:25:43 raspberrypi hass[955]: 2023-05-19 01:25:43.081 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.ble_monitor
May 19 01:25:43 raspberrypi hass[955]: Traceback (most recent call last):
May 19 01:25:43 raspberrypi hass[955]:   File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 725, in get_component
May 19 01:25:43 raspberrypi hass[955]:     cache[self.domain] = importlib.import_module(self.pkg_path)
May 19 01:25:43 raspberrypi hass[955]:   File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
May 19 01:25:43 raspberrypi hass[955]:     return _bootstrap._gcd_import(name[level:], package, level)
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
May 19 01:25:43 raspberrypi hass[955]:   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
May 19 01:25:43 raspberrypi hass[955]:   File "/home/homeassistant/.homeassistant/custom_components/ble_monitor/__init__.py", line 30, in <module>
May 19 01:25:43 raspberrypi hass[955]:     from .const import (
May 19 01:25:43 raspberrypi hass[955]:   File "/home/homeassistant/.homeassistant/custom_components/ble_monitor/const.py", line 361, in <module>
May 19 01:25:43 raspberrypi hass[955]:     BLEMonitorSensorEntityDescription(
May 19 01:25:43 raspberrypi hass[955]: TypeError: __init__() got an unexpected keyword argument 'suggested_display_precision'
May 19 01:25:43 raspberrypi hass[955]: 2023-05-19 01:25:43.087 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration ble_monitor: Unable to import component: Exception importing custom_components.ble_monitor

Update to 12.0.0-beta didn’t help.

Which Home Assistant version do you have? I think you are running a (too) old HA version.

1 Like

Thank you!
You right. I used 2023.1.7 with python 3.9 and today I updated to python 3.11 and HA 2023.5.3.
Now it work!

Has anyone gotten Passive BLE Monitor integration working with Shelly bluetooth proxy?

That isn’t possible. BLE monitor works with its own mechanism to collect BLE data

  • locally with the Bluetooth adapter (via HCIdump → aioblescan → BLE monitor → HA)
  • or via an ESPHome device (ESPHome → ESPHome BLE gateway → BLE monitor)

The official HA integrations have a different mechanisme, which is all included in the Bluetooth integration. This works

  • locally via Bleak → Bluetooth integration → Brand specific Bluetooth integration (e.g. xiaomi-ble, bthome, govee-ble, etc) → HA.
  • or via an ESPHome device (ESPHome → ESPHome/Shelly Bluetooth proxy → Bluetooth integration → Brand specific Bluetooth integration → HA.

I don’t think a shelly device can run ESPHome BLE gateway. So, either use one of the official integrations, or buy an ESPHome device and flash it with ESPHome BLE gateway.

1 Like

Thank you for answering.
That’s too bad, it would be awesome if Shelly proxies work with BLE monitor. Maybe someday

They should be able to do this, if you flash the Shelly with ESPHome. I do this with all my Shelly devices, as I don’t want to have another integration/custom_component in use. But I don’t have a Shelly with BT, so I can’t test.

Hello! does anyone know how to solve the problem of the step entity? I use the zepp app and Amazfit GTS
I have only synchronize the heart rate and only when I am recording an exercise. Thanks!

I have added Passive BLE Monitor and now I can’t get my Oral B brushes to show up within the Oral B integration meaning that they have a lot less attributes. I have looked through Oral B documentation and here and I don’t see a solution, but I am sure it is something simple that I am missing.

If I try to add the Oral B integration it says it doesn’t detect any devices. If I remove them entirely, they only pop back up as Passive BLE Monitor devices.

Most likely you need to set both the Bluetooth integration and BLE monitor to passive scanning. If one is using active scanning, and the other passive scanner, one of the integrations won’t work.

1 Like

I have a Linux set up so I can’t verify passive BLE without digging in the weeds so that tracks. Thanks!

@Ernst Is the Mi Door and Window Sensor supported?

Mi Door and Window Sensor 2 - Xiaomi Global Official

Looking for a Bluetooth Window sensor :slight_smile:

I think yes, assuming it is the MCCGQ02HL Mijia Window/Door Sensor 2. But double check the exact name when you buy it. Look for MCCGQ02HL.

1 Like

Two of these have arrived but do not connected automatically (unsurprisingly).

The entry in Supported Devices says they are encrypted, but not what version (and I’m not following the docs on getting the key).

I can see the BLE advertisments via a Phone app so have the MAC address. What next?

It should be the V4/V5 encryption. Did you add the sensors to MiHome?

1 Like

No I hadn’t and I hadn’t RTFM either. :man_facepalming:

I’ve now done both and used the Token extractor tool to get the token (it wouldn’t connect via the web page method).

I get this info and am I correct it is the Token I use not the BLE Key

image

Device has appeared in the Integration. I then selected the device at the bottom of the ‘configure’ menu and added the Encryption Key

image

All I am getting is

image

Do I need to do a full restart? Active Scan is on.

Battery can take a while, before it shows up.

However, you need the BLE KEY, not the TOKEN (it’s also stated in the FAQ :grinning_face_with_smiling_eyes: )

Try to open/close the sensor, to see if it updates the opening sensor

1 Like

Grrrrr (missed it)

Also discovered that everytime you press the button for 3 seconds it resets the encryption key! The app said it couldn’t find it so I guessed what I’d done :frowning:

After lots of poking I now have data and it works.

However, light sensor and battery not reporting data. I do see this data on the phone app.
Took a while to come through.

As ever, many thanks - this really is one of the best integrations around and your work is immense :clap: