Esp32 MQTT sensor not showing up

I’m using an esp32 to gather data about the moisture of the soil. It’s configured to send data every 5 minutes to the topic esp32/soilmoisture. However, it isn’t showing up in the entities list nor in the MQTT config. This is my configuration.yaml:

sensor:
    - platform: mqtt
      unique_id: "sensor.soil_moisture"
      name: "Soil Moisture Sensor"
      state_topic: "esp32/soilmoisture"
      value_template: "{{ value_json.moisture }}"
      unit_of_measurement: "%"

What am I doing wrong?

Check out the latest mqtt integration. Your code is out of date.

Thanks, I will look into it.