Install MQTT edit new titel Rotary-encoder

I want to use MQTT light commando’s for dimming led’s with an ESP
But I don’t know how I must do this.
Wat I have done:
Install MQTT mosquitto , No idee what I must do with settings
Connect an ESP with a led ,this one can I set on/off with LoveLace.
I think that I must install MQTT if I would dimming the led.
What are the steps I must do for create a working slider that control the led?

esphome is an oprion that does not require mqtt.

Okay , I Have now the config loaded in the esp RGBW and this is working with HA.
My extension for this is an roterij-encoder on the same esp so that I can control the brightness of the led’s.
How can I connect this in the software on the esp ?

You’ll need to give us far more information.

I have made a new topic because MQTT is not relevant anymore.