Passive BLE Monitor integration

Thanks, will change it in a next release

1 Like

Did you already manage to connect them?
I retrieved the bindkey also, but when I enter them into the Passive BLE integration with the mac-adress also it doesn’t seem to find the device. How did you do it, if you managed to connect them?

Is it possible to add support for AirThings BLE devices, such as the AirThings Wave Radon detector? I searched for any discussion around this, but didn’t see anything. There is an ESPHome integration for AirThings now, but it seems like this plugin might be able to do it as well and without an extra device.

Is it possible to use this to connect Sengled BLE bulb? Thanks.

Please take a look:

I’m afraid not. A light normally requires a connection, which is not supported by BLE monitor.

I’ve 2 BLE thermometer like Thermoplus.
scanning from teminal I can see:
image
I have put in cnfigurations.yaml:

ble_monitor:
  bt_interface: '00:E0:42:99:AC:03'
  bt_auto_restart: False
  active_scan: False
  discovery: True
  period: 60
  use_median: False
  decimals: 1
  log_spikes: False
  restore_state: False
  report_unknown: False
  devices:
    # sensor
    - mac: '6E:D7:00:00:04:2F'
      name: 'Temp_Interno'
      temperature_unit: C
      decimals: 2
      use_median: False
      restore_state: default
      track_device: False
      tracker_scan_interval: 20
      consider_home: 180
    # sensor
    - mac: '6F:45:00:00:03:A8'
      name: 'Temp_Esterno'
      temperature_unit: C
      decimals: 2
      use_median: False
      restore_state: default
      track_device: False
      tracker_scan_interval: 20
      consider_home: 180

I cant see any entity in home assistant… Note: enabling track_device I can see the track_device entity

In the log:

2021-12-07 08:15:41 DEBUG (MainThread) [custom_components.ble_monitor.binary_sensor] 0 MiBeacon BLE ADV messages processed for 0 binary sensor device(s) total. Priority queue = 0
2021-12-07 08:15:41 DEBUG (MainThread) [custom_components.ble_monitor.sensor] 0 BLE ADV messages processed for 0 measuring device(s)
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: main event_loop stopped, finishing
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Scanning will be restarted
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] 199 HCI events processed for previous period
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: Run
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: connected to hci0
2021-12-07 08:15:41 DEBUG (Thread-3) [custom_components.ble_monitor] HCIdump thread: start main event_loop
2021-12-07 08:15:43 DEBUG (MainThread) [custom_components.ble_monitor.device_tracker] 0 BLE ADV messages processed last 60 seconds for 0 device tracker device(s)

anyone can help?

Forgive my ignorance on this question, but I’ve been using this fantastic integration for over a year with 2 LYWSD03MMC Xiaomi sensors. I’ve bought 4 more and flashed them to the custom firmware using (Telink Flasher), same as the first 2 I bought. The process I followed to find the mac address is:

  1. sudo hcitool lescan
  2. Find the device called ATCXXXX and associated mac address that isn’t one of the sensors I’ve already added
  3. Go to HA integrations, click configure on Bluetooth Low Energy Monitor
  4. Then devices, add device, submit
  5. Enter Mac address, leave other sections default
  6. Submit again

Then the device adds, but nothing happens? The other 2 are still working fine, so is there something I’m mussing?

Did you enable the correct BLE format in the the ATC firmware. Or did you accidentally enable an encryption key in the firmware?

Hello,

Hello,
i am trying to monitor the additional sensors which are reported via custom firmware of LYWSD03MMC (GitHub - pvvx/ATC_MiThermometer: Custom firmware for the Xiaomi Thermometers and Telink Flasher via USB to Serial converter).

i have added in const.py the opening sensor - like this:
‘ATC’ : [[“temperature”, “humidity”, “battery”, “voltage”, “rssi”], [], [“opening”]],
But it always shows “Closed” - regardless of the real state. ( I am monitoring the advertisements, and they changed accordingly.
As a workaround, i have done:
swap the places of “switch” and “opening” in atc.py - like this:
“opening”: (trg >> 1) & 1,
“switch”: (trg ^ 1) & 1,
and added the switch sensor in const.py - like this:
‘ATC’ : [[“temperature”, “humidity”, “battery”, “voltage”, “rssi”], [], [“switch”]],

Now the switch state changes accordingly the real status.
Could You please look into the problem, because now only one of the two “sensors” is usable.

Regards
Gabriel

OK, wasn’t sure which settings you were referring to, but thank you for the assistance. In the end I used this firmware (GitHub - atc1441/ATC_MiThermometer: Custom firmware for the Xiaomi Thermometer LYWSD03MMC and Telink Flasher via USB to Serial converter) which according to the author may not have as many settings as the one he links to, but I flashed the latest and it worked for me, so thank you!

Hello,

I have a Qingping CGD1 device.
I did all the steps described:

  1. I added a BLE repository via HASC
  2. I configured the device (which was self-detected)
  3. I restarted the HA
    Unfortunately I cannot find any of the sensors…

What am I doing wrong?

Kind Regards
Tom

In the options, can you see the MAC of the device in the devices pull down menu at the bottom? If not, HA didn’t receive a BLE message from this device. This can be caused by several reasons, normally reception issues (like too long distance between sensor and HA, SSD drives blocking the signal). Check the FAQ for tips.

@Ernst - you have got 100% right :slight_smile:
My device was too far from HA.
Now everything wors perfect.
thank you!

Getting constant aioblescan errors in my log.

...
File "/usr/local/lib/python3.9/site-packages/aioblescan/aioblescan.py", line 191, in decode
    self.val = unpack(">B", data[:1])[0]
struct.error: unpack requires a buffer of 1 bytes

Is there something I can do to mitigate this?

I installed the latest stable version (6.3.0) of this component via HACS on a standard HA install on a Raspberry PI4.
Logfile entries indicate that the code is there:

2021-12-14 15:42:48 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration ble_monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

2021-12-14 15:42:48 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

This is the very latest HA release core-2021.12.1
Unfortunately I cannot add the integration via the menu thus cannot get to the UI. Is this maybe related to the updated HA core ?

image

Did you restart HA after the installation. Try to hit F5 a couple of times, or delete the cache of your browser.

The warnings are just warnings HA shows on each custom component.

I restarted the core a few times and when that did not work restarted the whole Raspberry PI.

But I did not try a reload … F5 did the trick.

Thank you for the fast reply.

@Ernst, thank you for a great integration!
I have some self developed BLE sensor that I would like to add to the Passive BLE Integration. Is that possible, and if so, where would i need to edit code (what files/functions)?
My sensors only uses the Manufacturer data field, so that needs decoding.

See this issue on github.

We need to write a parser for homebrew sensors and something like “if firmware = homebrew add sensor based on the sensor type being received in the BLE advertisement”. The first part is easy (just copy one of the existing parsers), the second part needs some more work, as the supported sensors per device are currently defined (hard coded) in const.py. Based on this file, the correct sensors are added for a certain device. For homebrew sensors, I think we need to make something that adds a sensor as a BLE message is received. So if one person has a homebrew temperature sensor, only a temperature sensor should appear. For person 2, this can be a humidity sensor.

So, yes this is possible, but needs some adjustments to BLE monitor. Please discuss further in the mentioned topic.