KNX how to convert Wh to KWh

Hi everyone,

MAJ 2021.8 add a Home energy Management.

Home Assistant

Energy Management in Home Assistant

Monitor your energy usage, transition to sustainable energy and save money.

I’ve a energy monitor in KNX who give me the energy in Wh

sensor.energie_totale_compteur
Energie totale compteur
30180138	source: 1.1.4
last_knx_update: 2021-08-16 16:59:11.632278+00:00
unit_of_measurement: Wh
friendly_name: Energie totale compteur
device_class: energy

I’d like to have a sensor with the good unit : KWh and with all the data requierd for the energy panel.
With minimum this attibutes:

state_class: measurement
last_reset: '2021-08-16T12:01:51.496080+00:00'
unit_of_measurement: kWh
device_class: energy

If anyone nows how to make that, explain me plz.

Thanks a lot

(I’m sorry for my bad english, but it isn’t my mother language)

Use a template sensor with a value template dividing by 1000 to get kWh if you want it for display purposes. Energy can handle Wh as well.
Knx sensors will be able to configure state_class manually coming next release (2021.9).

last_knx_update can not be used for last_reset, but with next release last_reset will not be needed anymore anyway.