Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

Topics

Indholdsfortegnelse


Advarsel

During another problem/trouble shooting I ran:

Kodeblok
sudo systemctl stop openhab2
sudo openhab-cli clean-cache
sudo systemctl start openhab2

That seems to remove the BT Bindings... but a reinstall fixed it (and no Things was lost)


As my openHAB installation is on a Laptop with Ubuntu 18-04 (Server, no UI) i knew that Bluetooth (BT) was somewhat avaliable.

...

The latter part being a problem I think. Do read these links: Bluetooth Technology Protecting Your Privacy and  MAC address randomization joins Apples heap of iOS 8.....

Tip

Theres a excellent community thread at https://community.openhab.org/t/3rd-party-bluetooth-binding-beta-testers-needed for this Binding


Add BT Support in Ubuntu

First discovery was that the Ubuntu OS had no BT installed, so we need to do this:

...

Kodeblok
sudo usermod -a -G bluetooth openhab
sudo systemctl daemon-reload
sudo systemctl restart bluetooth


Test discovery and functionality

A little testing of discovery etc:

...

Kodeblok
[bluetooth]# scan on
Discovery started
[CHG] Device 08:6D:41:E7:FF:7B RSSI: -79
[CHG] Device 08:6D:41:E7:FF:7B RSSI: -78
[CHG] Device 53:EA:0B:88:DC:13 RSSI: -75
[CHG] Device 53:EA:0B:88:DC:13 ManufacturerData Key: 0x004c
[CHG] Device 53:EA:0B:88:DC:13 ManufacturerData Value:
  0c 0e 08 f4 f0 09 f7 7f b0 f5 01 69 dd 37 b6 eb  ...........i.7..
[CHG] Device 53:EA:0B:88:DC:13 RSSI: -75
[CHG] Device 53:EA:0B:88:DC:13 ManufacturerData Key: 0x004c
[CHG] Device 53:EA:0B:88:DC:13 ManufacturerData Value:
  0c 0e 08 f5 f0 21 56 5b 46 b4 8c 0a 54 79 16 02  .....!V[F...Ty..
[CHG] Device 08:6D:41:E7:FF:7B RSSI: -78
[CHG] Device 53:EA:0B:88:DC:13 RSSI: -76
[CHG] Device 08:6D:41:E7:FF:7B RSSI: -81
[bluetooth]#
[CHG] Device 53:EA:0B:88:DC:13 RSSI: -78


Installing Addons in openHAB

OK - so we are ready for openHAB - the sort short story is to follow https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding - (remember to press "Save" in the Configuration → System → Market dialog (smil) ) You need to use a 3rd party BT binding that s not pr. default available in openHAB.

Follow the installation, and You should be running - this should be quite clear in the inbox, it should be populated with discovered devices..:


Managing BT Devices

This is actually where it gets tricky and I am partly stucked, as I am having a hard time pairing a lot (Yes, You have a lot of BT devices in Your home and the tip in the top Tip Box may play a part here ) and their MAC adresses to real physical devices.

...

UI Expand
titleLinux
Kodeblok
sudo bluetoothctl
[NEW] Controller F0:03:8C:61:7E:2E Bluetooth robin [default]
[NEW] Device 08:6D:41:E7:FF:7B 08-6D-41-E7-FF-7B
[NEW] Device 53:EA:0B:88:DC:13 53-EA-0B-88-DC-13
Agent registered
[CHG] Device 08:6D:41:E7:FF:7B RSSI: -79
[bluetooth]# list
Controller F0:03:8C:61:7E:2E Bluetooth robin [default]
[bluetooth]#
[bluetooth]# show
Controller F0:03:8C:61:7E:2E (public)
	Name: robin
	Alias: Bluetooth robin
	Class: 0x0000010c
	Powered: yes
	Discoverable: no
	Pairable: yes
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d0530
	Discovering: yes
[bluetooth]#
UI Expand
titleiOS Apps

Image Added

Image Added

Image Added

Info

What I do notice, it the the name of the devices is rarely present, and that the MAC address rarely matches the MAC addresses found in openHAB. That is currently an ongoing investigation. Any good clues here? Feel free to mail me at bnp@mos-eisley.dk or drop a comment

There are several lookup tools like https://macaddresschanger.com/bluetooth-mac-lookup that should help, but I find the reliability of them low... often my MACs are not resolved to a Vendor


A Thing in openHAB

A few samples of discovered BT Things in openHAB, its worth noticing that the capabilities can differ quite a lot - refer to Bluetooth on Wikipedia; currently the specs range from version 1 to 5:

Image RemovedImage Added