Turn your spare Android phone into an ESPHome bluetooth proxy -- extend/adding bluetooth support to your home assistant!

I built a small Android app that turns an Android phone into a fully functional ESPHome-compatible Bluetooth proxy so your devices keep reporting to Home Assistant even when you walk out of the house.

Background

After I released DJTPMS (a tyre-pressure monitor) and my Homeassistant Kawasaki Rideology BLE integration, I found a huge limitation, once I left the house the devices stopped reporting to Home Assistant. So I built a small Android app that turns any spare Android phone into an ESPHome-compatible Bluetooth proxy. it forwards BLE advertisements, supports GATT and native pairing (PIN/passkey), and works in foreground, background, and even on the lock screen.

Watch the demo: YouTube: COwJ1JocbVc
Grab the APK and source on GitHub: Zen3515/homeassistant-mobile-ble-proxy.
While I use wireguard vpn to connect back to home assistant, you can use it at home too.

Give it a try and may your old phone be useful again!

That… that is so cool.

How do I configure the app to connect to my HA server when not home?
I can’t find any settings for that.

Hello, the way I accomplished this is with VPN, specifically wireguard. Since this proxy is another app on the phone, vpn is also another app on the phone.

If you’re not familiar with vpn, it’s another rabbit hole to go into.

If you decided to go down the rabbit hole, here’s what I’ve been doing.

  • I setup wireguard for my home
  • I allow the firewall to let connection from my HA subnet to my phone VPN
  • I setup mDNS repeater between HA and my phone (with firewall to limit to just the phone)
  • In the app I use only the VPN for mDNS config.

But for simplicity, I think you can just use VPN and don’t care about the mDNS it will take a couple of second longer for HA to discover your phone over VPN, oh, and when adding it to homeassistant for the first time, you will have to input your phone vpn ip manually. Sine the whole point of mDNS is for discovery and fast connection after toggle the proxy on.

Here is how I got it to work with Tailscale:

  1. Install the Tailscale HA App from the settings.
  2. Disable "Userspace networking mode" in the Tailscale HA App Configuration tab
  3. Start the app and authenticate with Tailscale.
  4. In the Tailscale admin console (these might not be necessary):
    a. enable homeassistant as an exit node
    b. approve the auto-generated subnet routes
    c. disable key expiry
  5. Install homeassistant-mobile-ble-proxy from the github release assets
    a. Grant all the permissions and enable unrestricted battery usage
    b. Configure proxy settings: set the mDNS advertise interface to VPN. Save.
    c. Copy the ESPHome API encryption key for later
    d. Turn on the ESPHome BLE Proxy
  6. Install Tailscale on the android device and authenticate.
    a. Connect, then verify in admin console that both the android device and homeassistant show as connected.
  7. Verify connectivity from Android -> HA by going to the browser and going to http://<tailscale IPv4 for homeassistant machine>:8123 and make sure the HA login screen opens.
  8. Verify connectivity HA -> Android by opening HA Terminal & SSH App and running netcat: nc -zv <tailscale IPv4 for android machine> 6053 and make sure the response is not empty and says open.
  9. Go to HA Settings > Devices & services > Add integration > ESPHome
  10. Type in the Tailscale IPv4 for the Android device. Keep 6053 for the port. Submit
  11. Put in the previously-copied ESPHome API encryption key.
  12. Done! Your Proxy should now be outputting a lot of logs and forwarding all the advertisements.

This is quite neat and probably what I am looking for to connect my car to HA while on the road.

Can I limit specific Bluetooth devices so it wont's show up a gazillion of detected devices over time?

Also, maybe it's an idea to add this to the HA Companion App?

Hello,

Yes indeed you can, as I ride around I got bombarded with everybody's BLE devices as well.

I wish I did make a better UX or better docs. It has something to do with the

'Managed Target Devices'

It can be added automatically using the filter. Or you can simply add the mac address yourself.