Passive BLE Monitor integration

Thank you for your help

Iā€™ve tried to use Telink Flasher, i can connect correctly to my smoke detector but when i click on ā€œdo activationā€ i can find only the Device known id:
i canā€™t find the token and bind key.
Solutions?
thanks

TelinkFlasher only works on certain thermometers, not for smoke detectors. Try the first method.

Hello!

I installed this integration last night after having issues with the default Inkbird HA integration. Iā€™ve got 2 IBS-TH2 (so despite the TH, theyā€™re temperature sensors only), one for my freezer, one for my fridge. This integration picked them both up initially (the Inkbird only saw the freezer and immediately went unavailable), but this doesnā€™t seem to be updating the readings.

My setup, if it helps: Iā€™ve got a Kinivo USB Bluetooth Adapter for PC BTD-400 (Bluetooth 4.0 Dongle Receiver, Low Energy) attached to my machine via a 10ft extension cord (itā€™s command stripped to the wall!) - this is in my bedroom on the second floor. On the main level is a bluetooth proxy, and the two inkbird devices (among quite a few other BLE devices). The basement has one more bluetooth proxy, and a handful of other BLE devices.

Iā€™d say the distance between the living room proxy and the fridge in the kitchen are a max of 30 ft.

This is my settings/configuration for this integration:

Am I setting something up wrong for my use case?

Hello! Iā€™m trying to add Qingping Air Monitor Lite CGDN1. I added bluetooth MAC in a new device, but integration wont connect to it. I can see this device in bluetooth scanner, so that is how i got MAC address.
Can you please help me?

Did you check this note in the BLE monitor docs?

BLE is only working when it is paired with a companion app.

Yes, I`ve connected it to Qingping + app. I connected it to Xiaomi Home, but only after switching to China region. But now Passive BLE Monitor not see It both in manual and autoadd new devices modes.

Try to enable debug logging (at debug logging) for BLE monitor than and post some logs on github (create a new issue) and I will have a look. Make sure you enable ā€œreport unknown advertisements ā€¦ā€ for the MAC address of your sensor, to get an extended log for this specific sensor.

1 Like

Iā€™m starting to look at this again, after dedicating to other projects. Well, I took a look at the linked examples, but they are too much complex for my goalā€¦ I basically need to extract a couple of bytes from the manufacturer_data of the BLE advertisement and creating a sensor from them.

I would like not to use the passive BLE monitor because itā€™s going to be superseded by the HA Bluetooth; but, at the same time, I wasnā€™t able to find a clean, boiler-plate example to do this. All the examples that come with HA for BLE have - as Ernst suggested - a pypi package and a lot of codeā€¦ that I probably do not need, to do what I want.

This would need a lot of time in research, I suppose.

If I were you, I would add it to BLE monitor first. You can always convert it to a dedicated HA Bluetooth integration later.

Iā€™m also interested in the Hƶrmann BLE passive sensor. Did you or @virtualdj do any work on this?

I actually tried, but was unable to figure out how to create the sensor. I tried adding the ble_monitor custom component manually, to be able to edit its code.
Then, without creating a new garage.py file in the parser, I edited the ble_monitor/ble_parser/__init__.py file by adding a new block after this one just before the final else:

elif man_spec_data[0] == 0x14 and comp_id == 0x07B4:  # Garage
    # Extract useful data from advertisement
    g_state = man_spec_data[4] & 0x0F
    g_opening_percentage = man_spec_data[5] / 2

    # Convert state to a string
    if g_state == 0x03:
        g_state = 'open'
    elif g_state == 0x04:
        g_gstate = 'closed'
    elif g_state == 0x05:
        g_state = 'partially open'
    else:
        g_state = 'unknown'

    # Log
    _LOGGER.info("Garage state received: %s at %s percent.", g_state, g_opening_percentage)

    # Return sensor data just like in the parser class
    sensor_data = {
        "firmware": "Garage test",
        "type": "Custom garage sensor",
        "state": g_state,
        "opening_percentage": g_opening_percentage,
        "rssi": rssi,
        "data": True,
    }
    break

After enabling the logs and restarting HA they appear correctly so the advertisement message is catched but I donā€™t see any new entity for the garage within HA. Iā€™m certainly missing somethingā€¦ :confused: Iā€™m a beginner in Python, by the way.

1 Like

See above. The logs are working, but I would like to pack all the stuff in an integration (possibly directly in HA, without using the passive BLE integration as middleware).

1 Like

@virtualdj

You will have to add the device Custom garage sensor to const.py and assign the sensor opening to the device. In the code, change state to opening and add the mac address to the sensor_data. I can help with that.

1 Like

I edited the code like this:

elif man_spec_data[0] == 0x14 and comp_id == 0x07B4:  # Garage
	# Extract useful data from advertisement
	g_state = man_spec_data[4] & 0x0F
	g_opening_percentage = man_spec_data[5] / 2

	# Convert state to a string
	if g_state == 0x03:
	    g_state = 'open'
	elif g_state == 0x04:
	    g_state = 'closed'
	elif g_state == 0x05:
	    g_state = 'partially open'
	else:
	    g_state = 'unknown'

	# Log
	_LOGGER.info("Garage state received: %s at %s percent.", g_state, g_opening_percentage)

	# Return sensor data just like in the parser class
	sensor_data = {
	    "firmware": "Garage test",
	    "type": "Custom garage sensor",
	    "mac": to_unformatted_mac(mac),
	    "opening": g_state,
	    "opening_percentage": g_opening_percentage,
	    "rssi": rssi,
	    "data": True,
	}
	break

This is a bit tricky. I think you meant ble_monitor/const.py, right? There Iā€™m not sure how to add the deviceā€¦ I tried appending a new line to the MEASUREMENT_DICT like so:

    'SmartDry cloth dryer'    : [["temperature", "humidity", "voltage", "battery", "shake", "rssi"], [], ["switch"]],
    'Custom garage sensor'    : [["rssi"], [], ["opening"]],
}

but it is not enough to have the device appear. Can you elaborate this part, please?

I already created a beta version 11.9.0-beta that is ready for testing, you can install it with HACS, if you enable beta versions for BLE monitor

See also the discussion about the g_state on github

1 Like

Question: The Passive BLE Monitor integration does not make use of ESPHome Bluetooth Proxies added to Home Assistant, correct?

Iā€™m trying to access a SmartDry device, but the HA pc bluetooth is too far away to see it (I think). I have ESPHome Bluetooth Proxy device plugged in right next to the dryer, but it isnā€™t showing up.

Iā€™m assuming that because there is not (yet) a native HA integration for the SmartDry I canā€™t use the Bluethooth Proxy device to read it. Is that correct?

Thanks!

No, it does not work with Bluetooth proxies, but there is a silimar alternative. Check this page why this doesnt work and what the alternative is.

Awesome, thank you.

Iā€™m currently on the Beta channel for this extension on HACS and want to drop back to the main. How do I do that?