Help requested for making a sensor from Kwh to price

Dear all,

I’ve already searched here but unfortunately I can’t find it.

I would like to create a sensor in configuration.yaml.
This sensor is a kWh sensor for which I would like to have the euro price.
1 sensor for the monthly amount
and 1 sensor for yearly amount
but I can’t make this.

Could you perhaps give me an example or help me on my way, as I would greatly appreciate this.

with kind regards,
Henk

A template sensor to calculate kWh * price

A utility meter to get the price monthly and yearly

if you don’t need the ongoing price, and just a monthly and yearly amount, you don’t even need the template sensor.

thank you Francis,

I already found this but I don’t understand it.
how to make this work

If anyone has an example that I can work with, that would be a great help.

with kind regards,
Henk

sensor: 
  - platform: template
    sensors:
      meter_energy_daily_money:
        unit_of_measurement: '¥'
        value_template: "{{ ( states('sensor.meter_energy_daily')|float * 0.62 ) | round(2) }}"
      meter_energy_monthly_money:
        unit_of_measurement: '¥'
        value_template: "{{ ( states('sensor.meter_energy_monthly')|float *0.62 ) | round(2) }}"
      cabinet_meter_energy_daily_money:
        unit_of_measurement: '¥'
        value_template: "{{ ( states('sensor.cabinet_meter_energy_daily')|float * 0.62 ) | round(2) }}"
      cabinet_meter_energy_monthly_money:
        unit_of_measurement: '¥'
        value_template: "{{ ( states('sensor.cabinet_meter_energy_monthly')|float *0.62 ) | round(2) }}"
utility_meter:
  meter_energy_hourly:
    source: sensor.meter_importenergy
    cycle: hourly
  meter_energy_daily:
    source: sensor.meter_importenergy
    cycle: daily
  meter_energy_monthly:
    source: sensor.meter_importenergy
    cycle: monthly

  cabinet_meter_energy_hourly:
    source: sensor.cabinet_meter_importenergy
    cycle: hourly
  cabinet_meter_energy_daily:
    source: sensor.cabinet_meter_importenergy
    cycle: daily
  cabinet_meter_energy_monthly:
    source: sensor.cabinet_meter_importenergy
    cycle: monthly