Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
template:
- sensor:
- name: "Eigenverbrauch"
state_class: measurement
unit_of_measurement: W
device_class: power
state: >-
{% set x = states('sensor.gesamt_strom') | float(0) %}
{{ (([0, x, - 9999999]|sort)[1]) + (states('sensor.hm_1500_p_ac') | float(0)) }}
attributes:
ersparnis: >-
{{ (state_attr('sensor.eigenverbrauch', 'strompreis')|float(0) * states('sensor.eigenverbrauch_kwh')|float(0)) - 1000 }}€
strompreis: "0.32"
- sensor:
- name: "Total Energy"
unique_id: energy_total
state: >-
{{
[ states('sensor.l1_energy'),
states('sensor.l2_energy'),
states('sensor.l3_energy'),
] | map('float') | sum
}}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
attributes:
last_reset: "2023-01-01T00:00:00+00:00"
availability: >-
{{
[ states('sensor.l1_energy'),
states('sensor.l2_energy'),
states('sensor.l3_energy'),
] | map('is_number') | min
}}
- name: "Power Total"
unique_id: power_total
state: >-
{{
[ states('sensor.l1_power'),
states('sensor.l2_power'),
states('sensor.l3_power'),
] | map('float') | sum
}}
unit_of_measurement: W
device_class: power
state_class: measurement
availability: >-
{{
[ states('sensor.l1_power'),
states('sensor.l2_power'),
states('sensor.l3_power'),
] | map('is_number') | min
}}
- name: "Current Total"
unique_id: current_total
state: >-
{{
[ states('sensor.l1_current'),
states('sensor.l2_current'),
states('sensor.l3_current'),
] | map('float') | sum
}}
unit_of_measurement: A
device_class: current
state_class: measurement
availability: >-
{{
[ states('sensor.l1_current'),
states('sensor.l2_current'),
states('sensor.l3_current'),
] | map('is_number') | min
}}
- name: "Total Power Solar"
device_class: power
unit_of_measurement: "W"
state: >
{{
states('sensor.hm_1500_p_ac')|float(0) if states('sensor.hm_1500_p_ac')| int > 5 else 0
}}
- sensor:
- name: "Rückgabe Netz"
unit_of_measurement: "kW"
state: >
{% set x = (((states('sensor.shelly_em3_channel_b_power') | float(0) / 1000 )) * (-1)) %}
{{ ([0, x, 9999999]|sort)[1] | float(0) }}
- sensor:
- name: "Stromzähler"
unit_of_measurement: "kWh"
device_class: energy
unique_id: "Stromzähler"
state: >
{% set L1_Energy = states('sensor.shelly_em3_channel_a_energy') | float(0) %}
{% set L2_Energy = states('sensor.shelly_em3_channel_b_energy') | float(0) %}
{% set L3_Energy = states('sensor.shelly_em3_channel_c_energy') | float(0) %}
{% set Energy_Offset = states('input_number.startwert_stromzahler_netz') | float(0) %}
{% set Rueckgabe_Energy = states('sensor.ruckgabe_solar_energie') | float(0) %}
{{ (L1_Energy + L2_Energy + L3_Energy + Energy_Offset - Rueckgabe_Energy) | round(2) }}
template:
- sensor:
- name: "Power Return"
unit_of_measurement: "kW"
state: >
{% set x = (((states('sensor.gesamt_strom') | float(0) / 1000 )) * (-1)) %}
{{ ([0, x, 9999999]|sort)[1] | float(0) }}
- sensor:
- name: "Stromzähler"
unit_of_measurement: "kWh"
device_class: energy
unique_id: "Stromzähler"
state: >
{% set Energy = states('sensor.gesamt_strom') | float(0) %}
{% set Energy_Offset = states('input_number.startwert_zahler') | float(0) %}
{% set Rueckgabe_Energy = states('sensor.ruckgabe_netz') | float(0) %}
{{ (Energy + Energy_Offset - Rueckgabe_Energy) | round(2) }}
{% set stromverbrauchwatt = states('sensor.tasmota_strom_power') | float(0) %}
{% set batterieverbrauch = states('sensor.e3dc_battery_power') | float(0) %}
{% set strompreis = 0.34 | float(2) %}
Stromverbrauch: {{ (([0, stromverbrauchwatt, - 9999999]|sort)[1])}} Watt
Batterieverbrauch: {{(([0, batterieverbrauch, - 9999999]|sort)[1]) }} Watt
Solarproduktion: {{(states('sensor.e3dc_solar_power') | float(0))}} Watt
Hausverbrauch: {{(states('sensor.e3dc_power_consumption') | float(0))}} Watt
Eigenverbrauch: {{ (([0, stromverbrauchwatt, - 9999999]|sort)[1]) + (states('sensor.e3dc_solar_power') | float(0)) + (([0, batterieverbrauch, - 9999999]|sort)[1]) }} Watt
Eigenverbrauch_kWh: {{(states('sensor.eigenverbrauch_kwh') | float(0))}} kWh
Ersparnis: {{ (((strompreis)|float(0) * states('sensor.eigenverbrauch_kwh')|float(0))|round(2)) }} €
Stromverbrauch: -13.0 Watt
Batterieverbrauch: -1812.0 Watt
Solarproduktion: 255.0 Watt
Hausverbrauch: 2057.0 Watt
Eigenverbrauch: -1570.0 Watt
Eigenverbrauch_kWh: 20.69 kWh
Ersparnis: 7.03 €
sensor:
- platform: template
sensors:
# Template sensor for current power comsumption
power_current:
friendly_name: "Power Current"
unit_of_measurement: 'W'
value_template: >-
{{ states('sensor.shelly_pro_3em_phase_a_active_power')|float + states('sensor.shelly_pro_3em_phase_b_active_power')|float + states('sensor.shelly_pro_3em_phase_c_active_power')|float }}
availability_template: "{{
[ states('sensor.shelly_pro_3em_phase_a_active_power'),
states('sensor.shelly_pro_3em_phase_b_active_power'),
states('sensor.shelly_pro_3em_phase_c_active_power')
] | map('is_number') | min
}}"
# Template sensor for values of power import (active_power > 0)
power_import:
friendly_name: "Power Import"
unit_of_measurement: 'W'
value_template: >-
{% if (states('sensor.shelly_pro_3em_phase_a_active_power')|float + states('sensor.shelly_pro_3em_phase_b_active_power')|float + states('sensor.shelly_pro_3em_phase_c_active_power')|float) > 0 %}
{{ states('sensor.shelly_pro_3em_phase_a_active_power')|float + states('sensor.shelly_pro_3em_phase_b_active_power')|float + states('sensor.shelly_pro_3em_phase_c_active_power')|float }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_pro_3em_phase_a_active_power'),
states('sensor.shelly_pro_3em_phase_b_active_power'),
states('sensor.shelly_pro_3em_phase_c_active_power')
] | map('is_number') | min
}}"
# Template sensor for values of power export (active_power < 0)
power_export:
friendly_name: "Power Export"
unit_of_measurement: 'W'
value_template: >-
{% if (states('sensor.shelly_pro_3em_phase_a_active_power')|float + states('sensor.shelly_pro_3em_phase_b_active_power')|float + states('sensor.shelly_pro_3em_phase_c_active_power')|float) < 0 %}
{{ (states('sensor.shelly_pro_3em_phase_a_active_power')|float + states('sensor.shelly_pro_3em_phase_b_active_power')|float + states('sensor.shelly_pro_3em_phase_c_active_power')|float) * -1 }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_pro_3em_phase_a_active_power'),
states('sensor.shelly_pro_3em_phase_b_active_power'),
states('sensor.shelly_pro_3em_phase_c_active_power')
] | map('is_number') | min
}}"
# Template sensor for values of power consumption
power_consumption:
friendly_name: "Power Consumption"
unit_of_measurement: 'W'
value_template: >-
{% if (states('sensor.power_export')|float(0)) > 0 and (states('sensor.power_solargen')|float(0) - states('sensor.power_export')|float(0)) < 0 %}
{{ 0 }}
{% elif (states('sensor.power_export')|float(0)) > 0 and (states('sensor.power_solargen')|float(0) - states('sensor.power_export')|float(0)) > 0 %}
{{ (states('sensor.power_solargen')|float(0)) - states('sensor.power_export')|float(0) }}
{% else %}
{{ states('sensor.power_import')|float(0) + states('sensor.power_solargen')|float(0) }}
{% endif %}
# Template sensor for values of energy Solar generation (solar_power > 0)
power_solargen:
friendly_name: "Power Solar Generation"
unit_of_measurement: 'W'
value_template: >-
{% if ( 0 ) > 0 %}
{{ ( 0 ) }}
{% else %}
{{ 0 }}
{% endif %}
# Sensor for Riemann sum of energy import (W -> Wh)
- platform: integration
source: sensor.power_import
name: energy_import_sum
unit_prefix: k
round: 2
method: left
# Sensor for Riemann sum of energy export (W -> Wh)
- platform: integration
source: sensor.power_export
name: energy_export_sum
unit_prefix: k
round: 2
method: left
# Sensor for Riemann sum of energy consumption (W -> Wh)
- platform: integration
source: sensor.power_consumption
name: energy_consumption_sum
unit_prefix: k
round: 2
method: left
utility_meter:
energy_import_daily:
source: sensor.energy_import_sum
name: Energy Import Daily
cycle: daily
energy_import_monthly:
source: sensor.energy_import_sum
name: Energy Import Monthly
cycle: monthly
energy_export_daily:
source: sensor.energy_export_sum
name: Energy Export Daily
cycle: daily
energy_export_monthly:
source: sensor.energy_export_sum
name: Energy Export Monthly
cycle: monthly
energy_consumption_daily:
source: sensor.energy_consumption_sum
name: Energy Consumption Daily
cycle: daily
energy_consumption_monthly:
source: sensor.energy_consumption_sum
name: Energy Consumption Monthly
cycle: monthly