@xgon These devices are treated as beacons, so you should see their RSSI channel being updated and indicating you the range.
The ONLINE/OFFLINE information of the Thing is instead rather meant as a mechanism to hint at problems - if a Thing goes OFFLINE, it means that it doesn’t work as expected anymore, because there is some problem. For beacons, this is not the case as it is a completely normal and expected situation that they are out of range. You should thus use the RSSI channel for your logic.
After a reboot the bluetooth binding cannot be initialized, and I see this on the logs:
2018-08-23 20:38:56.116 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.eclipse.smarthome.binding.bluetooth.bluez.handler.BlueZBridgeHandler@1070e03': Cannot access BlueZ layer.
java.lang.IllegalStateException: Cannot access BlueZ layer.
at org.eclipse.smarthome.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:96) [216:org.eclipse.smarthome.binding.bluetooth.bluez:0.10.0.oh230]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]
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) [?:?]
Caused by: java.lang.RuntimeException: Error getting object manager client: Error calling StartServiceByName for org.bluez: Timeout was reached
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.eclipse.smarthome.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:87) ~[?:?]
... 10 more
2018-08-23 20:38:56.155 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while initializing handler of thing 'bluetooth:bluez:hci0': Cannot access BlueZ layer.
java.lang.IllegalStateException: Cannot access BlueZ layer.
at org.eclipse.smarthome.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:96) [216:org.eclipse.smarthome.binding.bluetooth.bluez:0.10.0.oh230]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]
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) [?:?]
Caused by: java.lang.RuntimeException: Error getting object manager client: Error calling StartServiceByName for org.bluez: Timeout was reached
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.eclipse.smarthome.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:87) ~[?:?]
... 10 more
2018-08-23 20:39:21.130 [ERROR] [rnal.discovery.BlueZDiscoveryService] - Failed to scan for Bluetooth devices: Error getting object manager client: Error calling StartServiceByName for org.bluez: Timeout was reached
And on the webgui:
It seems that bluez is not running… The service status says it’s dead:
sudo service bluetooth status
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:bluetoothd(8)
Seems a bit odd if working before, anything in the logs pointing to an error, or just the RSSI not reporting? I have a device or two that won’t show the RSSI but seem to work fine otherwise. Maybe a bug??
After a device being configured as a Thing, I was expecting to see RSSI changes when that device moves away and near of the openhab host (where the BT is installed).
I think I have the same issue. I live in a crowded apartment complex with lots of bluetooth devices in range. My inbox accumulates things and doesn’t delete them filling the inbox to 800+ devices and counting. A few new devices are discovered every minute.
That issue is resolved in the new version of 3rd party binding, you may disable background discovery to stop adding bt devices into your inbox while still adapters in discovery mode.