3rd Party Bluetooth Binding. Beta testers needed

Thank you @Pim_Verschueren, did you try to match the “Status” field with what your Kettle does? :slight_smile:

not yet…just moved over my openhab instance to a mini pc but it’s been challenging so I didn’t had the time to do anything else.

Hi!
I’ve installed the openHAB with bluetooth binding on my Raspberry Pi 3 with latest version of OSMC.
And I’m receiving the following errors:

2018-03-15 21:30:58.836 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Adapter 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.3034" (uid=112 pid=296 comm="/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=505 comm="/usr/libexec/bluetooth/bluetoothd ")
	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredAdapters(TinyBFactory.java:153) [229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.discoverAdapters(BluetoothManagerImpl.java:762) [230:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.run(BluetoothManagerImpl.java:755) [230: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:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
2018-03-15 21:30:58.846 [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.3035" (uid=112 pid=296 comm="/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=505 comm="/usr/libexec/bluetooth/bluetoothd ")
	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredDevices(TinyBFactory.java:166) [229:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.1.1]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.discoverDevices(BluetoothManagerImpl.java:668) [230:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.run(BluetoothManagerImpl.java:661) [230: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:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]

What did I do wrong?

Hi @Balaganov, most likely there is something wrong with DBus permissions (openhab user does not have permissions to access Bluez). Have you done these steps? https://github.com/sputnikdev/bluetooth-manager-tinyb#prerequisites

Im getting this now with the new update. Whats wrong? RPI3

2018-03-15 19:49:18.475 [ERROR] [ager.impl.CombinedDeviceGovernorImpl] - Execution error of a service resolved listener

java.lang.NullPointerException: null

	at org.sputnikdev.esh.binding.bluetooth.internal.CharacteristicChannelTypeProvider.buildChannelType(CharacteristicChannelTypeProvider.java:89) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.internal.CharacteristicChannelTypeProvider.lambda$getChannelType$0(CharacteristicChannelTypeProvider.java:63) ~[?:?]

	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.internal.CharacteristicChannelTypeProvider.getChannelType(CharacteristicChannelTypeProvider.java:62) ~[?:?]

	at org.eclipse.smarthome.core.thing.type.ChannelTypeRegistry.getChannelType(ChannelTypeRegistry.java:86) ~[?:?]

	at org.eclipse.smarthome.core.thing.type.ChannelTypeRegistry.getChannelType(ChannelTypeRegistry.java:71) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemProfileFactory.getSuggestedProfileTypeUID(SystemProfileFactory.java:117) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.CommunicationManager.determineProfileTypeUID(CommunicationManager.java:176) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.CommunicationManager.getProfile(CommunicationManager.java:140) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.CommunicationManager.lambda$11(CommunicationManager.java:332) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]

	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:?]

	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:?]

	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[?:?]

	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270) ~[?:?]

	at java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3566) ~[?:?]

	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:?]

	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]

	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]

	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.CommunicationManager.stateUpdated(CommunicationManager.java:329) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManager$1.stateUpdated(ThingManager.java:139) ~[?:?]

	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateState(BaseThingHandler.java:338) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothHandler.updateState(BluetoothHandler.java:108) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.GattChannelHandler.updateState(GattChannelHandler.java:177) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.GattChannelHandler.lambda$dataChanged$0(GattChannelHandler.java:117) ~[?:?]

	at java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.GattChannelHandler.dataChanged(GattChannelHandler.java:114) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.buildServiceHandler(BluetoothDeviceHandler.java:205) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.lambda$serviceDataChanged$7(BluetoothDeviceHandler.java:155) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]

	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:?]

	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) ~[?:?]

	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:?]

	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]

	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]

	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:?]

	at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.serviceDataChanged(BluetoothDeviceHandler.java:154) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.lambda$forEachSilently$3(BluetoothManagerUtils.java:82) ~[?:?]

	at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.forEachSilently(BluetoothManagerUtils.java:80) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.forEachSilently(BluetoothManagerUtils.java:63) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.CombinedDeviceGovernorImpl$DeviceGovernorHandler.serviceDataChanged(CombinedDeviceGovernorImpl.java:763) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl$ServiceDataNotification.lambda$notify$0(DeviceGovernorImpl.java:787) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.lambda$forEachSilently$2(BluetoothManagerUtils.java:71) ~[?:?]

	at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.forEachSilently(BluetoothManagerUtils.java:69) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.forEachSilently(BluetoothManagerUtils.java:56) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl$ServiceDataNotification.notify(DeviceGovernorImpl.java:786) ~[?:?]

	at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl$ServiceDataNotification.notify(DeviceGovernorImpl.java:781) ~[?:?]

	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBDevice.lambda$null$9(TinyBDevice.java:245) ~[?:?]

	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.lambda$notifySafely$0(TinyBFactory.java:228) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	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) [?:?]

Hi @Fredrik_Andersson, most likely this is due to some incompatibility between the current and previous version. Looks like your “thing” was added to OH with the old version, and the new version of the binding complains about it. Could you please remove your thing and add it back again and see if this resolves the issue? Please let me know how it goes, thanks.

This was the issue, thanks. I removed every item, including the adapter. Now I can add them again and the problem wont show…

Hi @vkolotov, yes i done these steps except step 9. I have no bluetooth group in my OSMC.

Just add it, or you could specify “openhab” user in the /etc/dbus-1/system.d/bluetooth.conf:

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

Please try and let me know how it goes.

I have this lines in bluetoth.conf:

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

And I added “openhab” user to the “lp” group. And now it works.
So I think your solution is working too.
Thanks!

For Redmond kettle you can use that script without any bindings.
But it need some changes.
Now I can turn my kettle on/off, get current temperature. But can’t keep warm.
It wiil be nice if @vkolotov will add Redmond.

any chance to get the new Yeelight Candela working? Its using BLE, and i can find it using bluez.

https://www.kickstarter.com/projects/1726969603/yeelight-candela-the-smart-mood-candlelight

noobie here,i installed from the market the Bluetooth Binding and the Bluetooth Binding TinyB Transport ,i added the “openhabian” bluetooth adapter (i am using a raspberry3/openhabian) and after that a lot of devices appeared in my inbox,BLE and Generic.I want to use my phone (nexus6) for presence detection so when i come home detect my phone and unlock the front door.I added my phone as a thing ,link all the channels and i noticed that it only come “online” only when its at bluetooth discovery mode.If i exit discovery mode or turn off my screen the phone goes offline at paperui.What am i missing?Do i need to pair somehow the adapter with my phone?

Another Question: I am running Openhab on a Synology NAS. I managed to install bluez 5 using entware-ng and opkg. The generic adapter is there, i can use hcitool, but the binding is not working. I think there must be something wrong with the bluez, I am getting a “Device discovery job error” in opehab.log

The command “bluez-simple-agent” does not work as well, “command not found”.

Hey @Balaganov, I was thinking to add support for Redmond appliances, but I could not find any local store that has any Redmond in stock. I believe it would be a good opportunity if you could help me to do so. I’ve created a ticket to track the progress: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/46

Hi @frest, yes, adding Yeelight support is on the roadmap: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/38. I’m working at the moment on this, so stay tuned.

Hi @Constantinos_Contis, this is a known issue of some modern mobile phones. Basically some mobile phones do not allow you to stay in the discoverable mode (e.g. it only switches to the discoverable mode when you are on the bluetooth settings). You could try to install a beacon app (lots of them in the app store) on your phone, that possible will make your phone stay in discoverable mode (actually it will make your mobile phone to advertise data packets). However, even this approach does not work for all because some mobile OSs change MAC address every so often in order to “protect” your privacy. When MAC address changes, the binding thinks that it is a new device. There is a ticket on my radar to implement a workaround for the dynamic MAC address: Implement a workaround for mobile phones (recent models of iphone and android) that dynamically allocate MAC addresses · Issue #17 · sputnikdev/eclipse-smarthome-bluetooth-binding · GitHub
I’m not quite sure when I’m going to start working on it, maybe next month.

However, If you still want to track you presence, there is another cheap way of doing so: eclipse-smarthome-bluetooth-binding/tags.md at master · sputnikdev/eclipse-smarthome-bluetooth-binding · GitHub

Hi @frest, lot’s of things can go wrong with Bluez. Can you please make sure you are running (and also set up permissions) a correct version of the Bluez as per this? https://github.com/sputnikdev/bluetooth-manager-tinyb#prerequisites

Hi @curlyel, @Celaeno1, I can confirm that an iTag device from the aliexpress seller that has been referenced by @curlyel has the ability to disable annoying alarm (Link Loss service). That item on the aliexpress basically is the most popular one with almost 1000 orders.

@Constantinos_Contis you might be interested in this as well (read the post above) ^^.