Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

« Forrige Version 2 Næste »

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


Add BT Support in Ubuntu

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

sudo apt-get install bluez
sudo systemctl status bluetooth
? bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-01-23 18:27:43 UTC; 2 days ago
     Docs: man:bluetoothd(8)
 Main PID: 14880 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 3930)
   CGroup: /system.slice/bluetooth.service
           ??14880 /usr/lib/bluetooth/bluetoothd

Jan 23 18:27:43 robin systemd[1]: Starting Bluetooth service...
Jan 23 18:27:43 robin bluetoothd[14880]: Bluetooth daemon 5.48
Jan 23 18:27:43 robin bluetoothd[14880]: Starting SDP server
Jan 23 18:27:43 robin systemd[1]: Started Bluetooth service.
Jan 23 18:27:43 robin bluetoothd[14880]: Bluetooth management interface 1.14 initialized


Ok, so BT was up and running, and to make sure openHAB could use it:

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


Test discovery and functionality

A little testing of discovery etc:

root@robin:~# 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]#


Scan for devices:

[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 story is to follow https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding - You need to use a 3rd party 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..:





  • Ingen etiketter