Skip to content

Commit

Permalink
Update Berechnung COP.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Trunks1982 authored Aug 22, 2024
1 parent dbfbce5 commit 6001ac5
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions templates/Berechnung COP.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
{\rtf1\ansi\ansicpg1252\cocoartf2761
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0

\f0\fs24 \cf0 sensor: \
- platform: template\
sensors:\
cop_wert:\
friendly_name: "COP Wert"\
unit_of_measurement: "COP"\
value_template: >\
\{% set thermische_leistung = states('sensor.rotex_thermische_leistung') | float(0) %\}\
\{% set stromverbrauch = states('sensor.wp_channel_a_power') | float(0) / 1000 %\}\
\{% set kompressor_status = states('sensor.rotex_status_kompressor') %\}\
\
\{% if kompressor_status == 'An' and stromverbrauch > 0 %\}\
\{% if thermische_leistung >= 0 %\}\
\{\{ (thermische_leistung / stromverbrauch) | round(2) \}\}\
\{% else %\}\
\{\{ (-1 * thermische_leistung / stromverbrauch) | round(2) \}\}\
\{% endif %\}\
\{% else %\}\
0 # Wenn der Kompressor nicht l\'e4uft, wird COP auf 0 gesetzt\
\{% endif %\}}
sensor:
- platform: template
sensors:
cop_wert:
friendly_name: "COP Wert"
unit_of_measurement: "COP"
value_template: >
{% set thermische_leistung = states('sensor.rotex_thermische_leistung') | float(0) %}
{% set stromverbrauch = states('sensor.wp_channel_a_power') | float(0) / 1000 %}
{% set kompressor_status = states('sensor.rotex_status_kompressor') %}
{% if kompressor_status == 'An' and stromverbrauch > 0 %}
{% if thermische_leistung >= 0 %}
{{ (thermische_leistung / stromverbrauch) | round(2) }}
{% else %}
{{ (-1 * thermische_leistung / stromverbrauch) | round(2) }}
{% endif %}
{% else %}
0 # Wenn der Kompressor nicht läuft, wird COP auf 0 gesetzt
{% endif %}

0 comments on commit 6001ac5

Please sign in to comment.