Larnak
(Arango)
October 21, 2022, 6:07pm
1
Hello
I tried to create a new sensor for energy
- platform: template
sensors:
shelly_energy:
friendly_name: "Shelly total Energy KWH"
unit_of_measurement: 'kWh'
# state_class: total_increasing
value_template: "{{ states('sensor.shellyem3_bcff4dfd1d62_channel_a_energy') |float + states('sensor.shellyem3_bcff4dfd1d62_channel_b_energy') }}"
device_class: "energy"
but I am not able to choose the state_class: total increasing in order to include it in the energy board
Do you have any idea how to create such sensor ?
Thank you
123
(Taras)
October 21, 2022, 6:43pm
2
That’s because your Template Sensor is configured in legacy format which doesn’t support the state_class
option.
You can add state_class: total_increasing
to it via Manual Customization or re-configure it in modern format.
Larnak
(Arango)
October 22, 2022, 11:55am
3
Hi thank I move all to my template.yaml and all is working !
123
(Taras)
October 22, 2022, 12:22pm
4
Glad to hear that switching to modern format resolved the problem.
Please consider marking my post with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other words that this topic has been resolved. This helps users find answers to similar questions.
For more information about the Solution tag, refer to guideline 21 in the FAQ .