While this seems (!) to basically work, it seems like the presence topic for OMG and TheengsGateway is very different to the one I used before in another ESP based project (where the state topic contained a list of all devices currenctly around, so as long as the device was active it was part of the state topic, that way it was discovered âhomeâ as long as it was nearby):
the topic only stores the latest device found, for a very short period of time (depending on the next new/strongest one detected).
Multiple discovery doesnât matter as I have one collection sensor (contains OMG 1 + OMG 2 + TG + WiFi based sensor + previous Bluetooth sensors).
In short: how to use the OMG/TheengsGateway provided presence topics for doing some half-serious (no device_tracker entities needed at the end, but reliable discovery and ideally signaling how long the device is around) device tracking?
I know you natively implemented this in a very professional way (meaning in the end thereâs a autodiscovery provided device_tracker entity in Home Assistant, just perfect) for many devices (BM2, fitness trackers etc.). Would this be âthe way to go to do it fully professionalâ?
Iâm currently looking at the best way to go. Focus:
reliability
speed (I canât wait months to have this natively implemented and shipped in a stable OMG/TG release, thatâs why I tried to use what I can with the existing MQTT topics)
Thanks a lot for your help on this. Unfortunately I found that doing device tracking on my own is quite complicated with bluetooth devices and the way the presence topics are build (ultra short-term lifetime/no list as I was used to).
How about just creating and publishing your own device tracker discovery message for the mentioned BLE device (E-Bike??)?
Then you would have a proper BLE device tracker entry for the bike.
Do you think you can cobble this together yourself by looking at the topic and payload of your other already existing device tracker discovery entries?
Which E-Bike is it, a very popular one, and is the BLE integration standard with it?
Could you also post some sample BLE messages you receive from it, with advertising data turned on? As this might be interesting to others as well, and the advertising data might include some decodable data, like battery level or such?
Does the bike have a native app showing some received information?
The actual presence option in OMG and TGW is only really applicable for room presence, but device trackers are the way to go if you just want a home/away presence detection.
Yes it does: âBosch eBike Connect im App Store
Maybe thatâs inside the manufacturerdata part below? At least it is not clear text. But my smartphone app is paired, the OMGs/TheengsGateway obviously not.
I canât use the BTtoMQTT one as this seems to be kind of persistent (not removed once the device goes away/off) and the presence one only contains the latest fetched one as mentioned in the OP.
Can you help me on this / work with the information provided @DigiH ?
This was the information which was needed to allow me to add a device tracker decoder for the Bosch Nyon, and assuming this advertising data is sent out in regular intervals.
You should be able to test and use this additional decoder with your ESP32 OpenMQTTGateway gateway by installing the latest development version from
Please note I masked things like the MAC and the latter part of the name (usually âNyon-XXXâ contains the last 3 characters of the MAC address), I forgot to mention this in the previous post. Not sure if this is relevant for the decoder - just to be sure.
I already assumed as much, with all the Xs Itâs fine, they were not relevant for creating the decoder.
What you could monitor however is if the manufacturerdata changes at all over time, to see if there is any additional data encoded in it, like possibly the accumulated distance cycled or such.
Unfortunately, it stays on stable 1.7.0. Tried several times, after restart still 1.7.0 is flashed. Do you have a OTA URL for the dev version I shall test?
Otherwise, using the web installer and unselecting Erase Flash should keep your current settings, unless there have been changes which require a new set up for the current development version.
OK. Iâll wait for the OTA URL then. Itâs just so much easier flashing/updating them remotely, considering where the ESP(s) are physically located.
To be ready to test after switching to dev channel: what is needed to provoke the âcatchâ and create the device tracker? I remember back in the days when we set this up for the BM2 I had tough times achieving the creation of the device_tracker entity and spent a lot of unnecessary time then.
And then press the SYS: Restart Gateway button. After the restart, once the device Tracker for the Bosch Nyon has been auto discovered you can disable SYS: Auto discovery again.
BT: Force scan doesnât really help here, nor is BT: Publish HASS presence required to be enabled if you only want to use Home/Away device trackers.
You can keep BT: Publish advertisement data enabled for a few days, to see if the manufacturerdata changes at all, especially after having used your eBike for a ride. You could also tell us what battery level the Nyon shows in the app, as this might also be encoded in the manufacturerdata.
If the manufacturerdata doesnât change at all just let us know here, and you can dsable BT: Publish advertisement data again. If iot does change we should investigate some more to see which data might be encoded there, to create a more detailed decoder for the Nyon.
You will be able to switch back easily as all the 1.7.0 binaries have been copied to the new OTA host.
But if you switch back you will still need to do a manual upload for the v1.8.0
Not yet, scheduled for Sunday. A bit difficult to do remotely when you need to flash locally, so it took/takes longer than I was initially hoping for. Iâll turn back.