Best way to integrate a custom device from (Homie-convention like) MQTT topics

Hi everyone! I am quite new to Home Assistant but already managed to get many things running (coming from an iobroker installation).

Currently, I am trying to find out which possibilities there are to integrate a custom device with many sensors into HA that are represented in a specific MQTT topic tree. The mqtt structure “roughly” follows the Homie convention.
To get an idea of it, here is a screenshot (only a small part) from the mqtt topics:

I already know how to set up mqtt sensors via yaml and group them to devices, but in this case there are way too many entries to handle this “nicely” in a yaml file. Plus, all information needed to create a sensor already is available within the mqtt data!

So my idea was to do it programmatically, if possible: Iterate over the topics, read the value and attributes ($name and $unit) and create a sensor for each topic (incl. subtopics, see screenshot).
Is there a way to achieve this? Can I write a “custom discovery” for this or are there other mechanisms in HA that I could use?

Background:
The data comes from a quite old controller (Luxtronik 1.0) for an AlphaInnotec heatpump. Only newer ones with modbus (tcp) are supported by some Home Assistant / HACS integrations - but this controller uses a different protocol via RS232. The communication with the heatpump controller is done via a ThirdParty script which then publishes the data to MQTT.