Need advice to pass MQTT data from an RPi based application to HAOS (running on N100)

Greetings,

New to HA.

I have an RPi, which monitors various sensors around my pool. It produces MQTT messages.

I think HA has a nice feature that “discovers” MQTT devices (like Sonoff etc).

Questions:

  • will this feature “discover” any MQTT device, or does it expect a certain configuration (like a Sonoff Basic, Thermostat etc).

  • where can I read up on this, or better yet, find sample code on both sides of the MQTT connection, HA and application? that would allow me to customize the RPi’s answer to a “discover” and of course customize what to do on the HA side.

Thanks.

Any device that sends the correct auto-discovery message.

There are a lot of topics about MQTT discovery on the forum.