power_import2:
friendly_name: "Power Import2"
wäre das was dein Stromzähler zählt und was du auch bezahlen musst (Zähler 1.8.0)
Der zählt natürlich erst nachher wenn deine PV weniger erzeugt als du benötigst
Tut mir ja Leid - aber der Power Import2 zeigt dauerhaft 0.
Habe den Hausverbrauch mal für 2-3 Minuten stark angehoben.
Ich zeige am besten mal meine gesamte /config/configuration.yaml
Nicht das ich evtl. beim einfügen einen Fehler gemacht habe.
Code
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Text to speech
tts:
- platform: google_translate
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor:
- platform: template
sensors:
# Template sensor for values of power import (active_power > 0)
power_import:
friendly_name: "Power Import"
unit_of_measurement: 'W'
device_class: power
value_template: >-
{% if (states('sensor.shelly_em3_channel_a_power')|float + states('sensor.shelly_em3_channel_b_power')|float + states('sensor.shelly_em3_channel_c_power')|float) > 0 %}
{{ states('sensor.shelly_em3_channel_a_power')|float + states('sensor.shelly_em3_channel_b_power')|float + states('sensor.shelly_em3_channel_c_power')|float }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_em3_channel_a_power'),
states('sensor.shelly_em3_channel_b_power'),
states('sensor.shelly_em3_channel_c_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'
device_class: power
value_template: >-
{% if (states('sensor.shelly_em3_channel_a_power')|float + states('sensor.shelly_em3_channel_b_power')|float + states('sensor.shelly_em3_channel_c_power')|float) < 0 %}
{{ (states('sensor.shelly_em3_channel_a_power')|float + states('sensor.shelly_em3_channel_b_power')|float + states('sensor.shelly_em3_channel_c_power')|float) * -1 }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_em3_channel_a_power'),
states('sensor.shelly_em3_channel_b_power'),
states('sensor.shelly_em3_channel_c_power')
] | map('is_number') | min
}}"
# Template sensor for values of power consumption
power_consumption:
friendly_name: "Power Consumption"
unit_of_measurement: 'W'
device_class: power
value_template: >-
{% if (states('sensor.power_export')|float(0)) > 0 and (states('sensor.shelly_em_channel_1_power')|float(0) - states('sensor.power_export')|float(0)) < 0 %}
{% elif (states('sensor.power_export')|float(0)) > 0 and (states('sensor.shelly_em_channel_1_power')|float(0) - states('sensor.power_export')|float(0)) > 0 %}
{{ (states('sensor.shelly_em_channel_1_power')|float(0)) - states('sensor.power_export')|float(0) }}
{% else %}
{{ states('sensor.power_import')|float(0) + states('sensor.shelly_em_channel_1_power')|float(0) }}
{% endif %}
#
# Template sensor for values of power import (active_power > 0)
power_import2:
friendly_name: "Power Import2"
unit_of_measurement: 'W'
device_class: power
value_template: >-
{% if (states('sensor.shelly_em3_channel_a_power')|float +
states('sensor.shelly_em3_channel_b_power')|float +
states('sensor.shelly_em3_channel_c_power')|float -
states('sensor.shelly_em_channel_1_power')|float) > 0 %}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_em3_channel_a_power'),
states('sensor.shelly_em3_channel_b_power'),
states('sensor.shelly_em3_channel_c_power')
] | map('is_number') | min
}}"
#
# Template sensor for values of power export (active_power < 0)
power_export2:
friendly_name: "Power Export2"
unit_of_measurement: 'W'
device_class: power
value_template: >-
{% if (states('sensor.shelly_em3_channel_a_power')|float +
states('sensor.shelly_em3_channel_b_power')|float +
states('sensor.shelly_em3_channel_c_power')|float -
states('sensor.shelly_em_channel_1_power')|float) < 0 %}
{{ (states('sensor.shelly_em3_channel_a_power')|float +
states('sensor.shelly_em3_channel_b_power')|float +
states('sensor.shelly_em3_channel_c_power')|float -
states('sensor.shelly_em_channel_1_power')|float) * -1 }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly_em3_channel_a_power'),
states('sensor.shelly_em3_channel_b_power'),
states('sensor.shelly_em3_channel_c_power')
] | map('is_number') | min
}}"
Alles anzeigen