Revival of Official Bluetooth Binding

Is there something what I can debug to verify if beacon is visible?

Has anyone been able to successfully pair the Raspberry Pi Bluetooth to OpenHAB as a controller? I still can’t seem to get it when scanning for new Bluetooth devices. Can it be added manually?

Guys, checked latest binding, still no success with any data from connected devices, only RSSI…(( I’m using BLE Xiaomi humidity&temperature sensors flashed with custom firmware. Continue using ESP32 bridge to MPPT to get those…

I did not get bluetooth working well untill i upgraded to the brandnew openhab v3.
Am using debian x86 and tried downgrading to bluez 5.43 and 5.47.
I am now on bluez 5.50 and openhab v3, and got my three am43’s working like a charm by just updating bluez and openhab to v3.

I too have got 2 am43 that I intend to connect with OH for my home automation. May I ask you to explain in detail how you got them working? Assume I am an idiot. Both my am43 blind motors are still in the box, although I tried once with OH 2.5 and I just could not get it working.

much thanks, and compliments of the season!

The problem is i don’t know what i exactly did, since i tried a lot and only started working after upgrading to openhab v3. I don’t know what you are running, i assume it is debian linux.
If you are running a raspberry there probably is a bluetooth howto on the internet.

But here is what i think you should do:

  1. Make sure your usb bluetooth is supported by linux.

  2. Install bluez if not installed.
    There is a lot of info to downgrade bluez to a version betweer 5.43 and 5.47. This is not necesary anymore with openhab v3.
    Try this manual:
    Bluetooth on Debian or Ubuntu - Some Dude Says

  3. Follow this manual to configure for openhab:
    Bluetooth BlueZ Adapter - Bindings | openHAB

  4. I would backup your current openhab config.

  5. Upgrade to openhab v3.
    Guide: Installing and testing OH3 snapshots/milestones using APT and YUM

  6. Add the bluetooth binding using the UI if not already there.

  7. I already did a manual setup with openhab v2.xx which is a hassle, and openhab v3 picked it up just fine, but openhab 3 should just autodiscover the am43.

2 Likes

Thank you. My current OH2 is a docker container in ubuntu. Wish me luck! :slight_smile:

Hi Connor,
hope you’re well…

May I ask you if you made some progress regarding the “received broadcast” stuff?

I’ve received another set of Bluetooth thermometers to be re-flashed with ATC firmware and uncertain if I should integrate them via a Python-to-MQTT-script approach or if could wait for getting it work with the Bluetooth binding (What I would prefer of course :wink: )

I’m still a ways off from getting the received broadcast feature implemented, but it is definitely something that I will tackle since I just bought some bluetooth devices that require listening in on their broadcasts. I think that such a feature is at least a month away from getting finished though.

For now my most pressing issue will be improving bluetooth discovery since it is annoying the crap out of me right now since I just finish setting up my new OH 3 system.

4 Likes

for those who have xiaomi bluetooth temp V1 (MJ_HT_V1). I’ve created an simple script to read gatt values from device and publish them to an MQTT thing on mosquitto server. (openhabian on raspberry). Hope the bluetooth binding is fixed soon, but meanwhile we can read values with this workaround.

sometimes the script gives an error (don’t know why) but most of times works great.

Just replace AA:BB:CC:DD:EE:FF with you mijia bluetooth ID device and schedule it on cron or on a periodic rule (by example: executeCommandLine("/etc/openhab/scripts/mijia_temp_read.sh") )

#!/usr/bin/bash
bt=$(timeout 20 gatttool -b AA:BB:CC:DD:EE:FF --char-write-req --handle=‘0x10’ --value=“0100” --listen| grep “Notification handle” -m 2)
if [ -z “$bt” ]
then
echo “The reading failed”
else
echo “Got data”
echo $bt
temp=$(echo $bt | tail -1 | grep -oP ‘value: \K.’ | xxd -r -p | cut -f 1 -d" " | cut -f 2 -d"=")
humid=$(echo $bt | tail -1 | grep -oP 'value: \K.
’ | xxd -r -p | cut -f 2 -d" " | cut -f 2 -d"=" | tr -d ‘\0’)

mosquitto_pub -h 127.0.0.1 -t “Temperature_device/Temperature” -m $temp
mosquitto_pub -h 127.0.0.1 -t “Temperature_device/Humidity” -m $humid

echo $temp “-” $humid
fi

1 Like

Hi,

Any updates regarding connection modes?

There is already a PR for the connection modes that is just waiting for approval.

1 Like

Has anyone tested with Tile beacon? I’m using bluegiga dongle - tried with beacon-mode and when I add RSSI channel it shows offline

Edit:
During scan with bluegiga I’m getting;

2021-03-01 23:42:33.874 [ERROR] [com.github.hypfvieh.DbusHelper ] - Critical error while reading DBUS response (maybe no bluetoothd daemon running?)
org.freedesktop.dbus.errors.ServiceUnknown: The name org.bluez was not provided by any .service files

Does bluez needed for bluegiga dongle?

Any ideas? Is it proper?

Does this also support airthings wave mini?

Hi all,
First time I’m trying to connect a Bluetooth device to my system and I’m having a bit trouble, I think I’m missing something.
I’m running OH 3.0.1 on RPi4 (with openhabian).

I have an iTAG device (on of those anti lost beacons) and from what I read it’s supposed to implement GATT protocol, so I tried adding it as the generic device that exposes GATT. The one described in this link:

First I defined a bridge thing, which is the BlueZ interface because I don’t have any BT stick at the moment.
For some reason I can’t find using the scan button so I tried adding it manually.
I can confirm that both the bridge is working properly because I successfully discovered and added my smartphone as a thing, and also that the iTAG is working because I successfully interacted with it through several BLE apps on my smartphone.

So I extracted its MAC from on of those BLE apps and entered in the thing configuration page. (MainUI).

After saving the thing status is OFFLINE with CONFIGURATION_ERROR saying it’s not associated with any bridge.
But the configuration page doesn’t have the field for selecting the bridge (see screenshot):

So my questions are:

  1. In case it’s a bug with the binding, where should I post it so it could be checked out?
  2. Is there a way to manually add the bridge configuration?
  3. Has anyone succeeded to work with those BLE tags on OH3 with the BT binding and can share about the process?

Thank you all for the time and effort.

1 Like

Hi,

@cpmeister - any news with connection modes?

hi,

I have 2 different Bluetooth devices and a handful of them in use. One is the Xiaomi Mi Flower and the other is the LYWSD03MMC temperature and humidity sensor. The Mi Flower is recognised when scanning, but as a beacon and therefore without sensor values. If I integrate it manually, a connection is briefly established, which also enters the channels, but then there is an error message and the sensor values are also interpreted incorrectly (the values are the same for all devices, so it probably takes the wrong hex value). What could be the reason for this, or are the sensors simply not yet implemented?

I have installed the ATC variant for the LYWSD03MMC, but as far as I understand it, the interpretation of broadcast has not yet been implemented. What is the status here? Will the devices also be found in future via the search function (if auto search is enabled)? Or do they always have to be added manually.

Thanks for the effort

Greetings Sebastian

1 Like

Hi,

I’m totally new to OH, my apologies if this isn’t the thread to ask this question.

I’ve successfully connected my pulse oximeter with the Bluetooth Binding and Generic Bluetooth Device extension, and I’m receiving data from it. However the data is in a hex format with extra info. I’ve been able to figure out which parts of the string I need.

How do I go about parsing the hex string in OpenHab or Bluetooth Binding, in order to display the correct parts of the string in decimal form on my dashboard?

Thanks, love the binding - implementing was pretty intuitive

1 Like

I think you can use javascript transformation on your item link via a link profile.
Doing so, you can use your (hex-) string input channel converted by javascript to some of your item’s data.

If you have to extract more than one value out of the provided hex string, you simply can create multiple item links to the same string channel with different transformation profiles.

Hope that helps :wink:

1 Like