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