Help with shelly 3EM combining phases to one and adding to energy panel

Hello.

I have a shelly 3em, i managed to combine the 3 phases to one reading with the following:

- platform: template
  sensors:
    energy_totalvandvarmer1:
      friendly_name: 'Vandvarmer'
      value_template: "{{ (states('sensor.shellyem3_34945474b4ed_channel_a_energy')|float + states('sensor.shellyem3_34945474b4ed_channel_b_energy')|float + states('sensor.shellyem3_34945474b4ed_channel_c_energy')|float)|round(3) }}"
      unit_of_measurement: "kWh"
      device_class: energy

It works fine, but the problem is that energy dashboard want the State_class “measurement” and “Last_reset”

But studio code throws this error; Property last_reset is not allowed, and validation in Home Assistant throws this error: “Invalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->sensors->energy_totalvandvarmer1->state_class. (See ?, line ?).”

Any suggestions? - thanks!

Use the new way to define templates

template:
  - sensor:

Or add the additional attributes through customize.