I track the energy consumption of the whole house from my electricity meter.
Also I track a few specific devices.
I tried to create a miscellaneous sensor which should display the power consumption of all other non tracked devices.
Whole energy consumption - all tracked devices = all non tracked devices
template:
- sensor:
- name: "Stromverbrauch Sonstiges (Licht, Steckdosen, etc.)"
device_class: 'energy'
state_class: 'total_increasing'
unit_of_measurement: "kWh"
state: >
{% set state1 = states('sensor.stromzahler_gesamtverbrauch_volkszahler_daily')|float(0) %}
{% set state2 = states('sensor.stromverbrauch_backofen_daily')|float(0) %}
{% set state3 = states('sensor.stromverbrauch_bad_e_heizkorper_daily')|float(0) %}
{% set state4 = states('sensor.stromverbrauch_buro_daily')|float(0) %}
{% set state5 = states('sensor.stromverbrauch_geschirrspuler_daily')|float(0) %}
{% set state6 = states('sensor.stromverbrauch_hebeanlage_daily')|float(0) %}
{% set state7 = states('sensor.stromverbrauch_heizung_daily')|float(0) %}
{% set state8 = states('sensor.stromverbrauch_kuhlschrank_daily')|float(0) %}
{% set state9 = states('sensor.stromverbrauch_netzwerkschrank_daily')|float(0) %}
{% set state10 = states('sensor.stromverbrauch_steckdose_eg_wohnen_tv_daily')|float(0) %}
{% set state11 = states('sensor.stromverbrauch_trockner_daily')|float(0) %}
{% set state12 = states('sensor.stromverbrauch_waschmaschine_daily')|float(0) %}
{{ (( state1 * 1000 - ( state2 + state3 + state4 + state5 + state6 + state7 + state8 + state9 + state10 + state11 + state12)) / 1000) | round(2) }}
availability: >
{{ states('sensor.stromzahler_gesamtverbrauch_volkszahler_daily')|is_number and
states('sensor.stromverbrauch_backofen_daily')|is_number and
states('sensor.stromverbrauch_bad_e_heizkorper_daily')|is_number and
states('sensor.stromverbrauch_buro_daily')|is_number and
states('sensor.stromverbrauch_geschirrspuler_daily')|is_number and
states('sensor.stromverbrauch_hebeanlage_daily')|is_number and
states('sensor.stromverbrauch_heizung_daily')|is_number and
states('sensor.stromverbrauch_kuhlschrank_daily')|is_number and
states('sensor.stromverbrauch_netzwerkschrank_daily')|is_number and
states('sensor.stromverbrauch_steckdose_eg_wohnen_tv_daily')|is_number and
states('sensor.stromverbrauch_trockner_daily')|is_number and
states('sensor.stromverbrauch_waschmaschine_daily')|is_number }}
My problem is that the overview of the miscellaneous devices in energy dashboard does not display the correct value.
I also tried to create a template sensor with state_class: ‘total’ but it’s a similar behaviour. The values are different but not diplayed correctly in energy dashboard.
Do you have an idea what could be the cause and how to solve this?