MQTT data from vzlogger (volkszaehler)

I would like use the energy data from volkszaehler via MQTT.

The communcation with the MQTT broker works fine, but I am not able to use this data as a sensor value.

In the MQTT explorer I see in this path a value:
vzlogger/data/chn0/agg = 32821055.000000

but which MQTT discovery is needed and how can I work with this value (kW or kWh)?

should look something like

- platform: mqtt
  name: "volkszaehler"
  state_topic: "vzlogger/data/chn0/agg"
  unit_of_measurement: kW

Hello guys, can you help me with this?

I added the code to my config but it does not work yet. Where do I define the port and IP address of my arduino? What do I have to do to use the real time power values in Home Assistant?

- platform: mqtt
  name: "volkszaehler"
  state_topic: "vzlogger/data/chn0/agg"
  unit_of_measurement: kW