Revival of Official Bluetooth Binding

I’m also thinking of a new feature for the Bluetooth binding through DBUS: a custom agent to allow the pairing directly from the binding. I’ve checked the tech details - I just need some time to implement this.

1 Like

Hello.I am tested this.
I get data from a temperature and humidity sensor using the third-party C ++ + Bluez program on my OrangePi PC + usb dongle bluetooth 4.0. I removed the standard bluetooth binding and installed (in addons folder) first org.openhab.binding.bluetooth.bluez-2.5.4-SNAPSHOT.jar but I did not get the Bluetooth Roaming Controller.
Next, I removed this and downloaded org.openhab.binding.bluetooth-2.5.4-SNAPSHOT.jar and the Bluetooth Roaming Controller showed up in Inbox and was added. But my Xiaomi temperature sensor was never found in Inbox.
Previous topic with my questions (no solved): Xiaomi Mija Sensor Tempetature, Bluetooth (console data)

Any progress with testing this? :slight_smile:

Mmmh. I’ve offered testing it once the GATT stuff has been implemented, that’s true :wink:
But: I’m not sure, if this has happened yet :thinking:

@cpmeister Is it done already?

Let me know…

I would also by happy to support testing. Is there any progress on this?

Hi,

I’m still not able to cover presence functionality with official binding - anyone has it?
@cpmeister - if you have ability to cover this functionality, you would be able probably to become new maintainer of project: 3rd Party Bluetooth Binding. Beta testers needed
@vkolotov had to stop it and is lookinf for someone to replace. It’s a great bindig with a lot of functionalities in comparison to official one. A lot of beacons already covered and many adapters can be used. Now, it’s not adapted to new openhab version and has some issues with connection - desperately needs new maintainer :slight_smile:

Hi, guys any update? I have managed to update bluez to the latest 5.5 version and managed to get bluez bridge online, discovered sensor, but got only RSSI data, no humidity, no temperature data. How to add those channels?

I have good news, I just got roaming device support added into the official bluetooth binding. This feature essentially allows devices to be tracked based on the adapter they are closest to. This is essential for implementing multi-room presence detection.

In other news I’ve almost completed work on GATT channel support for the official bluetooth binding. This feature won’t be able to make it into the 2.5.9 release but it will definitely make it for the OH 3 release.
Once I have the feature in testable shape I’ll post the jar so everyone can get a go at it.

Thanks for your patience!

4 Likes

Excellent news! waiting for it, thanks!

So I think I’ve finished support for GATT channels, but I don’t have any devices to test it with… Any recommendations on devices I could use?

I think the Xiaomi (Mijia) temperature and humidity sensor (the round one) is often used with the 3rd Party Bluetooth Binding (so I do also).

1 Like

Also one vote for the Xiaomi Mijia temperature and humidity sensor from me. I am using several ones still with the 3rd party Bluetooth Binding. I could also offer to send you one sensor for testing if this helps.

1 Like

What library are you relying on ? Still TinyB ?

I still use TinyB. Can’t wait to switch over to your new dbus binding though.

Ok, I think I’ve got gatt support working. There still seems to be a few hickups with installing the binding since it requires the same apache-commons-collections dependency as the 3rd party binding.
But if you don’t already have that dependency installed you can install it by running the following in the openhap-cli:

bundle:install -s https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar

Here is latest bluetooth jar:
https://github.com/cpmeister/openhab-addons/raw/blind-engine-snapshots/org.openhab.binding.bluetooth-2.5.9.jar
You may notice that it is version 2.5.9, not 2.5.10-SNAPSHOT, which is due to my current build environment being out of date. Just make sure to uninstall openhab’s built-in bluetooth bundle using bundle:uninstall <bundleNumber> in the console before trying to run this new one.

Also here are the latest bluez and bluegiga bindings in case you run into some errors with the ones you already have installed. They are purely optional unless you run into problems.
https://github.com/cpmeister/openhab-addons/raw/blind-engine-snapshots/org.openhab.binding.bluetooth.bluegiga-2.5.9.jar

https://github.com/cpmeister/openhab-addons/raw/blind-engine-snapshots/org.openhab.binding.bluetooth.bluez-2.5.9.jar

Happy testing!

1 Like

Thanks for the offer, but I managed to get my tests working with my Govee temperature sensors (they are better used as beacons but they did have some services when you connect to them which is good enough for me to test with.

I’ve already created a binding for the Govee devices that should become available once the OH3 release goes out.

2 Likes

I just noticed a bug in the code that prevented the readable characteristics from auto-updating every 30 seconds. I just fixed it so you just need to redownload the bluetooth jar to get the changes.

Thanks for all the hard work on bringing the official bluetooth binding back from the dead!

I’m new to BLE and GATT but I’ve got a couple of Inkbird temperature & humidity sensors that I’d love to be able to read the details from in openhab. I’ve got a working blueZ (5.43) install on the RPi I’m running my openhab (2.5.9) install on and can connect and interrogate the sensors using bluetoothctl.

I’ve tried uninstalling the official bluetooth binding and adding the latest jars you posted above to my addons directory using the instructions above. However, whilst I can scan using the bluetooth binding and find the Inkbird temp sensors when I add them as a thing I still only see an RSSI channel.

Can you provide any more detail about what I should see when I add a device from the inbox as a thing? Is the expectation that I should be getting one channel per characteristic? Is there a config file somewhere to add the GATT characterists or should it just detect all that are available?

Thanks in advance for your help and great work on the binding!

If you only see the rssi channel then that means that your device was created as a beacon type. Try creating your device manually as a connected thing type instead. If it didn’t show up as a connected type during discovery then it means either it can’t be connected to or there was some other issue.

If after creating the connected type the device refuses to go online then I suspect that either your temperature sensors really are just beacons (which means that they broadcast their data through discovery advertisements, not through connections), or your device has some special protocol that I haven’t written support for yet.

Hi Connor,

Thanks for the rapid reply. The device does appear as a connected device both in the inbox:
image

and when created in the list of things:
image

but when I look at the detail I see only RSSI:
image

From bluetoothctl I can connect and explore the characteristics:
[sps]# list-attributes 49:42:06:00:00:8D
Primary Service
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f
0000fff0-0000-1000-8000-00805f9b34fb
Unknown
Characteristic
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f/char0039
0000fff9-0000-1000-8000-00805f9b34fb
Unknown
Descriptor
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f/char0039/desc003b
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f/char0036
0000fff8-0000-1000-8000-00805f9b34fb
Unknown
Descriptor
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f/char0036/desc0038
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
Characteristic
/org/bluez/hci0/dev_49_42_06_00_00_8D/service001f/char0033
0000fff7-0000-1000-8000-00805f9b34fb
Unknown

I’m actually wondering if I’m picking up your binding correctly. Any tips on how I confirm that I definitely have your binding loaded correctly?