Integrate Bluetooth battery monitoring devices (cars, motorbikes etc.)

No. 383B26BF1E50 exists

383B26BF1E50 = {“id”:“38:3B:26:BF:1E:50”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-70,“txpower”:0,“brand”:“GENERIC”,“model”:“BM6 Battery Monitor”,“model_id”:“BM6”,“type”:“BATT”,“track”:true,“batt”:77,“device”:“BM6 Tracker”}

UPD:
2 device updating information correctly, but 50547B243010 have a static data and not updating, and this one not have object tracker in MQTT integration menu.
50547B243010 = {“id”:“50:54:7B:24:30:10”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“eeaee3c4f8988453578074e7f1677430”,“rssi”:-59,“txpower”:0}
50547B243010 = {“id”:“50:54:7B:24:30:10”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-61,“txpower”:0,“brand”:“GENERIC”,“model”:“BM6 Battery Monitor”,“model_id”:“BM6”,“type”:“BATT”,“track”:true,“batt”:77,“device”:“BM6 Tracker”}

1 Like

I have ESP32-devkit-v1 flashed with same esp32dev-ble.

The openMQTTgateway webui seems to indicate it is somewhat detected (albeit , no absolute voltage measure , only a percentage)

My MQTT integration is HomeAssistant does not seem to have picked up anything…

Is there anythig specific I need to do in HA.MQTT (susbscribe to a topic or something else ?)

MQTT explorer shows that the device is being seen by mosquitto server:

I must be missing something…
I flashed module esp32-devkit-v1 with esp32dev-ble firmware
All works from that end.

How does one get all of those “controls” to show in HomeAssistant ? Is there an Integration to add to HA to point to the ESP32 IP address and get those to show up ?

UPDATE:
Got to to auto-discover after changing the base topic in the openMQTTgateway WEbUI/MQTT section to “homeassistant/” rather than the “home/”

2 Likes

@1technophile @holmesmj

Hi, sorry to tag you guys but I have the same setup as Martin (olimex esp32-gateway) with OpenMQTTGateway v1.7.0 flashed and it’s working fine (shows up in Home Assistant etc) as long as I have it connected to my computer but when i move it to use another power supply via the micro usb it only connects to the WiFi (sort of, I cannot reach it via the Web UI but it shows connected on my router) but never shows up in Home Assistant or Mqtt Explorer. I have tried different USB cables and charger’s. Got any tips or help?

Thanks in advance

Hi @Recon,

The only thing I can think of here is that the chargers you tried are not built for supplying a high enough current to the Olimex.

What is the minimum ampere rating for the Olimex, and do you have the appropriate charger’s for it?

Seems to be a very Olimex specific issue, if things work fine when connected to your PC, with the same micro USB I assume?

1 Like

Hi @DigiH,

Yeah about 30 minutes ago i found another charger and of course that one worked…

2 Likes

Dear All, another user that is fighting with that voltage display issue. I got the ESP32 running with esp32-dev-ble.
Found that to get the volt I have to press the “BT: Force scan”

Then going to the ESP32 Console I can see the msgs
N: BLE forced scan
N: Send on /BTtoMQTT msg {“bleconnect”:true,“interval”:10000,“adaptivescan”:false,“intervalacts”:10000,“intervalcnct”:3600000,“scanduration”:5000,“onlysensors”:false,“randommacs”:false,“hasspresence”:false,“prestopic”:“presence/”,“presuseuuid”:false,“minrssi”:-100,“extDecoderEnable”:false,“extDecoderTopic”:“undecoded”,“filterConnectable”:false,“pubadvdata”:true,“pubuuid4topic”:false,“ignoreWBlist”:false,“presenceawaytimer”:120000,“movingtimer”:60000,“forcepscn”:false,“tskstck”:2656,“crstck”:3060,“enabled”:true,“scnct”:28}
N: Device detected: EA:94:99:2D:F8:CD
N: Device detected: C6:FA:98:3C:25:C6
N: Device Ndetect: ed: 94:A9:A8:42:7F:22F
N: Device Ndetect: ed: 94:A9:A8:42:7F:22F
N: Scan begin
N: Send on /BTtoMQTT/94A9A8427F22 msg {“id”:“94:A9:A8:42:7F:22”,“mac_type”:0,“adv_type”:0,“manufacturerdata”:“4c000215655f83caae16a10a702e31f30d58dd82f644308264”,“rssi”:-96,“brand”:“GENERIC”,“model”:“BM2 Battery Monitor”,“model_id”:“BM2”,“type”:“BATT”,“track”:true,“batt”:100,“device”:“BM2 Tracker”}
N: Device detected: 4F:7E:59:96:96:31
N: Device detected: 94:A9:A8:42:7F:22
N: Send on /BTtoMQTT/94A9A8427F22 msg {“id”:“94:A9:A8:42:7F:22”,“mac_type”:0,“adv_type”:0,“name”:“Battery Monitor”,“manufacturerdata”:“4c000215655f83caae16a10a702e31f30d58dd82f644308264”,“rssi”:-97,“txpower”:0,“brand”:“GENERIC”,“model”:“BM2 Battery Monitor”,“model_id”:“BM2”,“type”:“BATT”,“track”:true,“batt”:100,“device”:“BM2 Tracker”}
N: Device detected: EA:94:99:2D:F8:CD
N: Device detected: EA:3E:0D:D0:F0:36
N: Device detected: C6:FA:98:3C:25:C6
N: Found 5 devices, scan number 30 end
N: BLE Connect begin
N: Send on /BTtoMQTT/94A9A8427F22 msg {“model”:“BM2 Battery Monitor”,“id”:“94:A9:A8:42:7F:22”,“volt”:13.88}
N: BLE Connect end

And the volt becomes available on the HA MQTT “BM2 Battery Monitor-427F22”

Ideas ? Thanks
jojo01fr

Hi @jojo01fr

The voltage only gets fetched by connection, therefore when you press “BT: Force scan”, but also automatically with the BT:Connect interval, which you might want to set to a lower value, but usually is fine with the - I think - default 60 minutes, when you know that the value will come in every hour. While admittedly the first hour wait can be a bit confusing.

Hope this clarifies things :slight_smile:

Hi dear DigiH, thats was it, clear like clean water ! :smiley:

Thanks a lot ! I reversed it back to 60 to spare the battery charge.
While in this topic, the android app BM2 downloads the several days voltage history, perhaps should be something to implement in the OMG_ESP32_BLE ?

Happy New 2024 ! Cheers
jojo01fr

1 Like

Thanks for the idea, but in general OMG is being used with controllers like Home Assistant and others which have their own history implementations, so I’m not sure if and how this could actually be implemented to be compatible with all these different controllers and if it would be useful for many using these histories already.

Thanks, and a Happy New 2024 to you, too!

The idea was to get the data from when the car is not near the OMG_ESP32_BLE but thats already great what you team have done so far.
I also have another BM (“name”:“Battery Asst”) on another car, is it a BM6 ? I’ve read the topic mentioned by legion.ck :

And of course testing the dev firmware

I get this on ESP32 Console:
N: Send on /BTtoMQTT/8800007F5AA2 msg {“id”:“88:00:00:7F:5A:A2”,“mac_type”:0,“adv_type”:0,“name”:“Battery Asst”,“manufacturerdata”:“d6050200480002880000000343016400004d010000c75d476ca696ab19”,“rssi”:-89}
N: Send on /BTtoMQTT/8800007F5AA2 msg {“id”:“88:00:00:7F:5A:A2”,“mac_type”:0,“adv_type”:0,“name”:“Battery Asst”,“manufacturerdata”:“d6050200480002880000000343016400004d010000c75d476ca696ab19”,“rssi”:-86}

And some IBEACON

N: Send on /BTtoMQTT/5CB1128CC141 msg {“id”:“5C:B1:12:8C:C1:41”,“mac_type”:1,“adv_type”:0,“manufacturerdata”:“4c000c0e00b30527265f3f4f00f9d733523210057b1ce2944a”,“rssi”:-79,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“00b30527265f3f4f00f9d73352321005”,“major”:31516,“minor”:-7532,“volt”:7.4}

My HA (SynoCommunity Package on a DS920+) works with the BM2 so far, the other one, Battery Asst does report the above to mqtt broker but no integtration on Home Assistant.
I’ll stay surveying this topic (and others).

Ok, the iBeacon messages seem to be from a different device though as your BM6, as they report under a different BY MAC address - 8800007F5AA2 vs. 5CB1128CC141.

Does your BM6 not send any iBeacon format messages at all under 8800007F5AA2? This is actually how the battery level in percentage would be recognised and decoded. Could you use MQTT Explorer’s message History to see if any iBeacong formta messages are there at all?

For any future BM6 voltage inclusion please add any comments to the above linked GitHub OpenMQTTGateway issue, with more manufacturerdata samples and the level/voltage the app shows at the same time.

Hi Again @DigiH =)

Finally manage (been between -15C and -20C) to mount my Olimex ESP32-GATEWAY-EA-IND outdoor and mounted my Battery Guard to my cars (Kia EV6) battery and it connects to HA.
Of course then i found out that it is a BM6 model…
Battery and Device seems to work as it should.

b1

This is my settings for OpenMQTTGateway in HA

Anything i can do to help out with the The implementation of the voltage object for BM6 battery monitoring is required · Issue #1792 · 1technophile/OpenMQTTGateway · GitHub issue?

Hi @Reco

It’s best to join in the issue thread on GitHub.

As I didn’t implement the connection read feature to get the voltage for the BM2 I cannot really say which service/char might be required for the BM6 to implement the same.

But I can stil try and see if the voltage might not be in the advertising broadcasts of the BM6, if you can supply more messages from MQTT Explorer for your BM6 with Advanced and Advertising Data set to true on your Olimex, and copy and pasting the messages from MQTT Explorer to your postings in the thread.

Hi,

Sure! Will post in the GitHub thread.

“with Advanced and Advertising Data set to true on your Olimex”

Do you mean the BT: Publish Advertisement data?

That’s the one :+1:

1 Like

Did you ever figure this out? What type is a BM2?

I did not figure this out. I ended up using OpenMQTTGateway But I’m not super happy with it.

Can you get voltages out with OMGateway? All I’m getting is battery as a % and their tech team seems stumped so far.