Hi,
I have a zigbee powermeter which doesn’t count correctly (wrong pulse config),
so I thought creating a “virtual” sensor with the right counting.
My problem is to be able to track energy in the new energy dashboard of HA, my sensor needs to have a measurement class definition, which I can’t set.
sensor:
- platform: template
sensors:
util_meter:
state_class: "measurement"
friendly_name: 'EndesaOK'
unit_of_measurement: 'kWh'
device_class: 'energy'
value_template: "{{ state_attr('sensor.endesa_energy', 'energy') /1000*400 }}"
Having this in my config, I receive the following error:
Invalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->sensors->util_meter->state_class. (See ?, line ?).
How can I solve this error?
Seems that the template sensor does not support the state_class: “measurement”
Thanks