3rd Party Bluetooth Binding. Beta testers needed

bluetooth
binding
Tags: #<Tag:0x00007fd312e548a8> #<Tag:0x00007fd312e54768>

(Alexandr) #342

I bought my Redmond kettle RK-G200S at Ozon.
I will try to do my best. But my knowleges is not so good.


(Vlad Kolotov) #343

@frest, Could you also please share your log file, that part that says “discovery error”?


(frest) #344

Yes, I am using version 5.47 of bluez, systemctl is not working on my synology. Can I check it using another command?

I will post my log later. Thanks for helping!


(Vlad Kolotov) #345

Hey @fres, can you please check what bluetoothctl says?

sudo -u openhab bluetoothctl

(frest) #346

This issue is about Yeelink. Yeelight is another company (see yeelight.com), and part of Xiaomi. All Yeelight lamps and bulbs are using wifi, only the portable Yeelight candela and the Yeelight bedside lamp is using BLE.

This link could help:


(frest) #347

Here is the logfile:

 2018-03-16 21:29:50.520 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Device discovery job error
java.lang.RuntimeException: Error getting object manager client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.197" (uid=1030 pid=25190 comm="/var/packages/Java8/target/j2sdk-image/jre/bin/jav") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.2" (uid=0 pid=3233 comm="/usr/sbin/bluetoothd ")
	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredDevices(TinyBFactory.java:166) [281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.discoverDevices(BluetoothManagerImpl.java:668) [282:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.run(BluetoothManagerImpl.java:661) [282:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

(Vlad Kolotov) #348

Hi @frest, this error definitely means that your “openhab” user can’t access Bluez through DBus. You will need to add “openhab” user into “lp” group (sudo adduser openhab lp), or add the following in the /etc/dbus-1/system.d/bluetooth.conf file:

<policy user="openhab">
    <allow send_destination="org.bluez"/>
  </policy>

If you are adding openhap user in the ‘lp’ group, make sure you have this in your ‘/etc/dbus-1/system.d/bluetooth.conf’ file:

<policy group="lp">
    <allow send_destination="org.bluez"/>
  </policy>

In order to validate that openhab has permissions needed you can run this:

sudo -u openhab bluetoothctl

(frest) #349

I get the following error (already edited the bluetooth.conf):

process 6231: arguments to dbus_connection_get_object_path_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5904.
This is normally a bug in some application using the D-Bus library.
  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted

I also have a new error in OpenHab:

2018-03-16 22:59:44.711 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Device discovery job error
java.lang.RuntimeException: Error getting object manager client: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method "GetManagedObjects" with signature "" on interface "org.freedesktop.DBus.ObjectManager" doesn't exist

	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredDevices(TinyBFactory.java:166) [281:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.discoverDevices(BluetoothManagerImpl.java:668) [282:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.run(BluetoothManagerImpl.java:661) [282:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

(Vlad Kolotov) #350

Hi @frest, yeah, I’m afraid you will need to solve your issue with Bluez first. Not sure if I can help you with that. Just make sure that ‘bluetoothctl’ works properly, this most likely would mean that the binging works correctly as well.


(Vlad Kolotov) #351

Looks like that new iTag might have more issues than the previous one. It turns out that it shuts down itself after a while if it is not connected. I’ll do some more experiments, but if it is true, then this tag can’t be used for the presence detection at all… This is probably what you are experiencing @Celaeno1 with your tag. I’ll keep you posted…

cc @curlyel, @Celaeno1


(frest) #352

Yes, it seems to be a problem with dbus an bluez on the synology nas. I am getting this error, if i run bluetoothd:

bluetoothd
D-Bus setup failed: Failed to connect to socket /opt/var/run/dbus/system_bus_socket: No such file or directory

Does anyone know how to go on?


(Alexandr) #353

Hi @frest,
I think the answer is here.


(Constantinos Contis) #354

@vkolotov i can get this bt beacon .Can i use it for presence detector with ur binding?


(Vlad Kolotov) #355

hi @Constantinos_Contis, please hold off buying those cheap Chinese trackers. I am working with them at the moment, trying to make them work as they are supposed to work, but it looks like they are too dodgy (some of them turn off if not connected, some of them annoy you with beeping when out of range). I’m also getting another brand of those cheap trackers - “nut 2”, will see how it goes.


(Oliver) #356

Hi Vlad,

many thanks for your efforts, the binding works quite smoothly for me. No issue so far, all BT devices were discovered and work stable so far. I first struggled using the wrong Bluez version, missed to read the documentation properly. I use Openhabian on a Raspi 3B.

Cheers, Olli


(Fredrik Andersson) #357

I’m using nut mini. Not that cheap maybe. But they wont turn off, even if they are not paired. Using them with your great binding!


(Vlad Kolotov) #358

Hi @Fredrik_Andersson, could you please confirm what version of “Nut” tracker are you using? Is it “Nut 2”, “Nut mini” or “Nut 3”? Thanks.


(Fredrik Andersson) #359

Im using nut mini. It works.
Nut 3 needs pairing, i have tried.


(Vlad Kolotov) #360

I’ve received “Nut 2” tracking device from aliexpress, unfortunately it cannot be used for presence detection with the binding because it turns off itself after 1 min or so.

I looked at the official app, it performs OAuth authentication for the devices in order to allow them to be connected. It looks like you have to be registered and authenticated with the app (via their Nut online services) in order to establish a connection to a Nut device.

As per their description in the app, “Nut mini” is used for 1-way tracking (eg. to track luggage etc, no button), I assume it always stays on, therefore the “mini” version can be used for presence detection.

To sum up what tags that are tested and can be used for presence detection:

Tags that cannot be used to detect presence:

I’m sure there are some other tracking devices that can be used for presence detection, please report if you know any. I’ll try to test some other devices like Tile and other cheap Chinese clones from aliexpress, I’ll keep you posted.


(Pim Verschueren) #361

Hi Vlad, I tried to install the bindings again yesterday but it immediately crashed my openhab again. I was doing this remotely so I couldn’t retrieve the logs. I will try again when I am back home next week.
I’ve bought this tag (Key Finder, Mokiro GPS Tracker Bluetooth Anti-lost Location Tracker Two-way ) from amazon, and it works well. I am going to try to use it for my presence rules later on.