Python library for MQTT discovered device

I make a custom device with the code in python that posts sensor values to MQTT.

I’d like these sensors to be discovered by Home Assistant and I really feel like there should exist a library which I use to declare my sensors and that takes care of interfacing with the Home Assistant Discovery protocol.

All I could find for now is one in C++ (

Anybody know of one in python? This for sure exists right?

I’m not sure I understand, there’s nothing special to make devices discoverable by Home Assistant, you just need to publish a specific payload for your device to be discovered by Home Assistant.

See here for in depth documentation MQTT Discovery - Home Assistant

I understand but I would have though that there is a wrapper around the interface so everybody don’t have to redo the json format with correct names and stuff every time.

Maybe nobody has done it yet.

The best I could find for now is this one: