enable mqtt. In Broker you will use the IP address of the mqtt broker, in case you are using mosquito broker on Homeassistnat, input the IP address of Homeassistant.
For username and password, if MQTT broker is already setup in Homeassistant
integrations | mqtt | reconfigure mqtt server
just copy and paste the MQTT username and password into the respective fields.
On Homeassisstant
sensor wled temp:
- platform: mqtt
name: wled temperature
state_topic: wled/123xyz/temperature
device_class: temperature
qos: 0
unit_of_measurement: "°C"
123xyz(it can be anything phrase of your choice) is the topic which must be the same on the HA and wled
To confirm connection use mqtt explorer. http://mqtt-explorer.com/
Status should be online, time should be most recent.
Edit: @srg74 there is a bug with this configuration, it loses connection with mqtt broker. and to fix that you have to reboot wled, followed by changing the brightness. which restores the mqtt connection.