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

I think I might have spotted the battery level in the iBeacon format of the last BTtoMQTT message. @legion.ck Could you post some iBeacon format broadcasts for the other two BM6 as well?

Also, are you able to create your own OpenMQTTGateway builds with PlatformIO for your esp32-m5atom-lite to test a possible BM6 test decoder?

I can’t create such a build .
I flashed m5stack atom lite to esp32dev-ble (v1.6.0) and look this:
OMG_ESP32_BLE

LWT = online

version = v1.6.0

▼BTtoMQTT

F4FEFB2D7907 = {“id”:“F4:FE:FB:2D:79:07”,“mac_type”:0,“adv_type”:0,“name”:"[TV] TV",“manufacturerdata”:“75004204010167f4fefb2d7907f6fefb2d79060839ba31000000”,“rssi”:-88}

34865DC8317A = {“id”:“34:86:5D:C8:31:7A”,“mac_type”:0,“adv_type”:0,“manufacturerdata”:“d006017a31c85d8634c62a020202”,“rssi”:-97}

50547B24F7B0 = {“id”:“50:54:7B:24:F7:B0”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“ee017627cd6db2df636b4f31f0fe5d0f”,“rssi”:-39,“txpower”:0}

C47C8D6DE88D = {“id”:“C4:7C:8D:6D:E8:8D”,“mac_type”:0,“adv_type”:0,“name”:“Flower care”,“rssi”:-93,“servicedata”:“71209800508de86d8d7cc40d041002fd00”,“servicedatauuid”:“0xfe95”,“brand”:“Xiaomi/VegTrug”,“model”:“MiFlora”,“model_id”:“HHCCJCY01HHCC”,“type”:“PLANT”,“tempc”:25.3,“tempf”:77.54}

50547B243010 = {“id”:“50:54:7B:24:30:10”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“eeaee3c4f8988453578074e7f1677430”,“rssi”:-68,“txpower”:0}

383B26BF1E50 = {“id”:“38:3B:26:BF:1E:50”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“3b31ca6051c41765e634c15d3f29c564”,“rssi”:-51,“txpower”:0}

C47C8D6DE88C = {“id”:“C4:7C:8D:6D:E8:8C”,“mac_type”:0,“adv_type”:0,“name”:“Flower care”,“rssi”:-92,“servicedata”:“71209800638ce86d8d7cc40d071003270000”,“servicedatauuid”:“0xfe95”,“brand”:“Xiaomi/VegTrug”,“model”:“MiFlora”,“model_id”:“HHCCJCY01HHCC”,“type”:“PLANT”,“lux”:39}

0452C7F76965 = {“id”:“04:52:C7:F7:69:65”,“mac_type”:0,“adv_type”:0,“manufacturerdata”:“100340100230”,“rssi”:-98}

74A9AF216A81 = {“id”:“74:A9:AF:21:6A:81”,“mac_type”:1,“adv_type”:3,“manufacturerdata”:“4c0002151ca92e23f0874df7b9a2fd4b716a4bf60295000003”,“rssi”:-82,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“1ca92e23f0874df7b9a2fd4b716a4bf6”,“major”:661,“minor”:0,“volt”:0.3}

30092042BE67 = {“id”:“30:09:20:42:BE:67”,“mac_type”:0,“adv_type”:0,“name”:“L7161”,“rssi”:-99}

45C32D732650 = {“id”:“45:C3:2D:73:26:50”,“mac_type”:1,“adv_type”:3,“manufacturerdata”:“4c0002151ca92e23f0874df7b9a2fd4b716a4bf6053f000003”,“rssi”:-89,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“1ca92e23f0874df7b9a2fd4b716a4bf6”,“major”:1343,“minor”:0,“volt”:0.3}

7BC1A53451C9 = {“id”:“7B:C1:A5:34:51:C9”,“mac_type”:1,“adv_type”:3,“manufacturerdata”:“4c0002151ca92e23f0874df7b9a2fd4b716a4bf60296000003”,“rssi”:-81,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“1ca92e23f0874df7b9a2fd4b716a4bf6”,“major”:662,“minor”:0,“volt”:0.3}


BCON for my 3 devices BM6 don’t have entity voltage in mqtt message. Maybe problem this extDecoderTopic":“undecoded”?

Received 22:26:41
QoS: 0
Payload: {“bleconnect”:true,“interval”:36000,“adaptivescan”:false,“intervalacts”:100000,“intervalcnct”:3600000,“scanduration”:1000,“onlysensors”:false,“randommacs”:false,“hasspresence”:false,“presenceTopic”:“presence/”,“presenceUseBeaconUuid”:false,“minrssi”:-100,“extDecoderEnable”:false,“extDecoderTopic”:“undecoded”,“filterConnectable”:false,“pubadvdata”:true,“pubBeaconUuidForTopic”:false,“ignoreWBlist”:false,“presenceawaytimer”:120000,“movingtimer”:60000,“btqblck”:8,“btqsum”:1502,“btqsnd”:1281,“btqavg”:1.172521,“bletaskstack”:3020,“blecoretaskstack”:3052,“blestarts”:1}

Those seem to be other actual iBeacon devices creating messages for you, as the MAC addresses/ids do not match the previously reported

and the MAC addresses/Serial No. in your screenshot.

Don’t you get iBeacons format messages for “50:54:7B:24:F7:B0” and “38:3B:26:BF:1E:50” as well then?

Don’t worry about this, that is fine, as it only sets the topic for a gateway set to transmit undecoded messages for decoding with Theengs Gateway running on a different computer - not applicable for this issue, so you can ignore it.

I install Theengs gateway as an ADDON in Home Assistant and have pretty json message:
TheengsGateway

LWT = online

▼BTtoMQTT

C47C8D6DE88D = {“name”: “Flower care”, “id”: “C4:7C:8D:6D:E8:8D”, “rssi”: -70, “brand”: “Xiaomi/VegTrug”, “model”: “MiFlora”, “model_id”: “HHCCJCY01HHCC”, “type”: “PLANT”, “lux”: 73, “mac”: “C4:7C:8D:6D:E8:8D”}

34865DC8317A = {“manufacturerdata”: “d006017a31c85d8634c62a020202”, “name”: “classic300s”, “id”: “34:86:5D:C8:31:7A”, “rssi”: -58, “mfr”: “Etekcity Corporation”}

F4FEFB2D7907 = {“manufacturerdata”: “75004204018066f4fefb2d7907f6fefb2d79060139ba31000000”, “name”: “[TV] TV”, “id”: “F4:FE:FB:2D:79:07”, “rssi”: -64, “mfr”: “Samsung Electronics Co. Ltd.”}

50547B243010 = {“name”: “BM6”, “id”: “50:54:7B:24:30:10”, “rssi”: -80, “brand”: “GENERIC”, “model”: “iBeacon”, “model_id”: “IBEACON”, “type”: “BCON”, “mfid”: “4c00”, “uuid”: “3ba29cd9a42c894856badaf2606ef777”, “major”: 4429, “minor”: 0, “txpower”: -51}

30092042BE67 = {“manufacturerdata”: “67be422009304c585a4d424c4c313430”, “name”: “L7161”, “id”: “30:09:20:42:BE:67”, “rssi”: -82}

C47C8D6DE88C = {“name”: “Flower care”, “id”: “C4:7C:8D:6D:E8:8C”, “rssi”: -76, “brand”: “Xiaomi/VegTrug”, “model”: “MiFlora”, “model_id”: “HHCCJCY01HHCC”, “type”: “PLANT”, “moi”: 11, “mac”: “C4:7C:8D:6D:E8:8C”}

4C1419FDD013 = {“manufacturerdata”: “ffff65656534343062613165633436626364”, “name”: “SHIELD”, “id”: “4C:14:19:FD:D0:13”, “rssi”: -82, “mfr”: “Bluetooth SIG Specification Reserved Default Vendor ID for Remote Devices Without Device ID Service Record.”}

383B26BF1E50 = {“manufacturerdata”: “9fcb387ebfe6d29c0c7a8610732a23ac”, “name”: “BM6”, “id”: “38:3B:26:BF:1E:50”, “rssi”: -84}

F66AC1172678 = {“manufacturerdata”: “ffff10031105”, “id”: “F6:6A:C1:17:26:78”, “rssi”: -88, “mfr”: “Bluetooth SIG Specification Reserved Default Vendor ID for Remote Devices Without Device ID Service Record.”}

562AA36ECFAF = {“id”: “56:2A:A3:6E:CF:AF”, “rssi”: -82, “brand”: “GENERIC”, “model”: “iBeacon”, “model_id”: “IBEACON”, “type”: “BCON”, “mfid”: “4c00”, “uuid”: “00e129fe62e79e282b715187c8181005”, “major”: 27420, “minor”: 27541, “txpower”: -24}

But IBEACON for BM6 not available item voltage or soc

I receiving it

383B26BF1E50 = {“id”:“38:3B:26:BF:1E:50”,“mac_type”:0,“adv_type”:0,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114e0000cd”,“rssi”:-53,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“3ba29cd9a42c894856badaf2606ef777”,“major”:4430,“minor”:0,“txpower”:-51}

50547B24F7B0 = {“id”:“50:54:7B:24:F7:B0”,“mac_type”:0,“adv_type”:0,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-40,“brand”:“GENERIC”,“model”:“iBeacon”,“model_id”:“IBEACON”,“type”:“BCON”,“mfid”:“4c00”,“uuid”:“3ba29cd9a42c894856badaf2606ef777”,“major”:4429,“minor”:0,“txpower”:-51}

Thanks, great @legion.ck

I have started a OMG test build run, which you can access and install the pre-built esp32dev-ble to your esp32-m5atom-lite from

https://docs.openmqttgateway.com/dev/upload/web-install.html

with SHA:495e1c at the top of the page.

Let us know what you get with this test build, compared to the battery levels in the app.


I flashed m5stack atom lite twice and reconfigured but device is not available, have unactive status using U test build esp32dev-ble.

Did you select Erase Flash when uploading?

I just tested here, albeit with an ESP32-WROOM unit, and the test build esp32dev-ble from the above link works fine for me here.

Or can you alternatively upload the esp32-m5atom-lite build?

Sure, I erased device. I can try this test build esp32-m5atom-lite

I uploaded the test atom lite build, and then the product version of atom lite, as a result, it blinks slowly in yellow. probably a cyclic reboot.

Any possible mistakes in the initial WiFi and MQTT broker setup?

Does the gateway join your WiFi network with either the esp32dev-ble or esp32-m5atom-lite build?

Is your MQTT broker set up to use a user name and password? If not, please try making sure the mqtt user and mqtt pass fields are empty during the initial setup.

Of course. Wifi settings is correctly.

I’m so sorry. I mistaked with IP. Now device work .

And the MQTT settings as well I suppose.

Then I really don’t know what problems you might be experiencing with the development test build :frowning:

Do you have any other ESP32 at hand with which you could try?

:wink:

So are you getting correct battery levels for your BM6 devices now?

Received

OMG_ATOM_L
LWT = online
version = v1.6.0
BTtoMQTT

50547B24F7B0 = {“id”:“50:54:7B:24:F7:B0”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-55,“txpower”:0,“brand”:“GENERIC”,“model”:“BM6 Battery Monitor”,“model_id”:“BM6”,“type”:“BATT”,“track”:true,“batt”:77,“device”:“BM6 Tracker”}
50547B243010 = {“id”:“50:54:7B:24:30:10”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-50,“txpower”:0,“brand”:“GENERIC”,“model”:“BM6 Battery Monitor”,“model_id”:“BM6”,“type”:“BATT”,“track”:true,“batt”:77,“device”:“BM6 Tracker”}
50547B24F7B0 = {“id”:“50:54:7B:24:F7:B0”,“mac_type”:0,“adv_type”:0,“name”:“BM6”,“manufacturerdata”:“4c0002153ba29cd9a42c894856badaf2606ef777114d0000cd”,“rssi”:-50,“txpower”:0,“brand”:“GENERIC”,“model”:“BM6 Battery Monitor”,“model_id”:“BM6”,“type”:“BATT”,“track”:true,“batt”:77,“device”:“BM6 Tracker”}

Thanks. SOC state for all 3 batarries correctly 77% . But response not have voltage object.

The “id”:“50:54:7B:24:F7:B0” is double, but an “id”:“38:3B:26:BF:1E:50” is missing.

I still assume though that all three show the same battery level percentage now as the app does, correct?

And yes, the voltage would possibly need to be obtained by connection through OMG, as is necessary for the BM2 as well. It is not something Decoder can do.

To see if and how this might be possible please open an issue at the OpenMQTTGateway GitHub page.

Thanks

1 Like