Revival of Official Bluetooth Binding

yep did that, still the same (( nothing but RSSI

Did it discover as a beacon thing or a connected thing?

connected

I don’t really have a good idea of what is going on then. I need more info in order to diagnose what might be wrong.
Please post the output of bundle:list.

Then in bash, run:

bluetoothctl
>connect <sensor mac address>
>list-attributes
>quit

and post the list of services and characteristics that the device has.

I ran bluetoothctl, here is the log:

Tried to connect, but not successful. Log says connected and suddenly after says connected: no

Currently my ESP32 running bridge from BLE to MQTT and MQTT sniffer reports the parameters and temperature, humidity and battery level is there, you can see it from screenshot.

after several attempts and disconnecting my bridge:

[CHG] Device A4:C1:38:D9:46:8A Connected: yes
Connection successful
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -78
[NEW] Primary Service
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0008
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
[NEW] Characteristic
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0008/char0009
00002a05-0000-1000-8000-00805f9b34fb
Service Changed
[NEW] Descriptor
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0008/char0009/desc000b
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0010
0000181a-0000-1000-8000-00805f9b34fb
Environmental Sensing
[NEW] Characteristic
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0010/char0011
00002a1f-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0010/char0011/desc0013
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Characteristic
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0010/char0014
00002a6f-0000-1000-8000-00805f9b34fb
Humidity
[NEW] Descriptor
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0010/char0014/desc0016
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[NEW] Primary Service
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0017
00010203-0405-0607-0809-0a0b0c0d1912
Vendor specific
[NEW] Characteristic
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0017/char0018
00010203-0405-0607-0809-0a0b0c0d2b12
Vendor specific
[NEW] Descriptor
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service0017/char0018/desc001a
00002901-0000-1000-8000-00805f9b34fb
Characteristic User Description
[NEW] Primary Service
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service001b
00001f10-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Characteristic
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service001b/char001c
00001f1f-0000-1000-8000-00805f9b34fb
Unknown
[NEW] Descriptor
/org/bluez/hci0/dev_A4_C1_38_D9_46_8A/service001b/char001c/desc001e
00002902-0000-1000-8000-00805f9b34fb
Client Characteristic Configuration
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 0000180f-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 00001f10-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:D9:46:8A UUIDs: 00010203-0405-0607-0809-0a0b0c0d1912
[CHG] Device A4:C1:38:D9:46:8A ServicesResolved: yes
[CHG] Device A4:C1:38:D9:46:8A Name: ATC
[CHG] Device A4:C1:38:D9:46:8A Alias: ATC
[CHG] Device 09:06:A5:9A:15:0C RSSI: -78
[CHG] Device A4:C1:38:D9:46:8A ServicesResolved: no
[CHG] Device A4:C1:38:D9:46:8A Connected: no
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -78
[CHG] Device A4:C1:38:7F:D3:D1 ServiceData Key: 0000181a-0000-1000-8000-00805f9b34fb
[CHG] Device A4:C1:38:7F:D3:D1 ServiceData Value:
a4 c1 38 7f d3 d1 01 01 36 44 0b 06 0a …8…6D…
[CHG] Device 09:06:A5:9A:15:0C RSSI: -75
[CHG] Device A4:C1:38:D9:46:8A RSSI: -72
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -78
[CHG] Device 09:06:A5:9A:15:0C RSSI: -71
[CHG] Device A4:C1:38:D9:46:8A RSSI: -73
[CHG] Device A4:C1:38:D9:46:8A Name: ATC_D9468A
[CHG] Device A4:C1:38:D9:46:8A Alias: ATC_D9468A
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -78
[bluetooth]# list-attributes
Invalid command in menu main: list-attributes

Use “help” for a list of available commands in a menu.
Use "menu " if you want to enter any submenu.
Use “back” if you want to return to menu main.
[CHG] Device 09:06:A5:9A:15:0C RSSI: -71
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -76
[bluetooth]# list-attributes
Invalid command in menu main: list-attributes

Use “help” for a list of available commands in a menu.
Use "menu " if you want to enter any submenu.
Use “back” if you want to return to menu main.
[CHG] Device 09:06:A5:9A:15:0C RSSI: -71
[CHG] Device A4:C1:38:D9:46:8A RSSI: -70
[NEW] Device 3D:1A:9F:C6:CC:7D 3D-1A-9F-C6-CC-7D
[CHG] Device 3D:1A:9F:C6:CC:7D RSSI: -71
[CHG] Device A4:C1:38:D9:46:8A RSSI: -70
[CHG] Device A4:C1:38:7F:D3:D1 RSSI: -81
[bluetooth]# exit
[17:49:55] root@openhab:~#

Ok, I don’t see anything unusual about the characteristics of your device. I might need to adjust the code to be a bit more flexible with unknown services and characteristics. I’ll post an updated jar as soon as I can.

1 Like

thanks bud, waiting to test it now with my RPI4 - it’s shockingly FAST!!!

After a couple of weeks I finally had a chance to get back and have another look at the Inkbird sensor I was trying to get to work.

A bit more web research reveals that for these sensors (Inkbird IBS-TH1, IBS-TH1 Mini & IBS-TH1+) all seem to use a custom characteristic for ‘live’ data (they are also dataloggers but getting at the logged data is more involved).

It seems there was a thread around supporting these in the (now broken) 3rd party bluetooth binding. Here for reference: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/60

The characteristic that gives live data is: 0000fff2-0000-1000-8000-00805f9b34fb

And the encoding is that the first two bytes are the temp in degrees C * 100 encoded as Little Endian UInt. The 2nd two bytes are the Humidity in %RH * 100 also a UINT16LE

Trying this out using gatttool I got:
[49:42:06:00:00:8D][LE]> char-read-uuid 0000fff2-0000-1000-8000-00805f9b34fb

handle: 0x0024 value: b1 07 c1 17 00 07 62

1st two bytes: temp in LE

B1 07 -> 1969 -> 19.69Celcius (which matched the 19.6C my IBS-TH1+ was displaying)

C1 17 -> 6081 -> 60.81%RH (which matched the 60.8% RH displayed)

@cpmeister- I know in your latest post you mentioned you were looking at a way to deal with custom characteristics. Is there any chance that you can provide a way to allow us to configure a channel that simply passes through the raw data from a characteristic? That way I could configure this characteristic and break it up into temp/humidity and perform appropriate updates of items in openHAB rules.

From more web reading it appears people are using these sensors with openHAB but by using the exec binding to run gatttool to pull the data back but providing the ability to define a channel linked to a custom characteristic in the bluetooth binding may be cleaner. That would allow people to provide some level of integration for BLE devices that don’t use only standard characteristics.

Have you looked at GitHub - hypfvieh/bluez-dbus: bluetooth library for linux OSes using DBus and bluez (http://www.bluez.org/).? I come across it just recently and found it is usable (for others, not me). I also managed to get underlying library dbus-java working without dependency to old libmatthew for unixsocket and switched to jnr-ffi with very, very thin jni layer supported for much more CPU architectures:

@splatch this is the library we use in the new binding, which is really closed to the release thanks to the help of @cpmeister !

–> https://github.com/openhab/openhab-addons/pull/8819

I’ll get to work on it.

i cant make it work with the new jars,i cant even get a beacon when i search in my inbox.I see that i have Bluez 5.50 to my openhabian,is that the reason cant make it work?How can i downgrade to 5.43 ?

Do you see any errors in the logs?

nope ,no errors.I did not have any bluetooth binding,i installed/copy the 2 jars(binding and bluez 2.59) in the addons folder,no errors in logs,normal instalation but i get nothing in my paperui inbox

[06:40:59] openhabian@openhab:~$ sudo systemctl status bluetooth
[sudo] password for openhabian:
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-10-23 14:50:37 EEST; 15h ago
     Docs: man:bluetoothd(8)
 Main PID: 514 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 2184)
   CGroup: /system.slice/bluetooth.service
           └─514 /usr/lib/bluetooth/bluetoothd

Oct 23 14:50:35 openhab systemd[1]: Starting Bluetooth service...
Oct 23 14:50:37 openhab bluetoothd[514]: Bluetooth daemon 5.50
Oct 23 14:50:37 openhab systemd[1]: Started Bluetooth service.
Oct 23 14:50:37 openhab bluetoothd[514]: Starting SDP server
Oct 23 14:50:38 openhab bluetoothd[514]: Bluetooth management interface 1.14 initialized
Oct 23 14:50:38 openhab bluetoothd[514]: Sap driver initialization failed.
Oct 23 14:50:38 openhab bluetoothd[514]: sap-server: Operation not permitted (1)
Oct 23 14:50:38 openhab bluetoothd[514]: Failed to set privacy: Rejected (0x0b)

Before you can discover bluetooth devices you need to first discover your bluetooth adapters. Did you try running bluetooth discovery manually in OH yet?

no adapter discovered at paperui i will try manually

when i give

[bluetooth]# list

no controler shows up

Did you start the dbus service?

yes,dbus active and running

Try running sudo bluetoothctl to check for any adapters.
If that fails then try sudo systemctl start hciuart