MQTT on Home Assistant is one of the most annoying things to figure out. The documentation is extremely minimal, their forum is filled with links to the documentation when people ask about not being able to understand the documentation. I’m keeping notes & warnings here.
There are a few elements of MQTT that are important for this. You might already have some of this set up, if you followed some general Home Assistant getting started guides.