Realise modbus over BLE using ESPHome in HA

I use a battery system (with solar system). I can connect to it using an ESP32 with an home made program. I would like to integrate the battery in my HA project (RasPi5) using ESPHome on and ESP32. The BLE performance of the RasPi is to unstable for BTHome.
I want to use the ESPHme to connect the battery, evaluate the messages (modbus protokoll) and connect HA via WiFi.
I don’t get it how to configure this issue. Can anybody help me?

We don’t know anything about that at the moment…

Not until you are more specific.

What make and model is all of your devices? You are using BLE, WiFi and ModBus - are you going to rationalize as part of your strategy?

What home grown product code are you using that you can build onto?

‘My home made program’ means I know how BLE works and how I find my data there. But I want to serve all centralised in HA with extern compiling and uploading.

Good that you know.
I don’t really know even what you are looking for.

You are then possibly 80% further along than most people that venture here!

My ‘home made’ is C++ - it is public on my github account (same username). I don’t want to use this code inside HA.
I want to use ESPhome integration in HA. Writing YAML config for my ESP device I want to use the BLE implementation ESPHome BLE communication. It can handle user configured data. BLE is interface between Battery ans ESP. The battery ‘speeks’ modbus.
So inside ESP I have to translate input /output from ‘HA’ to ‘modbus’ language and visa verse. For this I would like to use the modbus integration. If not possible I have to do with own code using automation (I don’t like to).

Esphome has component for BLE and component for modbus rtu over uart. Afaik it doesn’t have any native bridge between them. So you likely have to code it by yourself. But at that point it doesn’t make sense to use modbus component at all…

Thanks very much for your answer. I did search for the ‘bridge’, but there is no! because modbus always talk/listen to uart.
It’s not in my desire but I understand.