Danke,das werde ich mal testen.Die gesamte Stromberechnung und Riemann kann wahrscheinlich auch alles zusammen in eine Datei,oder?
Wie Du möchtest. Kannst ja alles in eine Datei packen egal welche Integration.
Also mqqt, sensor, template, etc.
Musst also nicht nach Intergraionen trennen.
Gruß
Osorkon
Ich zeige Dir mal mein Setup.
ich habe eine ahoyDTU.yaml mit folgendem Code. Dabei geht es mir um den Aufbau.
#####################################################
### MQQT Sensoren anlegen
#####################################################
#AhoyDTU HM-800
#<TOPIC>/#
- name: "AHOY comm_start"
unique_id: "ahoy_comm_start"
state_topic: ahoy/comm_start
- name: "AHOY comm_start_extended"
unique_id: "ahoy_comm_start_extended"
state_topic: ahoy/comm_start
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY comm_stop"
unique_id: "ahoy_comm_stop"
state_topic: ahoy/comm_stop
- name: "AHOY comm_stop_extended"
unique_id: "ahoy_comm_stop_extended"
state_topic: ahoy/comm_stop
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY dis_night_comm"
unique_id: "ahoy_dis_night_comm"
state_topic: ahoy/dis_night_comm
- name: "AHOY mqtt"
unique_id: "ahoy_mqtt"
state_topic: ahoy/mqtt
- name: "AHOY status"
unique_id: "ahoy_status"
state_topic: ahoy/status
- name: "AHOY status extended"
unique_id: "ahoy_status_extended"
state_topic: ahoy/status
value_template: >-
{% if (value | int) == 0 %}
offline
{% elif (value | int) == 1 %}
partial
{% elif (value | int) == 2 %}
online
{% endif %}
- name: "AHOY sunrise"
unique_id: "ahoy_sunrise"
state_topic: ahoy/sunrise
- name: "AHOY sunrise_extended"
unique_id: "ahoy_sunrise_extended"
state_topic: ahoy/sunrise
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY sunset"
unique_id: "ahoy_sunset"
state_topic: ahoy/sunset
- name: "AHOY sunset_extended"
unique_id: "ahoy_sunset_extended"
state_topic: ahoy/sunset
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY Uptime"
unique_id: "ahoy_uptime"
state_topic: ahoy/uptime
unit_of_measurement: "s"
- name: "AHOY Uptime_extended"
unique_id: "ahoy_uptime_extended"
state_topic: ahoy/uptime
value_template: >
{% set uptime = value | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{{ days }}Tage {{ (uptime - (days * 86400)) | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- else -%}
{{ uptime | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- endif -%}
- name: "AHOY Version"
unique_id: "ahoy_version"
state_topic: ahoy/version
- name: "AHOY Device"
unique_id: "ahoy_device"
state_topic: ahoy/device
- name: "Ahoy IP"
unique_id: "ahoy_ip"
state_topic: ahoy/ip_addr
- name: "AHOY WiFi"
unique_id: "ahoy_wifi"
state_topic: ahoy/wifi_rssi
unit_of_measurement: "dBm"
- name: "AHOY Gesamtertrag"
unique_id: "ahoy_gesamtertrag"
state_topic: ahoy/YieldTotal
unit_of_measurement: "kWh"
#<TOPIC>/<INVERTER_NAME_FROM_SETUP>/#
- name: "AHOY available"
unique_id: "ahoy_available"
state_topic: ahoy/HM-800/available
- name: "AHOY available extended"
unique_id: "ahoy_available_extended"
state_topic: ahoy/HM-800/available
value_template: >-
{% if (value | int) == 0 %}
not available and not producing
{% elif (value | int) == 1 %}
available but not producing
{% elif (value | int) == 2 %}
available and producing
{% endif %}
- name: "AHOY last_success"
unique_id: "ahoy_last_success"
state_topic: ahoy/HM-800/last_success
- name: "AHOY last_success_extended"
unique_id: "ahoy_last_success_extended"
state_topic: ahoy/HM-800/last_success
value_template: >
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
#Basic <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch0/#
- name: "AHOY U_AC"
unique_id: "ahoy_u_ac"
state_topic: ahoy/HM-800/ch0/U_AC
unit_of_measurement: "V"
- name: "AHOY I_AC"
unique_id: "ahoy_i_ac"
state_topic: ahoy/HM-800/ch0/I_AC
unit_of_measurement: "A"
- name: "AHOY P_AC"
unique_id: "ahoy_p_ac"
state_topic: ahoy/HM-800/ch0/P_AC
unit_of_measurement: "W"
- name: "AHOY P_AC total"
unique_id: "ahoy_p_ac_total"
state_topic: ahoy/total/P_AC
unit_of_measurement: "W"
- name: "AHOY Q_AC"
unique_id: "ahoy_q_ac"
state_topic: ahoy/HM-800/ch0/Q_AC
- name: "AHOY F_AC"
unique_id: "ahoy_f_ac"
state_topic: ahoy/HM-800/ch0/F_AC
unit_of_measurement: "Hz"
- name: "AHOY PF_AC"
unique_id: "ahoy_pf_ac"
state_topic: ahoy/HM-800/ch0/PF_AC
- name: "AHOY Temperatur"
unique_id: "ahoy_temperatur"
state_topic: ahoy/HM-800/ch0/Temp
unit_of_measurement: "°C"
- name: "AHOY EVT"
unique_id: "ahoy_evt"
state_topic: ahoy/HM-800/ch0/EVT
- name: "AHOY YieldDay"
unique_id: "ahoy_yieldday"
state_topic: ahoy/HM-800/ch0/YieldDay
device_class: energy
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal"
unique_id: "ahoy_yieldtotal"
state_topic: ahoy/HM-800/ch0/YieldTotal
device_class: energy
unit_of_measurement: "kWh"
- name: "AHOY P_DC"
unique_id: "ahoy_p_dc"
state_topic: ahoy/HM-800/ch0/P_DC
unit_of_measurement: "W"
- name: "AHOY Efficiency"
unique_id: "ahoy_efficiency"
state_topic: ahoy/HM-800/ch0/Efficiency
unit_of_measurement: "%"
- name: "AHOY FWVersion"
unique_id: "ahoy_fwversion"
state_topic: ahoy/HM-800/ch0/FWVersion
- name: "AHOY FWBuildYear"
unique_id: "ahoy_fwbuildyear"
state_topic: ahoy/HM-800/ch0/FWBuildYear
- name: "AHOY FWBuildMonthDay"
unique_id: "ahoy_fwbuildmonthday"
state_topic: ahoy/HM-800/ch0/FWBuildMonthDay
- name: "AHOY HWPartID"
unique_id: "ahoy_hwpartid"
state_topic: ahoy/HM-800/ch0/HWPartId
- name: "AHOY PowerLimit"
unique_id: "ahoy_powerlimit"
state_topic: ahoy/HM-800/ch0/PowerLimit
- name: "AHOY LastAlarmCode"
unique_id: "ahoy_lastalarmcode"
state_topic: ahoy/HM-800/ch0/LastAlarmCode
#Panel 1 - UNTEN - <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch<CHANNEL_NUMBER>/#
- name: "AHOY U_DC 1"
unique_id: "ahoy_u_dc_1"
state_topic: ahoy/HM-800/ch1/U_DC
unit_of_measurement: "V"
- name: "AHOY I_DC 1"
unique_id: "ahoy_i_dc_1"
state_topic: ahoy/HM-800/ch1/I_DC
unit_of_measurement: "A"
- name: "AHOY P_DC 1"
unique_id: "ahoy_p_dc_1"
state_topic: ahoy/HM-800/ch1/P_DC
unit_of_measurement: "W"
- name: "AHOY YieldDay 1"
unique_id: "ahoy_yieldday_1"
state_topic: ahoy/HM-800/ch1/YieldDay
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal 1"
unique_id: "ahoy_yieldtotal_1"
state_topic: ahoy/HM-800/ch1/YieldTotal
unit_of_measurement: "kWh"
- name: "AHOY Irradiation 1"
unique_id: "ahoy_irradiation_1"
state_topic: ahoy/HM-800/ch1/P_DC
unit_of_measurement: "%"
#Panel 2 - OBEN - <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch<CHANNEL_NUMBER>/#
- name: "AHOY U_DC 2"
unique_id: "ahoy_u_dc_2"
state_topic: ahoy/HM-800/ch2/U_DC
unit_of_measurement: "V"
- name: "AHOY I_DC 2"
unique_id: "ahoy_i_dc_2"
state_topic: ahoy/HM-800/ch2/I_DC
unit_of_measurement: "A"
- name: "AHOY P_DC 2"
unique_id: "ahoy_p_dc_2"
state_topic: ahoy/HM-800/ch2/P_DC
unit_of_measurement: "W"
- name: "AHOY YieldDay 2"
unique_id: "ahoy_yieldday_2"
state_topic: ahoy/HM-800/ch2/YieldDay
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal 2"
unique_id: "ahoy_yieldtotal_2"
state_topic: ahoy/HM-800/ch2/YieldTotal
unit_of_measurement: "kWh"
- name: "AHOY Irradiation 2"
unique_id: "ahoy_irradiation_2"
state_topic: ahoy/HM-800/ch2/P_DC
unit_of_measurement: "%"
Diese Datei befindet sich im Ordner
/homeassistant/mqtt/sensor
in der configuration.yaml habe ich folgende Code
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#switch: !include switch.yaml
#mqtt: !include mqtt.yaml
mqtt:
sensor: !include_dir_merge_list mqtt/sensor/
#template: !include template.yaml
template:
sensor: !include_dir_merge_list template/sensor/
#sensor: !include sensor.yaml
sensor: !include_dir_merge_list sensor/
utility_meter: !include utility_meter.yaml
Hier kannst Du sehen wie ich es einmal hatte (nun auskommentiert) und über
mqtt:
sensor: !include_dir_merge_list mqtt/sensor/
binde ich als Sensoren alles ein was im Ordner mqtt/sensor/ als yaml-Dateien rum liegt. ich muss also unter mqtt/sensor/ einfach eine weitere yaml-Datei rein legen und beim nächsten HA Reboot wird diese dann auch eingebunden und geladen. Ich habe in dem Verzeichnis z.B. auch eine openDTU.yaml liegen.
Achja… Es ist nicht einfach damit getan Code aus einer yaml-Datei in eine andere zu kopieren. Durch die unterschiedlichen Einbindungen muss man eventuell die Struktur (Schlüsselwörter, Einrückungen) korrigieren.
Meine alte mqtt.yaml sah nämlich damals wie folgt aus
#####################################################
### MQQT Sensoren anlegen
#####################################################
#AhoyDTU HM-800
sensor:
#<TOPIC>/#
- name: "AHOY comm_start"
unique_id: "ahoy_comm_start"
state_topic: ahoy/comm_start
- name: "AHOY comm_start_extended"
unique_id: "ahoy_comm_start_extended"
state_topic: ahoy/comm_start
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY comm_stop"
unique_id: "ahoy_comm_stop"
state_topic: ahoy/comm_stop
- name: "AHOY comm_stop_extended"
unique_id: "ahoy_comm_stop_extended"
state_topic: ahoy/comm_stop
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY dis_night_comm"
unique_id: "ahoy_dis_night_comm"
state_topic: ahoy/dis_night_comm
- name: "AHOY mqtt"
unique_id: "ahoy_mqtt"
state_topic: ahoy/mqtt
- name: "AHOY status"
unique_id: "ahoy_status"
state_topic: ahoy/status
- name: "AHOY status extended"
unique_id: "ahoy_status_extended"
state_topic: ahoy/status
value_template: >-
{% if (value | int) == 0 %}
offline
{% elif (value | int) == 1 %}
partial
{% elif (value | int) == 2 %}
online
{% endif %}
- name: "AHOY sunrise"
unique_id: "ahoy_sunrise"
state_topic: ahoy/sunrise
- name: "AHOY sunrise_extended"
unique_id: "ahoy_sunrise_extended"
state_topic: ahoy/sunrise
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY sunset"
unique_id: "ahoy_sunset"
state_topic: ahoy/sunset
- name: "AHOY sunset_extended"
unique_id: "ahoy_sunset_extended"
state_topic: ahoy/sunset
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
- name: "AHOY Uptime"
unique_id: "ahoy_uptime"
state_topic: ahoy/uptime
unit_of_measurement: "s"
- name: "AHOY Uptime_extended"
unique_id: "ahoy_uptime_extended"
state_topic: ahoy/uptime
value_template: >
{% set uptime =value | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{{ days }}Tage {{ (uptime - (days * 86400)) | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- else -%}
{{ uptime | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- endif -%}
- name: "AHOY Version"
unique_id: "ahoy_version"
state_topic: ahoy/version
- name: "AHOY Device"
unique_id: "ahoy_device"
state_topic: ahoy/device
- name: "Ahoy IP"
unique_id: "ahoy_ip"
state_topic: ahoy/ip_addr
- name: "AHOY WiFi"
unique_id: "ahoy_wifi"
state_topic: ahoy/wifi_rssi
unit_of_measurement: "dBm"
- name: "AHOY Gesamtertrag"
unique_id: "ahoy_gesamtertrag"
state_topic: ahoy/YieldTotal
unit_of_measurement: "kWh"
#<TOPIC>/<INVERTER_NAME_FROM_SETUP>/#
- name: "AHOY available"
unique_id: "ahoy_available"
state_topic: ahoy/HM-800/available
- name: "AHOY available extended"
unique_id: "ahoy_available_extended"
state_topic: ahoy/HM-800/available
value_template: >-
{% if (value | int) == 0 %}
not available and not producing
{% elif (value | int) == 1 %}
available but not producing
{% elif (value | int) == 2 %}
available and producing
{% endif %}
- name: "AHOY last_success"
unique_id: "ahoy_last_success"
state_topic: ahoy/HM-800/last_success
- name: "AHOY last_success_extended"
unique_id: "ahoy_last_success_extended"
state_topic: ahoy/HM-800/last_success
value_template: >
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
#Basic <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch0/#
- name: "AHOY U_AC"
unique_id: "ahoy_u_ac"
state_topic: ahoy/HM-800/ch0/U_AC
unit_of_measurement: "V"
- name: "AHOY I_AC"
unique_id: "ahoy_i_ac"
state_topic: ahoy/HM-800/ch0/I_AC
unit_of_measurement: "A"
- name: "AHOY P_AC"
unique_id: "ahoy_p_ac"
state_topic: ahoy/HM-800/ch0/P_AC
unit_of_measurement: "W"
- name: "AHOY Q_AC"
unique_id: "ahoy_q_ac"
state_topic: ahoy/HM-800/ch0/Q_AC
- name: "AHOY F_AC"
unique_id: "ahoy_f_ac"
state_topic: ahoy/HM-800/ch0/F_AC
unit_of_measurement: "Hz"
- name: "AHOY PF_AC"
unique_id: "ahoy_pf_ac"
state_topic: ahoy/HM-800/ch0/PF_AC
- name: "AHOY Temperatur"
unique_id: "ahoy_temperatur"
state_topic: ahoy/HM-800/ch0/Temp
unit_of_measurement: "°C"
- name: "AHOY EVT"
unique_id: "ahoy_evt"
state_topic: ahoy/HM-800/ch0/EVT
- name: "AHOY YieldDay"
unique_id: "ahoy_yieldday"
state_topic: ahoy/HM-800/ch0/YieldDay
device_class: energy
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal"
unique_id: "ahoy_yieldtotal"
state_topic: ahoy/HM-800/ch0/YieldTotal
device_class: energy
unit_of_measurement: "kWh"
- name: "AHOY P_DC"
unique_id: "ahoy_p_dc"
state_topic: ahoy/HM-800/ch0/P_DC
unit_of_measurement: "W"
- name: "AHOY Efficiency"
unique_id: "ahoy_efficiency"
state_topic: ahoy/HM-800/ch0/Efficiency
unit_of_measurement: "%"
- name: "AHOY FWVersion"
unique_id: "ahoy_fwversion"
state_topic: ahoy/HM-800/ch0/FWVersion
- name: "AHOY FWBuildYear"
unique_id: "ahoy_fwbuildyear"
state_topic: ahoy/HM-800/ch0/FWBuildYear
- name: "AHOY FWBuildMonthDay"
unique_id: "ahoy_fwbuildmonthday"
state_topic: ahoy/HM-800/ch0/FWBuildMonthDay
- name: "AHOY HWPartID"
unique_id: "ahoy_hwpartid"
state_topic: ahoy/HM-800/ch0/HWPartId
- name: "AHOY PowerLimit"
unique_id: "ahoy_powerlimit"
state_topic: ahoy/HM-800/ch0/PowerLimit
- name: "AHOY LastAlarmCode"
unique_id: "ahoy_lastalarmcode"
state_topic: ahoy/HM-800/ch0/LastAlarmCode
#Panel 1 - UNTEN - <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch<CHANNEL_NUMBER>/#
- name: "AHOY U_DC 1"
unique_id: "ahoy_u_dc_1"
state_topic: ahoy/HM-800/ch1/U_DC
unit_of_measurement: "V"
- name: "AHOY I_DC 1"
unique_id: "ahoy_i_dc_1"
state_topic: ahoy/HM-800/ch1/I_DC
unit_of_measurement: "A"
- name: "AHOY P_DC 1"
unique_id: "ahoy_p_dc_1"
state_topic: ahoy/HM-800/ch1/P_DC
unit_of_measurement: "W"
- name: "AHOY YieldDay 1"
unique_id: "ahoy_yieldday_1"
state_topic: ahoy/HM-800/ch1/YieldDay
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal 1"
unique_id: "ahoy_yieldtotal_1"
state_topic: ahoy/HM-800/ch1/YieldTotal
unit_of_measurement: "kWh"
- name: "AHOY Irradiation 1"
unique_id: "ahoy_irradiation_1"
state_topic: ahoy/HM-800/ch1/P_DC
unit_of_measurement: "%"
#Panel 2 - OBEN - <TOPIC>/<INVERTER_NAME_FROM_SETUP>/ch<CHANNEL_NUMBER>/#
- name: "AHOY U_DC 2"
unique_id: "ahoy_u_dc_2"
state_topic: ahoy/HM-800/ch2/U_DC
unit_of_measurement: "V"
- name: "AHOY I_DC 2"
unique_id: "ahoy_i_dc_2"
state_topic: ahoy/HM-800/ch2/I_DC
unit_of_measurement: "A"
- name: "AHOY P_DC 2"
unique_id: "ahoy_p_dc_2"
state_topic: ahoy/HM-800/ch2/P_DC
unit_of_measurement: "W"
- name: "AHOY YieldDay 2"
unique_id: "ahoy_yieldday_2"
state_topic: ahoy/HM-800/ch2/YieldDay
unit_of_measurement: "Wh"
- name: "AHOY YieldTotal 2"
unique_id: "ahoy_yieldtotal_2"
state_topic: ahoy/HM-800/ch2/YieldTotal
unit_of_measurement: "kWh"
- name: "AHOY Irradiation 2"
unique_id: "ahoy_irradiation_2"
state_topic: ahoy/HM-800/ch2/P_DC
unit_of_measurement: "%"
#OpenDTU HM-800
- name: "OpenDTU Status"
unique_id: "opendtu_status"
state_topic: solar/opendtu/status
- name: "OpenDTU Uptime"
unique_id: "opendtu_uptime"
state_topic: solar/dtu/uptime
unit_of_measurement: "s"
- name: "OpenDTU Uptime_extended"
unique_id: "opendtu_uptime_extended"
state_topic: solar/dtu/uptime
value_template: >
{% set uptime =value | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{{ days }}Tage {{ (uptime - (days * 86400)) | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- else -%}
{{ uptime | int | timestamp_custom('%-Hh %-Mm', false) }}
{%- endif -%}
- name: "OpenDTU Device Name"
unique_id: "opendtu_device_name"
state_topic: solar/114180113299/name
- name: "OpenDTU WiFi"
unique_id: "opendtu_wifi"
state_topic: solar/dtu/rssi
unit_of_measurement: "dBm"
- name: "OpenDTU IP"
unique_id: "opendtu_ip"
state_topic: solar/dtu/ip
- name: "OpenDTU Hostname"
unique_id: "opendtu_hostname"
state_topic: solar/dtu/hostname
- name: "OpenDTU FWVersion"
unique_id: "opendtu_fwversion"
state_topic: solar/114180113299/device/fwbuildversion
- name: "OpenDTU FWBuildDateTime"
unique_id: "opendtu_fwbuilddatetime"
state_topic: solar/114180113299/device/fwbuilddatetime
- name: "OpenDTU HWPartNumber"
unique_id: "opendtu_hwpartnumber"
state_topic: solar/114180113299/device/hwpartnumber
- name: "OpenDTU HWVersion"
unique_id: "opendtu_hwversion"
state_topic: solar/114180113299/device/hwversion
- name: "OpenDTU Status LastUpdate"
unique_id: "opendtu_status_lastupdate"
state_topic: solar/114180113299/status/last_update
value_template: >-
{{ value | int | timestamp_custom('%d.%m.%Y %H:%M:%S') }}
Es war eine ganz schöne Arbeit alles aus Einzel-Yaml-Dateien in eine Ordnerstruktur zu binden und ich habe das immer Schritt für Schritt gemacht um beim kleinsten Fehler sofort zu sehen woran es liegen könnte und ich als lerztes gemacht habe.
Viel Erfolg
Claudius
Der Anfang sieht gut aus,keine Fehler.Wie mache ich jetzt weiter?
Bei der Strommessung steht ja jetzt Template,wenn ich weiter unten gucke,kommt auch bei dem Gaszähler auch Template.Die Zähler könnte ich ja zusammenfassen,aber kommen beide Sachen in eine Datei,oder kann ich auch zweimal in untersachiedlichen Dateinamen Template nehmen?
Es gelten die gleichen Regel wie in der configuration.yaml
Die Zeile template: oder sensor: etc. darf nur einmal vorkommen.
Gruß
Osorkon
Er meinte ob das sensor: in zwei verschiedenen . yaml Dateien stehen darf
Ja, kann beliebig verteilt werden.
In jeder einzelnen Dateien können beliebige Integrationen mit einander kombiniert werden.
Und die einzelnen Integrationen können auf mehrere Dateien verteilt werden.
Gruß
Osorkon
Wenn ich jetzt die Strommessung nehme,dort steht ja Template in der einen und sensor in der nächsten Zeile.Das alles in eine Datei und den Gasrechner in eine andere Datei.Solange es zwei Dateien sind habe ich keine Probleme mit den Template Namen?Und was müsste ich noch ändern,bwz auch einrücken damit es läuft?
Alles 1:1 aus der configuration.yaml übernehmen.
Wenn Du z.B die Sensor integration auf zwei Dateien Aufteilst. dann muss
sensor: in beiden Dateien stehen.
#garbage_collection.yaml
sensor:
# ------- Garbage Collection -------
# next collection
- platform: waste_collection_schedule
name: "Nächste Abholung"
value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
# Nächste Restabfall-Abholung
- platform: waste_collection_schedule
name: "Restabfall"
value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
types:
- Restabfall 2wö
# Nächste Biomüll Abholung
- platform: waste_collection_schedule
name: "Biotonne"
value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
types:
- Biotonne
# Nächste Gelbe Tonne Abholung
- platform: waste_collection_schedule
name: "Gelbe Tonne"
value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
types:
- Gelbe Tonne
# Nächste Papiermüll Abholung
- platform: waste_collection_schedule
name: "Papiertonne"
value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
types:
- Papiertonne
#power_import.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'
value_template: >-
{% if (states('sensor.shelly3em_channel_a_power')|float + states('sensor.shelly3em_channel_b_power')|float + states('sensor.shelly3em_channel_c_power')|float) > 0 %}
{{ states('sensor.shelly3em_channel_a_power')|float + states('sensor.shelly3em_channel_b_power')|float + states('sensor.shelly3em_channel_c_power')|float }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly3em_channel_a_power'),
states('sensor.shelly3em_channel_b_power'),
states('sensor.shelly3em_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'
value_template: >-
{% if (states('sensor.shelly3em_channel_a_power')|float + states('sensor.shelly3em_channel_b_power')|float + states('sensor.shelly3em_channel_c_power')|float) < 0 %}
{{ (states('sensor.shelly3em_channel_a_power')|float + states('sensor.shelly3em_channel_b_power')|float + states('sensor.shelly3em_channel_c_power')|float) * -1 }}
{% else %}
{{ 0 }}
{% endif %}
availability_template: "{{
[ states('sensor.shelly3em_channel_a_power'),
states('sensor.shelly3em_channel_b_power'),
states('sensor.shelly3em_channel_c_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 %}
{% 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 %}
Gruß
Osorkon
Ich habe jetzt soweit alles was ausgelagert werden kann.ausgelagert.Und es läuft noch alles.Ich danke euch,das hätte ich ja so nicht hinbekommen.
gruß Tobias
Nachtrag:
Mir ist heut aufgefallen,das im Dashboard mein Balkonkraftwerk die komplett erzeugten kwh plötzlich ins in die erzeugten PV Kwh gehauen hat.Den ganzen Tag lief alles normal und gegen 16-17 uhr kamen 924kwh dazu.Wie kommt das?Die entität der PV am Tag gibt es plötzlich nicht mehr und es steht jetzt PV gesamt als entität.Hat das schonmal jemand gehabt?
by HarryP: Zusammenführung Doppelpost (bitte „bearbeiten“ Funktion nutzen)