Passive BLE Monitor integration

Passive BLE monitor is a passive scanner, so it wont affect battery life (with active scan set to False). It is just listening to BLE advertisements, it does not send anything to your sensors, like is being done with sensors that require a connection.

@Ernst you misunderstand where I want to save energy: At the scanning device, not the BLE sensor devices that are scanned by this device.

A, sorry. That isn’t possible at the moment. It is also a bit tricky if you have e.g. motion sensors, in that case it will need to run the scanning continuously. There are also sensors, like LYWSD03MMC, that update pretty rarely, like once per 10 minutes (with default firmware).

1 Like

6.7.1 release

Since the last update I mentioned in this topic (6.4.3), we have added several new sensors and fixed some bugs.

new sensors

  • Govee Meat Thermometer (H5183)
  • Inkbird IBS-TH2
  • Switch and opening sensor for LYWSD03MMC with ATC firmware (sensors are disabled by default, but can be enabled via the UI)

bug fixes

  • Fixes in auto-restart logic

Other
We have also found a solution for this nasty bug

HCIdump thread: Runtime error while stop scan request on hci0: Event loop stopped before Future completed.

If you are facing this bug, please check the faq, especially step 3, which is refering to another article in the FAQ. We have added the following note, which seems to solve it for some people.

Note 2

When Home Assistant is installed in pyenv, the output of the command which python3 looks like /home/homeassistant/.pyenv/johndoe/python3 but this is not the real link to actual python3 interpreter. The actual binary is placed in a folder like /home/homeassistant/.pyenv/versions/3.9.9/bin/python3.9 (it might slightly differ depending on the installed python version). So to grant root access to python, it is required to run the setcap command with the correct path, i.e.

setcap 'cap_net_raw,cap_net_admin+eip' /home/homeassistant/.pyenv/versions/3.9.9/bin/python3.9

Hi,
New to HASSOS and keen to add BLE devices. I’ve followed the instructions on a clean install using HACS on HASSOS but I keeps reporting the error. Added debug but this just keeps reporting no device advertised every 60 seconds. (also, I can’t putty in and using Terminal add-on I can’t work out how to copy text. It’s making me feel very dumb)

Seems everyone else with a similar error once had it working but I’ve never been able to get past this point.
Hope someone can point out where I’m going wrong?
Cheers
Martin

@mjb183
There is an FAQ article about this error, which you can check for possible solutions. But, normally, this issue occurs on HA core, venv or docker installations, that have issues with the access rights to Bluetooth. In your case, you are running HA Os, which makes it difficult to run most solutions. Can’t remember that I have seen this issue on HA OS before.

You can install the SSH & Web Terminal add in in HA to gain access to the terminal, although the terminal is still limited (as in, you can’t run every command). In that way, you could run some of the tips in the FAQ. Otherwise, check this issue on github

Thanks for getting back so quick!

Hmmm, I didn’t find that FAQ so thanks. Seems this might some digging as bluetoothctl command can’t see any controllers even though the log shows a mac address. As you say, sadly I have very limited command available through the Terminal add-on.

I’ll persevere for a bit longer and see if I can find the solution.

Thanks
Martin

Right after midnight today I started getting an error that just says:

SensorPush device type id 83 unknown

The error is occurring hundreds of times a minute. I just cleared my logs and within 3 minutes it was already up to 500 times. Does anyone know what this error means? I don’t have any SensorPush devices at all, and it looks like the only SensorPush devices supported by this integration are temperature/humidity sensors, which I also don’t have (from any brand).

I’ve never gotten this error before in the year I’ve been using this integration, and I definitely didn’t get any new devices since midnight.

@scoutamis Try updating to 6.9.2, I thinks this should fix the issue.

Weird, it seems to have stopped on its own at exactly midnight. Just as strangely as it started at exactly midnight. Either way, I will update to 6.9.2 in case it comes back. Thanks!

I am sorry if there was an answer already but I cannot find it using search.
Can I use this integration without having bluetooth on my HA host? My HA is running on a virtual machine and I do not have any bluetooth dongles on that server nor I want to spend time making it available for my virtual machine if I attach one.
I have several ESP32 in my apartment up and running and I want to use them as a source of data from BLE devices for this integration. Is it possible?

Yes, that is possible. You can use ESPHome with BLE gateway to forward the received BLE messages to BLE monitor over WiFi. BLE monitor has a special service to process this data, without having the need to an actual Bluetooth interface. Check this page for a link to BLE gateway.

1 Like

I just added this integration to try and add my Xiaomi Mijia Temperature sensor, but it appears that whenever I enable this integration it turns my raspi into a potato. SSH lag through the roof (10+seconds for characters to start appearing), network-based integrations fail to load (e.g. sensibo for my dumb ac), and lovelace struggles to load pages. I can’t see anything in the logs related to this, just the side effects (i.e. failed to establish connection with sensibo), but when I disable the ble integration all the symptoms go away, and then when I re-enable it they come back

Is your HA device connected to WiFi? I suspect that your Bluetooth radio is interfering with your WiFi signal. Try using the 5 GHz Wifi or a cable, just to see if that’s the issue.

No Problem, I have 4 on one esp32:

this is how my YAML looks:

sensor:
  - platform: xiaomi_lywsd03mmc
    mac_address: A4:C1:38:A4:C1:38
    bindkey: "Insert your bindkey within the quotes"
    temperature:
      name: "Shower-room Temperature"
    humidity:
      name: "Shower-room Humidity"
    battery_level:
      name: "Shower-room T&H Battery Level"
      
  - platform: xiaomi_lywsd03mmc
    mac_address: A4:C1:38:A4:C1:38
    bindkey: "Insert your bindkey within the quotes"
    temperature:
      name: "Kitchen Temperature"
    humidity:
      name: "Kitchen Humidity"
    battery_level:
      name: "Kitchen T&H Battery Level"  

Hi all,
i’ve some problems with temperature/humidity sensors in the past week, i don’t know if dependt from last updates…

Logger: homeassistant
Source: custom_components/ble_monitor/sensor.py:577
Integration: Passive BLE monitor (documentation, issues)
First occurred: 08:25:24 (1 occurrences)
Last logged: 08:25:24

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/ble_monitor/sensor.py", line 224, in async_run
    entity.collect(data, period_cnt, batt_attr)
  File "/config/custom_components/ble_monitor/sensor.py", line 577, in collect
    <= data[self.entity_description.key]
KeyError: 'temperature'

Can you tell me which sensors you have?

Thank you Ernst for reply,
there are 2 Thermoplus and 1 MHO-C401 (Azarton), all with original firmware.

@jump396 I think it’s better to create a github issue, I don’t see why this can happen (yet), so I need to look into this, probably with some help from you to debug things. Can you create an issue on github, and can you also post a log on github, with logging in HA at debug level.

logger:
  default: warn
  logs:
    custom_components.ble_monitor: debug

ok @Ernst, I will do it as soon as possible, thanks