- sensor:
- name: "energy_generation"
unique_id: energy_generation
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing # or total if it does not reset or sometimes decreases
state: '{{ "%0.2f" | format(states("sensor.energy_generated") | float/1000) }}'
availability: '{{ has_value("sensor.energy_generated") }}'
icon: mdi:flash
Then give the sensor a friendly name using manual customisation:
Thanks @tom_l this works!
Shame the friendly name part is no longer in the template set… not sure if I like the modern configuration
I see it has more options, but the old format seems more readable?