BM2 battery monitoring using ble tracker component

It works! I guess I was stupidly assuming the ESP32 had similar bluetooth range as the latest iPhone. I reinstalled the yaml and plugged the ESP32 into a USB battery for portability and left it on the car’s dashboard. Now when I check the logs in Esphome I am seeing voltages with 2 decimal places of accuracy! HOORAAYY!

To be clear, I got it through ESPHome, not through OpenMQTTGateway.

First Post ! yay
I’ve setup a BM2 and the esp32 config above and it’s working well, thank you !
My only question is how to adjust the config to allow me to monitor two BM2 devices?
Do i just replicate the BLE_Client and Sensor config below the current code with the second mac address and a new name ?

Thanks,

Yes, exactly that. See below.

Screenshot 2024-04-01 at 06.06.04.jpeg

1 Like

Glad you go it working.

Is this the ESPHome code you used?

Did you have to change anything?

Yes, its working. That’s prettymuch the code I used. I think I just updated the bluetooth address and name.

I have mine connected and partially working but no reporting of Voltage.

13:34:01	[D]	[esp32_ble_client:110]	
[0] [50:54:7B:5D:A4:40] Found device
13:35:34	[D]	[esp32_ble_client:110]	
[0] [50:54:7B:5D:A4:40] Found device
13:35:34	[D]	[esp32_ble_tracker:665]	
Found device 50:54:7B:5D:A4:40 RSSI=-70
13:35:34	[D]	[esp32_ble_tracker:686]	
  Address Type: PUBLIC
13:35:34	[D]	[esp32_ble_tracker:688]	
  Name: 'Battery Monitor'
13:51:26	[I]	[app:062]	
setup() finished successfully!
13:51:26	[D]	[text_sensor:064]	
'Dryderdale vehicle battery monitor IP Address': Sending state '10.0.0.62'
13:52:58	[D]	[esp32_ble_client:110]	
[0] [50:54:7B:5D:A4:40] Found device
13:52:58	[D]	[esp32_ble_tracker:665]	
Found device 50:54:7B:5D:A4:40 RSSI=-70
13:52:58	[D]	[esp32_ble_tracker:686]	
  Address Type: PUBLIC
13:54:17	[I]	[mqtt:274]	
MQTT Connected!
14:00:29	[W]	[ble_sensor:123]	
[F12 Battery Voltage] Cannot poll, not connected

It reports the address type and device name correctly but I’m seeing cannot poll for voltage.

I have this working OK using OMG although voltage and percentage don’t report very often.

Any ideas?

Get closer to the BM2.
The bluetooth signal is not very strong. I have to keep the ESP32 pretty close to the BM2 to get them connected.

Before you drive yourself crazy in the software, get those two devices right next to each other and see if it works. If so, start experimenting to see how far away the connection stays solid.

This looks far better than BM2…