Passive BLE Monitor integration

Same here. From 2 days i get AA:AA:AA:AA:AA mac adress of my bluetooth in my RPi4 supervised. I tried to restore snap but it didn’t solve the problem. Maybe someting with apt update and upgrade? I remember i did it 2 days ago.

This normally means that it can’t find a Bluetooth device on your system. Try to do a full restart (not only HA). Sometimes Bluetooth firmware is updated with apt-get upgrade, and not loaded again. A full system restart might help.

Hey, I’ve by fault ordered some SJWS01LM Xiaomi Leak Sensors and like to integrate them using this plugin.
Im using HassOS on a rpi 4 with internal Bluetooth.

As far as I understood it should find all supported sensors automatically and add the corresponding MAC in the devices list at the bottom, but for me it doesn’t show any options besides „devices…“ and „add devices“.
Also the report_unknown option doesn’t throw anything out if I select „Xiaomi“. (With the other option i had 19.000 results in the log after a short time).

I already got the encryption_key using TelinkFlasher Website, but there it shows the devices as „Xiaomi flood sensor“ and doesn‘t shows me any MAC address.

My problem is currently that I haven’t found any way to find out the MAC address for this device, also Bluetooth scanner apps only show UUIDs and no Mac addresses. Does anybody have some hint for me?
Greets

Normally the MAC address is automatically added to devices, after which you can add the encryption key. Try placing it closer to your HA machine, to rule out connection issues. Perhaps an SSD interfering with the Bluetooth radio?

Sometimes it is also needed to pair it to MiHome first, to make it start broadcasting data. Note that this might give a new encryption key.

Okay, did try the second sensor now, too. This one also doesn’t show up.
As it shows a lot of devices when using the report_unknown others I would say the connection is okay.

But I’ll try more things then. Hopefully it doesn’t need to be paired, as the lack of a Xiaomi gateway would make that hard to solve :wink:

I mean this link:

The one at the top-right of the GitHub page, right under the description.

1 Like

A, thanks, I’ll change that one.

1 Like

you don’t need gw for ble devices. just pair with bt to your account and read beacon key from cloud.

since last restart none of my bluetooth devices are found. every state for humidity or temperature is unknown.
devices are LYWSD03MMC connected to a raspberry pi. any advice why the state is not shown correct?
batteries are all ok. should be something with the integration or bluetooth in general.
HA and integration are on latest versions

After changing the region I was able to connect a second waterleak sensor to the cloud and was able to get the token using the token extractor and it decrypted in ble_monitor.

Tried several things with the first one and finally got it to connect to the Xiaomi app. Its working all fine now :slight_smile:

Hi guys,

I have a ESP32 running ESPHOME with several LYWSD03MMC connected to it.

After changing the LYWSD03MMC firmware, what do I need to configure in the ESPHOME config file so it will detect the sensor? is it another platform? or it stays the same only send the new bind key?

This topic is for BLE monitor, not ESP Home. But to answer your question, after flashing ATC firmware, it depends on which advertisement types you have selected to broadcast and the firmware type. To quote the ESP Home docs:

  1. Xiaomi stock firmware (requires a bindkey in order to decrypt the received data, see Obtaining The Bindkey)
  2. Device flashed with ATC MiThermometer custom firmware
  3. Device flashed with PVVX MiThermometer custom firmware
  • “Mi Like” advertisement (dummy bindkey required)
  • “Custom” advertisement (no bindkey required)
  • “pvvx” custom advertisement (no bindkey required, only PVVX firmware)

thanks for putting me in the right direction, and sorry for the mistake

I’ve also got this issue, have you found any solution yet? I can’t pin it down to either a HA version upgrade, HACS upgrade, or the BLE Monitor integration upgrade, but as of today I have this error on startup:

Logger: homeassistant.config_entries
Source: custom_components/ble_monitor/__init__.py:243
Integration: Passive BLE monitor (documentation, issues)
First occurred: 8:03:57 PM (1 occurrences)
Last logged: 8:03:57 PM
Error setting up entry Bluetooth Low Energy Monitor for ble_monitor

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/ble_monitor/__init__.py", line 243, in async_setup_entry
    hci = list(BT_INTERFACES.keys())[list(BT_INTERFACES.values()).index(bt_mac)]
ValueError: 'REDACTED_MAC_ADDRESS' is not in list

It means that it can’t find the MAC address of your Bluetooth radio (dongle/internal) anymore (the one that you configured in the settings of BLE monitor). Did you change your Bluetooth dongle or did you do an sudo apt-get upgrade? Try restarting the complete Home Assistant machine (not only HA).

Thanks for the quick reply.

Well, actually, one of my BLE devices died about a month ago, and obviously stopped reporting since then. This isn’t the most recent time the pi has restarted since then though and I’m only now seeing problems. How can I reconfigure the integration to not look for that MAC any more?

Sorry, never mind, I misread what you had written. To confirm, you’re saying that the integration can’t find the rPi’s embedded bluetooth device in order to communicate with any BLE devices, correct? I’ll see what a power cycle does and report back.

Yep indeed, it seems like a power cycle has solved this issue!

:tada: A little update on the latest changes :tada:

5.1.3/5.1.4/5.2.0 have been released [BREAKING CHANGES]

Breaking changes

  • ext_state attribute of opening and kettle sensors has been renamed to status and is displaying the actual meaning in stead of a number
  • Rewritten the toothbrush sensor to a binary sensor, with the score and a counter as attributes

Other changes

  • Added support for Xiaomi Aqara N100 and N200 locks
  • Added support for Teltonika Blue Coin T support
  • Added an RSSI sensor for all sensor devices (disabled by default [1])
  • The integration in now using the (Binary)SensorEntityDescription allowing us to reduce the code
  • Several code formatting fixes to get closer to HA standards

[1] This RSSI sensor is disabled by default, and can be enabled via configuration, integrations, devices on BLE monitor tile, select device, +1 disabled entities and enable entity.

If you encounter an issue, please report here. A significant code rewrite has taken place, so I might have made an error.

3 Likes

Thank you very much for this great integration @Ernst!
I have a Aqara N100 lock that I am trying to get some useful information from, but I’m having trouble utilising automations to get specific data from the lock. (Do one need to use templates?)
In version 1.5.3 there was missing attributes(I didn’t have “action” under automations for instance) but in the newest version they’re all there.
Could anyone please give an example of programming an automation for a novice?