April Brother Bluetooth Low Energy MQTT Gateway

So I successfully have JSON messages arrive at the MQTT add-on for HA.

AB BLE Gateway 4.0 – April Brother CO.,LTD (aprbrother.com)

The gateway has its own MQTT publisher to a definable topic. I have not had a lot to do with MQTT before other than setting up gateways to push data to a broker.

The next step is to start to create sensors in HA.

According to the documentation each topic should be an mqtt sensor, this is not the case for me. I have plenty of devices but trying to get a miflora sensor working to start with.

The message format I get from gateway are in the following format (trimmed just to the miflora message:

{ "v": 1, "mid": 2263, "time": 6581, "ip": "192.168.XXX.XXX", "mac": "ABCDEFABCDEF", "devices": [ [ 0, "C47C8D6B662C", -38, "020106030295FE151695FE71209800032C666B8D7CC40D071003000000" ], ] }

Therefor the message for the Miflora includes the MAC Address and the RSSI followed by a hexadecimal string which is the actual BLE payload from the Miflora.

How do I create a sensor from this and parse out the values of the different sensors in the Miflora please?

I’m just a communications engineer not a programmer.

If you’re not a programmer, then that gateway is probably not for you.
You’d have to decode the hex string to get sensor values, which I’m not convinced would be possible at all just with jinja templates.

For miflora specifically, there is a dedicated integration that only needs a bluetooth setup, builtin with, e.g. rpi3 / rpi3, or a BT dongle.

There is also the “ble monitor” custom component that handles a bunch of xiaomi ble sensors:

Thanks Chris

That is what I was afraid of, thanks for the advice.

I was hoping someone had tackled it before.

I went to the gateway because I wasn’t getting the range I needed with the BT integrations.

I found some zigbee moisture sensors online this week, looks like I’m back to my trusty zigbee mesh :grinning:

Use a esp32 and esphome. It has a miflora component.

Thanks however it’s not just Miflora I want BLE for. I also want to use it for presence and other devices.

I am looking at OpenMQTT

Esphome supports reading any ble message. But openmqttgateway is a great project.

In case this comes up for anybody else again: I bought one of these not realizing that there’s no “standard BLE forwarding” protocol. Either way - I wrote a (hacky) custom component which forwards BLE advertisments from this gateway to the new bluetooth component. See GitHub - chkuendig/hass-ab_ble_gateway: Home Assistant Component for April Brother/AB BLE Gateway V4 for more details!

That’s great! Since it s ESP32 inside, we should be able to flash it with esphome to use it as Bluetooth proxy and command switchbot as well…did anyone succeeded?

Why not just use a ESP32? Why do you need to pay about 10x the price?

I agree with you…just I did already…

@chkuendig do you mind updating the readme with more info on how to configure it?
I already have the gateway sending the info to the same MQTT as HA, but was hoping that HA would just find the new beacons that the AB tracker picks up

Sorry, just saw this now. It should be enough to enter IP, port, username and password and the integration will fetch all the config from the gateway directly.