Shelly Blu Distance BLE sensor MQTT

I wanted to try out this new distance sensor for my salt tank for my water softener. I already had MQTT setup for some other devices so I decided to go this route. Apparently this sensor will have forthcoming zigbee added to the firmware, so I'll switch it at that point. For now though, this works.

First here is the driver for this sensor using MQTT
https://raw.githubusercontent.com/jrfarrar/hubitat/refs/heads/master/devicehandlers/Shelly/Shelly%20BLU%20Distance%20MQTT

I'm using the Shelly Blu Gateway. You will need this script in the script section on the Shelly BLU gateway page to take the data from the sensor and push it out on MQTT via the gateway. Don't forget to flip the switch to run on startup.
https://raw.githubusercontent.com/jrfarrar/hubitat/refs/heads/master/devicehandlers/Shelly/BLU_to_MQTT_Script_for_gateway

In the driver you really just need to put in the BLE Device MAC Address and the IP address of the MQTT server (and credentials if you are using them). There is an option for inches in addition to mm and cm. This only reports distance. Also this requires that you setup the Blu gateway first and pair the sensor to that. Plenty of info for that online and it's very simple.

If you are so inclined I also put together a quick driver to make sure the gateways is online.
https://raw.githubusercontent.com/jrfarrar/hubitat/refs/heads/master/devicehandlers/Shelly/Shelly%20Gateway%20Status
Turn on MQTT on the gateway and check your server for the topic it subscribes with. Then again just add that into the driver along with MQTT server info.

1 Like