Using Web Bluetooth for integration

Hi, Sorry if this isn’t the place but I’m a new to Home Assistant and I haven’t found anything so far.

I’d like to integrate some Bluetooth LE sensors (plant moisture, as well as DIY sensors) and it seems that while there are solutions, they can be a bit of a pain to set up if you’re running in Docker - plus my Pi won’t be in range of half the sensors I care about.

On the other hand, it turns out Web Bluetooth (available on Chrome browsers) has a ‘scanning’ feature, so you can open an HTTPS page, click ‘ok’ to a warning, and have it scan for Bluetooth LE device advertising packets around you. I could just grab an old Android phone, go to a webpage on Home Assistant, and have it automatically provide home assistant integration.

Does something like this exist already?

If not, how would I do it? It looks like I can create a webpage in config/www and use the REST API to send updates - I just need to enable HTTPS support for Web Bluetooth to work. Is that the best way, or is there a better way that would integrate more nicely with Home Assistant?

The idea is this would be super quick and easy, so getting someone to set up and API key, modify the HTML file and paste it into the config directory probably isn’t the best start.

thanks!

I did this with esphome at least with the plant sensors

Thanks! You mean this kind of thing? https://esphome.io/components/sensor/xiaomi_ble.html

Or did you make your own plant sensor?

That looks really neat, and it seems like it could be a pretty good solution for me personally - but I just thought for most folks going to a URL on an old phone would be preferable to flashing an ESP32 with custom firmware.

Yes, that’s what I used I have a few esp8266 and esp32 around the house as sensors using the esphome integration and it all works great. So much quicker than coding my own from scratch.

I just got this working, and as you say it works great for switches/lights/etc - and I’ll be flashing all my SONOFF devices for sure!

Really it was about trying to get Bluetooth devices into Home Assistant though. There are a bunch of cases where I either have existing Bluetooth sensors/light bulbs that I’d like to get included, or I want to do something myself that I can just leave running off a battery (ESPxx will be too power-hungry when connected to WiFi).

While there seem to be Bluetooth solutions for Home Assistant they seem potentially a bit tricky to set up, and also wouldn’t work for many of my devices (because one Bluetooth bridge isn’t strong enough to reach all the BLE devices in the house)

The only thing I have is the plant sensors on Bluetooth. I agree with you on it being tricky to set up Bluetooth devices on HA.