please help me, I can’t figure out shed, you need to specify the state_class parameter
platform: template
scan_interval: 60
state_class: total
sensors:
water_ex:
friendly_name: Водопотребление
unit_of_measurement: ‘m³’
value_template: ‘{{ states.counter.water_counter_int.state }}’
device_class: water
Invalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->sensors->water_ex->state_class. (See ?, line ?).
or
platform: template
scan_interval: 60
sensors:
water_ex:
friendly_name: Водопотребление
unit_of_measurement: ‘m³’
value_template: ‘{{ states.counter.water_counter_int.state }}’
device_class: water
state_class: total
nvalid config for [sensor.template]: [state_class] is an invalid option for [sensor.template]. Check: sensor.template->state_class. (See ?, line ?).
You’ll probably have to use the modern yaml syntax, not the old one with platform: .... See Template - Home Assistant
The discussion above is about the knx integration, as you can read in the topic. It’s Syntax is not applicable for other integrations such as template.