Configuration specified the fields ["topic"], but they were not used

Ah I missed this on saturday, it isn’t topic it is topic_parsing

[inputs.mqtt_consumer.topic_parsing.types]

so based on what you provided in that file what you want is:

  [[inputs.mqtt_consumer.topic_parsing]]
    topic = "sensor/lokasi/#"
    measurement = "Hasil_Data"
    tags = "lokasi"
    fields = "CO2_ppm"

    [inputs.mqtt_consumer.topic_parsing.types]
        key = "CO2_ppm"
        data_type = "float"

I need to update the docs that is a bad typo. PR to update docs: docs(inputs.mqtt_consumer): Update topic parsing types naming by powersj · Pull Request #15301 · influxdata/telegraf · GitHub