Reliably detect I recently came within both GPS _and_ Bluetooth range

Hi, I want to trigger a SwitchBot bot attached to a gate buzzer when I leave home (out of GPS range) and then come back home (within GPS and Bluetooth range). The buzzer only buzzes for a few seconds, so the timing has to be just right with me getting basically right near the gate when I get "within" BT range.

My August lock does a good job of detecting I left home and came back home, auto-unlocking when that's the case. I could connect August to Hubitat to set up a trigger for what I want, but I believe when doing that natively with Z-Wave from the lock, it destroyed the batteries in my lock.

I only just learned about iBeacons and other similar BLE items. Using these or anything else, any good way to do this?

Alternatively, I could use returning within GPS + Wi-Fi to trigger the bot? I reliably get on Wi-Fi right as I walk up to the gate. Only false positive would be if I'm driving instead of walking, then the gate would buzz unnecessarily while I'm driving into the garage.

Can I somehow use the new HomeKit integration to trigger something when my phone "returns home"?

Alternatively, is there a weatherproof keypad I could use with Hubitat that can trigger SwitchBot?

You may want to look at the Bluetooth presence detection using things like Tile Mate or Nut devices. Not ideal to be messing around with Python scripts on a rpi, but an option nonetheless..

Switchbot has 2 keypads

And how would I connect them to Hubitat? Also without buying their lock.

This is a newer Bluetooth integration - does require purchase of a gateway:

1 Like

I think you're going to have a really hard time getting this to work using presence detection if you only have a few seconds of slop before the press gets invalidated.

If you went with a keypad would you be mounting it outside a gate, like in a public place? That seems problematic as well from a security/theft perspective.

I'd look for a way to trigger an automation from whichever dashboard you use. Then you can hit it when you know you are in position.

Yeah, I was looking at that! But I don't see a way to use my phone as the beacon with that gateway.

Yes, public/outside. I guess I'm not worried about theft, particularly since the keypad shouldn't be that expensive. I would want to make sure from a security perspective that there's a lockout mechanism after enough wrong attempts. I think of it similar to garage keypads. No idea what sort of security they offer.

So I already have multiple approaches to pressing the virtual button to buzz the gate on my phone: widget, app, Siri, Alexa, and more. But two issues:

  1. They're kind of slow/clunky to do unless I remember to do it 10 seconds before getting to the gate.
  2. My phone joins Wi-Fi outside the apartment, but it's through a lot of material and a super weak signal. So they when I buzz the gate right outside of it, it can be super unreliable.

This is all just me striving for slightly more convenience. I actually had a working prototype using just BT presence on HA a few years ago, but it wasn't good enough. Wondered a) if the state of the art was better now, and b) if I could do anything good with Hubitat. Or even combining Hubitat and HA, perhaps BT presence through HA + GPS and Wi-Fi presence through Hubitat. Reducing false positives is key. If I walk by when I don't mean to enter, that's one thing. But if I'm already home and say restart my phone, don't want the gate buzzing.

I have the same issue when I walk away from my house to check the mail. I usually hope that I'll get a cloud connection, but it can take a while for my wifi to let go of the connection and my phone to time out.

Can you adjust your wifi signal strength or directionality to try to make sure you stay on cloud on your approach instead of picking up an iffy wifi connection?



The issue I have seen with BLE beacons is that they broadcast intermittently and the period between broadcasts usually isn't configurable. And the gateway that is scanning for them is also sort of async from the broadcast, so you might have a lag of one or more broadcast periods.

Even with all of that, BLE beacons are usually still good enough for presence in general, but it isn't deterministic enough if the automation you're triggering with it needs to be accurate within a couple of seconds like your button push requires.

I have been using the BLE gateway integration mentioned above for several months now. It very reliably o-ens the garage door when we arrive home. Use a radbeacon mini-usb device in the car - works great. Transmits much more reliably than trying to use your phone and trying to rely on connections like WiFi.

1 Like

Interesting concept! I have eero for wi-fi and don’t think I can do that, unfortunately.

Thanks for chiming in, and glad it’s working so well for you. Read your thread and loved it.

Thing is I want things to happen when walking back home, so using my phone as a beacon is one of the more likely possible options and USB isn’t.

There is an app called locative, which you can install on your phone and then send a command using maker api to your hub to trigger an event. That may work for you.

And FYI, it's iPhone only, AFAIK.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.