How to add MQTT device with python

I’m busy to write a pythonscript to import data into homeassistant via MQTT broker.
The entities appear in homeassistant core, so far so good.

But the MQTT integration device is not!

I tried several github repositories to find a python solution. The one I’ve tried is:

HASS-MQTT-DISCOVERY - GitHub - leech001/hass-mqtt-discovery: Python class library for generate and send to Home Assistant over MQTT (AutoDiscovery) device data, but that one doesn’t work for the creation of a separte MQTT-device.

What are requirements for the creation of a mqtt-device into Homeassistant, where can I find it?

You mean, you send in your script data to an mqtt topic and you have to manually add the entities into HA via configuration.yaml?
Theres a solution, create a dict with the keys name, identifiers and manufacturer, another dict with the keys name, unique_id, state_topic, device. The first dict is assigned to the device key, do with the rest what you like. Then cast that into a json object.
Then publish your data to the following topic: homeassistant/sensor/[]/[unique_id]/config
Your state data should get published to homeassistant/sensor/[]/[unique_id]

Thanks for your comment. I will check it out!

Finaly I managed to get it working in my python script. It works nicely. Thanks again for your reply, that helped a lot.