Problem defining energy usage, individual device

I am experiencing a problem setting up the energy usage of a particular device in the energy panel.

Context: I currently have 6 thermostats that, under the Hilo integration (Hydro Quebec), are reporting their energy usage under an entity such as “sensor.hilo_energy_N” with number values such as “71.0”, to be interpreted as the number of kwh used thus far. This allows me to break down my energy consumption into those 6 sources (and others as well) in the “individual devices” graph of the energy panel.

Unfortunately one of those sources (say, “sensor.hilo_energy_3”) is being reported incorrectly by the Hilo integration. The problem is that, while that particular thermostat is driving an expansion module which controls an additional heating unit, Hilo does not currently take into account the additional energy usage of expansion modules.

Now, I happen to know that in this case, the extra usage is roughly twice as high as that of the driving thermostat. Thus, what I want to do is to state that the real usage of the driving thermostat is 3 times the number currently reported by Hilo.

I am trying to implement that by defining an additional sensor (say, “sensor.hilo_energy_3_with_exp”) whose state will be the triple of the value of “sensor.hilo_energy_3”:

   sensors: 
      hilo_energy_3_with_exp:
      unique_id: "Hilo Energy3 with exp"
      state_class: total_increasing
      unit_of_measurement: kWh
      device_class: energy
      value_template: >-
        {{float(states("sensor.hilo_energy_3")) * 3 }}

The attributes are intended to reflect the following requirement stated in the energy panel documentation:

* device_class must be energy for electricity grid, solar, or battery categories.
* state_class must be total or total_increasing.
* The sensor must have an appropriate unit_of_measurement. 

However, the above sensor definition produces the following error message in the logs:

Invalid config for 'sensor' from integration 'template' at sensors.yaml, line 29:
'state_class' is an invalid option for 'template.sensor', 
check: sensors->hilo_energy_3_with_exp->state_class, 
please check the docs at https://www.home-assistant.io/integrations/template

Please help me fix that problem so that I will be getting the desired value for “sensor.hilo_energy_3_with_exp”

You are using legacy template sensor format.

state_class is not supported on the legacy syntax. You need to update to the new suggested template sensor syntax, e.g. https://www.home-assistant.io/integrations/template/#state-based-sensor-exposing-sun-angle

Thanks a lot for your help!