Automated way to generate MQTT Sensors?

You might find the following post useful. I explained to another user how to use scripts to create MQTT Sensors via MQTT Discovery. It’s the technique I have used to create all of my MQTT-based entities (sensor, binary_sensor, lock, climate, etc).