Mosquitto Broker Intergration not listening to Topics on startup

I have to restart Hone Assistant Daily as it fails overnight for some unkown reason, i’m at the point i’m ready to delete the database.

Anyway the issue is after moving to docker from os, whenever i restart the docker container for HASS it doesnt subscribe to zigbee2mqtt topic on startup, i have to manually login to the integration and add it manually on the Listen to a topic part at the bottom of the config page.

I cannot find any documentation on configuring it to listen to specfic topics, how do i fix this? thanks.

For anyone else looking for the answer, here’s the solution, setup the following in your configuration.yaml

mqtt:
  broker: !secret mqtt_host
  port: !secret mqtt_port
  discovery: true
  discovery_prefix: homeassistant
  username: !secret mqtt_user
  password: !secret mqtt_pass
  sensor:
    - state_topic: 'zigbee2mqtt'

It takes a couple of minutes after hass starts before the subscription kicks in