Zigbee2mqtt discovery not working

I cannot get the MQTT auto-discovery going. My Zigbee2mqtt instance in running on a Raspberry Pi separate from my Home Assistant instance. Zigbee2mqtt works just fine. I can connect devices and it publishes to my Mosquitto broker running on the same machine as HA (Home Assistant integration in Zigbee2Mqtt is turned on). I also see topics in homeassistant/sensor, homeassistant/binary_sensor, etc. being published. The discovery option under mqtt: is also set to true. But Home Assistant doesn’t see anything. No device is being discovered. What could be the problem?
Thanks for your help!

What version of HA and Zigbee2mqtt ?

I’m on HA 2021.12.5 and Zigbee2Mqtt 1.22.1.

Ok. Fixed this myself. I had to go to “Devices & Services” → Mosquitto broker → Configure → Re-configure MQTT. There I had to enable discovery. I had set discovery = true in my configuration.yaml under mqtt but that didn’t work. Now everything works just fine.