Install MQTT in Home-Assistant
Go to Settings –> Add-on –Add-on Store and search for MQTT
Click on Mosquitto broker, then click install
Select Start on boot and Watchdog, nothing need to be done in the configuration tab so just click Start.
You now need to add a mqtt user
Go to Settings –> People Users Tab.
Click Add User at the bottom right.
Enter Display Name, Username, Password, and Can only log in from the local network.
If you want to test it is working then download MQTT Explorer from HERE.
Enter the IP Address of Home-Assistant, the username, and the password you created above
The only thing available is $sys
After setting up MQTT remember to add it to Home-Assistant
If you reboot the system it should be automatically discovered
Click Notifications
Click Check it out
Click Configure
Click Submit
Any new devices that have updated MQTT will now try to be added, you need to assign them to area and click finish