Utility Meter - wrong values / costs

hello,
i want add my total costs to HA, but i get wrong values…

my sensor (switch.haus):

current_power_w: 86.95
device_locked: false
locked: true
total_consumption: '109.295'
total_consumption_unit: kWh
temperature: '3.5'
temperature_unit: °C
friendly_name: Automaten
#-------------------------------------------------------------
# FritzDect 210 
#-------------------------------------------------------------          
  - platform: template
    sensors:
      fritzdect_210_watts:
        friendly_name_template: "{{ states.switch.haus.name}} Aktueller Verbrauch"
        value_template: '{{ states.switch.haus.attributes["current_power_w"] | float }}'
        unit_of_measurement: 'W'
      fritzdect_210_total_kwh:
        friendly_name_template: "{{ states.switch.haus.name}} Gesamt Verbrauch"
        value_template: '{{ states.switch.haus.attributes["total_consumption"] | float }}'
        unit_of_measurement: 'kWh'
      fritzdect_210_temperature:
        friendly_name_template: "{{ states.switch.haus.name}} Aktuelle Temperatur"
        value_template: '{{ states.switch.haus.attributes["temperature"] | float }}'
        unit_of_measurement: '°C'
#-------------------------------------------------------------
# Energie
#------------------------------------------------------------- 
utility_meter:
  energy_automat_daily:
    source: sensor.fritzdect_210_total_kwh
    cycle: daily
  energy_automat_weekly:
    source: sensor.fritzdect_210_total_kwh
    cycle: weekly    
  energy_automat_monthly:
    source: sensor.fritzdect_210_total_kwh
    cycle: monthly
  energy_automat_yearly:
    source: sensor.fritzdect_210_total_kwh
    cycle: yearly
  - platform: template
    sensors:
     energy_automat_daily_cost:
      value_template: '{{ ((states.sensor.energy_automat_daily.state | float * 0.25)) | round(0) }}'
      friendly_name: 'Total cost'
      unit_of_measurement: '€'

but here are all values to high
image

What history does states.switch.haus.attributes["total_consumption"] have. Maybe the sensor just spits out way to high data.

thing this is ok

sensor.fritzdect_210_total_kwh:
image

You need to create a template sensor that converts the power to energy and then use this in the utility meter, instead of the sensor that shows total consumption. As you have it know, the utility meter adds the value from the total consumption everytime it changes, e.g. it was 102 kWh and then it changes to 104 kWh, the utility meter will then show 206 kWh (102 + 104).

This can be done with the integration integration

sensor:
  - platform: integration
    source: sensor.fritzdect_210_watts
    name: fritzdect_210_current_energy
    unit_prefix: k
    round: 2

This will give you a sensor sensor.fritzdect_210_current_energy, which measures the current energy consumption in kWh. Then use this in your utility meters.

utility_meter:
  energy_automat_daily:
    source: sensor.fritzdect_210_current_energy
    cycle: daily
  energy_automat_weekly:
    source: sensor.fritzdect_210_current_energy
    cycle: weekly    
  energy_automat_monthly:
    source: sensor.fritzdect_210_current_energy
    cycle: monthly
  energy_automat_yearly:
    source: sensor.fritzdect_210_current_energy
    cycle: yearly

Bug diffrent value on same sensor when used as utility meter