3rd Party Bluetooth Binding. Beta testers needed

It’s a security “feature” of recently mobile OS’es. IOS does this, and i think recent Android versions also does this.

@vkolotov Thank you for this binding.
As you said bluez version 5.47 solved my problems but some GATT profiles were still not available for me.
Now for the suggestions:
As most mobile OS’s generate fake mac id’s it would be great to look for service UUID’s instead of mac address. May be as an advanced setting. This way, even iOS presence can work without any apps at all!
Also i would like to point out that in order for the presence detection to work (without pairing), discovery option must be turned on. Which automatically sends all mac adresses to inbox. I’m living on a main street and buses come and go front of my apartment so my inbox showed litterally hundreds of items :slight_smile: It would be great to have an option to have discovery running but the newly discovered items not get sended straight into inbox.

BTW i have a flower care which sends some sensor info about pot plants. How can i create a custom profile for it? If you point me in the right direction that would be great!

Hmm… I did not know about this new superb useful feature (to dynamically allocate MAC addresses)…

I’m afraid it is not going to work simply because all you have to be connected (or a device should advertise UUIDs).

There is a bug that causes this: Discovered bluetooth devices get accumulated in the inbox even if they are not in range anymore · Issue #5 · sputnikdev/eclipse-smarthome-bluetooth-binding · GitHub
It will be fixed in the next release.

Thanks for reporting this. Could you please let me know what GATT profiles are not available for you?

Hi @Celaeno1, sorry to hear that it is not working for you. As @sozkara pointed out earlier it might be a new security feature. What phone do you have @Celaeno1? I may also suggest you to try to use a real bluetooth beacon / keyfob / keytag for $5 on aliexpress to track your presence.

Unfortunately I copy - pasted the log entries but i couldn’t find it :frowning: I will send it to you once i reconfigure openhab.

I think all devices announce their “Device” UUID’s even if they’re not connectable and has no service. I found about this when i installed an app called “BLE Scan Raw” on my iPhone. If you have time take a look at that app. It reports every BLE device’s last 4 digits of Device UUID’s and RSSi. Which is enough for presence. OFC, if this can be implemented on bluez and java is another question :slight_smile:

Yes, it is possible to access advertising data. However, I’m pretty sure that not all (actually only a few) devices advertise something. But… If you can make your iphone advertise something specific via an app… yep it might be a good idea.

Well, i can see my iPhone device uuid and rssi without any app running on phone and phone sleeping (not paired). 9EC7 being my phone’s device UUID last 4 digits. I’m attaching a screenshot. I’ll report back if this is true with android also when i get my hands on an android phone. This is of course with BLE.

Hi, I installed bluetooh binding on my raspberry hopenhab2.

I can see the devices comet-blue-eurotronic

But I can’t find the way to get the data you say:

  • Comprehensive support for Bluetooth Low Energy (Bluetooth Smart) devices. If a bluetooth device supports the Bluetooth specification 4.0, then the standard GATT services and characteristics can be automatically recognized and corresponding thing channels be created for each GATT characteristic and its GATT fields. This feature allows you to connect Bluetooth Smart sensors and other bluetooth devices.

  • Custom built (non-standard) BLE Bluetooth devices support. A custom built bluetooth device can be automatically recognized like a standard one by specifying a folder on the system disk with custom GATT service and characteristic definitions in XML files.

Can I see some exemple of XML files?
Can you help me to write the the XML files?

I can expose to internet my raspberry if you will test the devices. (IPV6 only)

Matteo

Hi everyone, I’ve updated the main post with the roadmap so you know where this project is heading to.

Hi @matteopedani, thank you for your interest in this project. I’ve updated your issue on github with some basic instructions: Add support for Smart Radiator Thermostat - comet-blue-eurotronic · Issue #14 · sputnikdev/eclipse-smarthome-bluetooth-binding · GitHub

Adding support for your device is on the roadmap of this project. I’ll jump on it as soon as I complete the items in the priority list (readmap) that go before your ticket.

Hi @sozkara, I believe your idea to map iphone devices (or any other devices that dynamically allocate MAC addresses) via some advertizements packets is quite viable. I’ve added this feature to the roadmap: 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

1 Like

Great! I’m looking forward to test it :slight_smile:

How i can stop adding new things to Inbox? now it’s smth like 400+ and value growing(
cause after 7-8 hours CPU is over 95% and i should turn of Discovery controll, manually remove all strange bt devices in inbox and then CPU goes to it’s normal state

Hi @None_No, sorry to hear that it causes some issue for you. It is a know bug that I’m working on. Unfortunately this bug is caused by TinyB library, I’m going to create a pull request for an improvement in TinyB that should potentially help to resolve our issue. I’ll keep you posted.

Hi,
I installed the binding from the marketplace on my OH machine (Debian) and it successfuly discovered the adapter and my BLE “weather station” Oregon RAR213HG.
However weather station thing is always OFFLINE and it does have only generic channels, no channels for temperature neither humidity. Also when I tried to change some settings in adapter thing I received 500 with such logs:

2018-01-23 20:03:20.954 [WARN ] [.core.thing.binding.BaseThingHandler] - Error while applying configuration changes: 'IllegalArgumentException: Provider for thing bluetooth:ble:ED8914A1503A cannot be determined because it is not known to the registry' - reverting configuration changes on thing 'bluetooth:ble:ED8914A1503A'.
2018-01-23 20:03:20.972 [ERROR] [ome.io.rest.core.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/bluetooth:ble:ED8914A1503A/config' for thing 'bluetooth:ble:ED8914A1503A': Provider for thing bluetooth:ble:ED8914A1503A cannot be determined because it is not known to the registry

First I would like to have this weather station online (if it does matter) and add to it some channels (temperature, humidity). I assume the binding needs to know GATT specification of the device. I am happy to help creating required files, just tell me what to do.

Hi @druciak, I’m happy to help you. Could you please share OH logs so I can understand what’s happening there. Also could you please let me know:
- version of OpenHab
- OS type
- what BT transport are you using (what bluetooth adapter type? BlueGiga or generic USB?)
- if you are running Linux and a generic USB adapter, let me know Bluez version as well

Thanks,
Vlad

Regarding my previous post, I was changing the station thing and got the error, but when I tried one more time I succeeded. Moreover when I changed adapter for this thing to preferred one, it shows as ONLINE. :slight_smile:

Unfortunately when I linked some generic channels (Model, HW revision, Manufacturer, Battery level, RSSI) I only got valid data for RSSI.

Here are the details about my setup:

  • I am running Sept. snapshot of 2.2, but I am going to update to some 2.3 snapshot soon
  • on Debian Stretch
  • with generic bluetooth transport
  • using Bluez 5.43-2+deb9u1

BTW: currently I am using a Python script to get data from Bluez and push it using MQTT to OH.
I cannot find the source, but interesting info you can find also here.