Lovelace sensor card (unit convertion)

Hi,

I see in lovelace sensor card that we can change the default unit, but the value is not changed.
I would like to make a convertion.

For exemple, with sma sensor we can get total_yield and daily_yield.
total_yield is displayed in KWh, and daily_yield is displayed in Wh.
I would like to display both in KWh.

Do i need to make a template_sensor to make the convertion and use this sensor in my card, or there is a better way to do it ?

Regards

Yes, you’ll need to make a template sensor