Help needed adding MQTT Sensors

Hi Folks,

I have a problem adding Mosquitto Sensors to my configuration.yaml. It surely is a noob question, but I tried out so much, without success.

If I add one sensor it works fine, but as soon as I add another (like here in the example with Growatt - Date) it doesn’t work anymore.

mqtt:
    sensor: 
        state_topic: energy/growatt
        value_template: "{{ value_json['device'] }}" 
        unique_id: growatt_serial
        name: Growatt - Serial number
        icon: mdi:select-inverse

        state_topic: energy/growatt
        # If you like to have the date in another format, please change "timestamp_custom('%d-%m-%Y')"
        # For more information: https://docs.python.org/3/library/time.html#time.strftime
        value_template: "{{ as_timestamp(strptime(value_json['time'], '%Y-%m-%dT%H:%M:%S')) | timestamp_custom('%d-%m-%Y') }}" 
        unique_id: growatt_date
        name: Growatt - Date
        icon: mdi:calendar      

Any hints for me?

Best

Thomas

Solved by myself the old way:

sensor:
  - platform: mqtt
    state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvenergytotal'] | int / 10 }}" 
    unique_id: growatt_generated_energy_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Generated energy (Total)
    icon: mdi:solar-power
    
  - platform: mqtt
    state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvtemperature'] | int / 10 }}" 
    unique_id: growatt_inverer_temperature
    device_class: temperature
    unit_of_measurement: "°C"
    name: Growatt - Inverter temperature