Data spikes in the Energy Dashboard

Well that’s an mqtt sensor, not a template sensor like what was discussed above.

For MQTT sensors you must define an availability topic and payloads as well.

Try adding:

  - state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvtemperature'] | int(0) / 10 }}"
    availability_topic: energy/growatt
    availability_template: "{{ value_json['values']['pvtemperature'] | int(0) < 2000 }}"
    payload_available: true
    payload_not_available: false
    unique_id: growatt_inverer_temperature
    device_class: temperature
    unit_of_measurement: "°C"
    name: Growatt - Inverter temperature
    state_class: "measurement"    

You may need to quote the two availability payloads if it does not work.