MQTT Extension

HI, I’m writing a thesis on extracting metadata from the mqtt topic names so a processor (e.g. Home Assistant) can process the metadata as contextual data in further processing. I am implementing it in HA, and I have a question.

In the case of entities - I cannot assign them location like I can for the devices so some extra information might be interesting for some automation(maybe even automatic linking in case the topic slightly changes ).

Now I want to make an integration BUT I have the same logic as MQTT, I read the same topics, I process everything the same except this processing extension. I am unsure if I should add the change to the existing mqtt integration or create a new one.

In case I create a new integration, how do I take the configuration from the mqtt integration?

In case I extend the existing, how do I add config whether it is enabled or not? - the config seemed pretty strict that the first level config name has to be a platform only.

Thank you!