Unit_of_measurement: kWh notation

Hi,
My SolarEdge convertor is connected to HA. The value’s are now on the overview and displayed in Wh (Watts/Hour) e.g. :
solaredge (Energy this year) 7.131.950,0 Wh
but I want this to be displayed as :
solaredge (Energy this year) 7.131 kWh (including the decimal point)

What is the best way to achieve this?

Kind regards,
Marco

i tried to put this in my configuration.yaml but it didn’t work …!

# Example configuration.yaml entry for template platform
template:
  - sensor:
    - name: solaredge_energy_this_year_template
      unit_of_measurement: kWh
      state: "{{ (states('sensor.solaredge_energy_this_year') | float / 1000) | round(2) }}"

This is what I have in a templates.yaml - it creates two sensors; PVGenkW (current power generation from PV, in kW) & PVBatkW (current power to battery, in kW). I can’t tell you if it’s the best way but it works.

BTW, Wh (energy; a watt of power expended for an hour) is not equivalent to W/h

I hope that helps.

Do you still looking for an answer for this? I see the post is from almost 3 months ago.
Which error you have when using that template sensor you shared here?