[RELEASE] BLE (Beacon) Gateway Manager

I added support for AltBeacon and EddyStone-UID beacons. I also added a power, rssi, and distance attribute to each beacon. Distance is calculated in feet and is an estimation.

2 Likes

So I did my first test today. Put a RadBeacon USB in one vehicle and a Blue Charms USB in the other. Set Hubitat rule to open the correct garage door when the vehicle arrives (not using distance setting). Started the car (in the garage) and door automatically opened within 5 seconds (good safety feature, normally I would open the door before starting the car, but just wanted to see what happened). Pulled out and closed door manually, then drove down the block and came back. As soon as I turned into the driveway and approached the door, the correct door opened. Tried with the other vehicle, worked exactly the same.

I did try closing the door automatically when leaving, but that got scary when the I pulled out and then the door closed immediately. Must have thought the beacon left and started to close the door. I guess I could put a delay on it, but I would NOT want the door to start closing when the car is still pulling out (or in). So I just set a rule to automatically close both doors if we are not home or at 10pm (if not home).

Just wanted to share. :slight_smile:

2 Likes

Excellent, congrats on your results! Can you remind me where you have your gateway mounted in the garage? Center front-to-back and side-to-side, or even closer to the font of the garage?

I don't like using automations for closing garage doors myself. I haven't and won't. Just too much concern about problems occurring, as I am involved in the process of setting them up. :slight_smile:

1 Like

Esphome works primarily with home assistant. ESPhome devices can also communicate via MQTT so you should be able to use it directly with HE using one of the community written MQTT apps.

I mounted it above one of my openers, near my Meross garage door home automation device. I’ve noticed the gateway will pickup lots of beacons. Honestly, I think as cars drive by my house (and that’s 90 feet from the street), it picks up their Bluetooth devices. This is why I recently made a change to clear out the beacon state for devices detected by the gateway, but weren’t added by the user and no longer present. It was building a huge list of beacon data and keeping them all in the app state (haha).

1 Like

I am selling a couple of the BLE gateways listed in the first message. I tried to get them working, but decided it was just too difficult using a MAC. Here is a link to the listing.

Thanks for posting. I only needed one for my use case, but perhaps others may want them. I found that one gateway can detect beacons with a pretty decent radius, esp. the USB ones.

1 Like

Yeah, I had hoped they would work for me. I noticed that I could never get DHCP working with them. They refuse to get the addresses I reserved for them. I even tried creating a reservation for the address they got, but they just pick another address. Weird.

1 Like

Replied on your for sale thread, I'll take one.

Blue Charm beacon also on order.

I'm all in.

Hey, @ajardolino3, thanks again for this integration.

Installed from HPM, and I have my hardware (April BLE gateway and Charm beacon) in hand and have things setup, but the HE Gateway app can't find my beacon.

Gateway is setup per your instructions, virtual BLE device added to devices and selected in the app. Charm is broadcasting (verified on my phone) but the app can't seem to find the charm beacon.

Pics, so we'll know it happened. :slight_smile:

image

App:

Device:

Gateway settings:

Blue Charm beacon showing broadcasting from my phone:

Gateway info:

The gateway is about 3' away from the blue charm beacon.

I've reloaded the app page, and restarted the gateway, restarted the hub, unplugged and plugged the beacon. No change. What did I miss? :slight_smile:

I noticed in the gateway yo have it set it filter ibeacon only. Try removing that to allow all beacons. Then turn on debugging in both the April brother device and Ble gateway app, and then look at the logs. Can you post what you see in there?

1 Like

Also, remove the http;//x.x.x.x/ from the URI. It should start with “apps/” in the gateway. As per instructions: “ * URI: The url you copied, beginning with the word "apps" (e.g. apps/api/###/gateway?access-token=xxxxxxxx)”

I think that’s your problem.

1 Like

OMG... I only noticed this and missed/forgot to take a subset of it. :slight_smile:

That's all it took, I left the setting to filter for iBeacon only and it worked like a charm. :smiley:
Thanks!

Maybe for slower users like me ( :wink: ) you could include a reminder in the UI below about leaving out the http://###.

In any case, in spite of my lazy reading and thanks to your help, I'm up and running. Just did a test rule where I set a light to green when I'm present, purple when gone. Ran the rule and about 2m after I unplugged the BT beacon light changed to purple.

Awesome. Now I need to move the gateway to the garage and the iBeacon to the car, and give it a literal test-drive.

Very cool.

Haha, no worries. I’ll update the readme to make the documentation more clear. Glad it’s working for you. Let us know how it works with your vehicles. I have two vehicles/garage doors and the garage door opens as each vehicle pulls up every time. :slight_smile:

Wow...I had a fun time today. :wink:

Moved gateway to the garage ceiling, plugged in, and came back into the house.

Nothing works - gateway is inaccessible, presence not happening, can't access gateway from config software. What the heck! What did I screw up now!? Brought it back into the house, plugged in, nothing, looks dead. Oh man!

Then I wiggled the USB cable connector at the gateway...bingo, light comes on.

Turns out the included USB cable connector (on the gateway side) was bad. Wiggle it just slightly and the unit would lose power. Replaced the USB cable and up and running. :smiley: Happy ending...yay.

3 Likes

I want to use my phone like ibeacon via Beacon Simulator for Android
Beacon Simulator - Apps on Google Play

I created it on my Android smartphone and pressed the 'Add New beacon' button, but it doesn't appear.

But, What was created through the iPhone appears.
Beacon Simulator - Appstore

Could you help me?? pls :slight_smile:

Can you turn on debugging for the gateway manager device and app and check the logs and look at the payload being received by the gateway manager? It should show you all data being sent to the hub and then from the hub to the hubitat app.

Also, what type of beacon is the android simulator app broadcasting? See the documentation for supported beacon types.

2023-01-24 11:42:10.864 AMdebugParsed payload from Gateway: [beacons:[]]

app:892023-01-24 11:42:10.851 AMdebugSending payload to device: BLE Gateway, payload: {"v":1,"mid":3954,"time":5071,"ip":"192.168.86.46","mac":"************","rssi":-72}

app:892023-01-24 11:42:10.849 AMdebugPOST received from Gateway: {"v":1,"mid":3954,"time":5071,"ip":"192.168.86.46","mac":"************","rssi":-72}

android
KakaoTalk_20230124_113436370

ios

If the gateway device has debugging enabled, you should see your beacon broadcast and a debug log entry made like so:

[type:auto, mac:, rssi:-92, data:]

Since the parsed payload from gateway is returning “beacons []”, it means that no beacons are detected. You will see each beacon listed inside the square brackets in the parsed payload, too.

If you do not see it, it means the beacon is not broadcasting (or being detected by the gateway). You can try moving your phone closer to the gateway.

You can also go into the settings icon of the app. Any beacon detected that is actively broadcasting will show up in the application state data.

I would also make sure you configured your gateway using the recommended settings in the documentation.

Since it’s picking up your iPhone beacon app, that confirms the beacon and gateway is working. It must be something with your android device beacon simulator.

You may also wish to try changing the beacon type in your android beacon app. You can try eddystone-uid or AltBeacon and see if that works. It may be possible the app is not broadcasting the ibeacon data correctly.

Hope this helps.

ibeacon made by iphone

2023-01-24 12:23:21.917 PMdebugbeacon ID: C856E7B0EE1E44F08E6696369593479E:0:0 present: true

app:892023-01-24 12:23:21.914 PMdebugiBeacon detected: uuid: C856E7B0EE1E44F08E6696369593479E, major: 0, minor: 0, power: -59, rssi: -37, distance: 0, dni: C856E7B0EE1E44F08E6696369593479E:0:0

app:892023-01-24 12:23:21.911 PMdebugParsed payload from Gateway: [beacons:[[type:auto, mac:************, rssi:-37, data:02011A1AFF4C000215C856E7B0EE1E44F08E6696369593479E00000000C5]]]

app:892023-01-24 12:23:21.897 PMdebugSending payload to device: BLE Gateway, payload: {"v":1,"mid":4092,"time":7542,"ip":"192.168.86.46","mac":"************","rssi":-73,"devices":[[0,"5193F4F0EFF8",-37,"02011A1AFF4C000215C856E7B0EE1E44F08E6696369593479E00000000C5"]]}

app:892023-01-24 12:23:21.895 PMdebugPOST received from Gateway: {"v":1,"mid":4092,"time":7542,"ip":"192.168.86.46","mac":"************","rssi":-73,"devices":

2023-01-24 12:23:21.903 PMdebug[type:auto, mac:************, rssi:-37, data:02011A1AFF4C000215C856E7B0EE1E44F08E6696369593479E00000000C5]

eddystone-uid, AltBeaconmade made by android but, not working like ibeacon.
Is this an Android problem?