Zmiana template sensor z HA na YAML ESPhome

Podpowiedzcie proszę jak przekształcić ten kod z HA aby mógł go ESPHome wykonywać :slight_smile:

# Krzywa grzewcza obieg 1

  - platform: template
    sensors:
      temperatura_krzywa_grzewcza_obieg_1:
        value_template: >
          {% set OT = states("sensor.bme280_1_temperatura") | float(default=15) %}
          {% set CurveMove = states("input_number.krzywa_grzewcza_przesuniecie_obieg_1") | float %}
          {% set System = ("0") | float %}
          {% set HC = states("input_select.krzywa_grzewcza_nachylenie_obieg_1") | float %}
          {% if HC == 0.1 %}
            {{ "%.1f"%( CurveMove - System + 36.4 - ( 0.00495 * OT**2 ) - ( 0.32 *  OT)) | float}}
          {% elif HC == 0.2 %}
            {{ "%.1f"%( CurveMove - System + 37.7 - ( 0.0052 * OT**2 ) - ( 0.38 *  OT)) | float}}
          {% elif HC == 0.3 %}
            {{ "%.1f"%( CurveMove - System + 39.0 - ( 0.00545 * OT**2 ) - ( 0.44 *  OT)) | float}}
          {% elif HC == 0.4 %}
            {{ "%.1f"%( CurveMove - System + 40.3 - ( 0.0057 * OT**2 ) - ( 0.5 *  OT)) | float}}
          {% elif HC == 0.5 %}
            {{ "%.1f"%( CurveMove - System + 41.6 - ( 0.00595 * OT**2 ) - ( 0.56 *  OT)) | float}}
          {% elif HC == 0.6 %}
            {{ "%.1f"%( CurveMove - System + 43.1 - ( 0.0067 * OT**2 ) - ( 0.62 *  OT)) | float}}
          {% elif HC == 0.7 %}
            {{ "%.1f"%( CurveMove - System + 44.6 - ( 0.00745 * OT**2 ) - ( 0.68 *  OT)) | float}}
          {% elif HC == 0.8 %}
            {{ "%.1f"%( CurveMove - System + 46.1 - ( 0.0082 * OT**2 ) - ( 0.74 *  OT)) | float}}
          {% elif HC == 0.9 %}
            {{ "%.1f"%( CurveMove - System + 47.6 - ( 0.00895 * OT**2 ) - ( 0.8 *  OT)) | float}}
          {% elif HC == 1.0 %}
            {{ "%.1f"%( CurveMove - System + 49.1 - ( 0.0097 * OT**2 ) - ( 0.86 *  OT)) | float}}
          {% elif HC == 1.1 %}
            {{ "%.1f"%( CurveMove - System + 50.8 - ( 0.01095 * OT**2 ) - ( 0.92 *  OT)) | float}}
          {% elif HC == 1.2 %}
            {{ "%.1f"%( CurveMove - System + 52.5 - ( 0.0122 * OT**2 ) - ( 0.98 *  OT)) | float}}
          {% elif HC == 1.3 %}
            {{ "%.1f"%( CurveMove - System + 54.2 - ( 0.01345 * OT**2 ) - ( 1.04 *  OT)) | float}}
          {% elif HC == 1.4 %}
            {{ "%.1f"%( CurveMove - System + 55.9 - ( 0.0147 * OT**2 ) - ( 1.1 *  OT)) | float}}
          {% elif HC == 1.5 %}
            {{ "%.1f"%( CurveMove - System + 57.5 - ( 0.0157 * OT**2 ) - ( 1.16 *  OT)) | float}}
          {% elif HC == 1.6 %}
            {{ "%.1f"%( CurveMove - System + 59.4 - ( 0.01644 * OT**2 ) - ( 1.24 *  OT)) | float}}
          {% elif HC == 1.7 %}
            {{ "%.1f"%( CurveMove - System + 61.3 - ( 0.01718 * OT**2 ) - ( 1.32 *  OT)) | float}}
          {% elif HC == 1.8 %}
            {{ "%.1f"%( CurveMove - System + 63.2 - ( 0.01792 * OT**2 ) - ( 1.4 *  OT)) | float}}
          {% elif HC == 1.9 %}
            {{ "%.1f"%( CurveMove - System + 65.1 - ( 0.01866 * OT**2 ) - ( 1.48 *  OT)) | float}}
          {% elif HC == 2.0 %}
            {{ "%.1f"%( CurveMove - System + 67.0 - ( 0.0194 * OT**2 ) - ( 1.56 *  OT)) | float}}
          {% elif HC == 2.1 %}
            {{ "%.1f"%( CurveMove - System + 69.1 - ( 0.0197 * OT**2 ) - ( 1.66 *  OT)) | float}}
          {% elif HC == 2.2 %}
            {{ "%.1f"%( CurveMove - System + 71.2 - ( 0.01995 * OT**2 ) - ( 1.76 *  OT)) | float}}
          {% elif HC == 2.3 %}
            {{ "%.1f"%( CurveMove - System + 73.3 - ( 0.0202 * OT**2 ) - ( 1.86 *  OT)) | float}}
          {% elif HC == 2.4 %}
            {{ "%.1f"%( CurveMove - System + 75.4 - ( 0.02045 * OT**2 ) - ( 1.96 *  OT)) | float}}
          {% elif HC == 2.5 %}
            {{ "%.1f"%( CurveMove - System + 77.5 - ( 0.02007 * OT**2 ) - ( 2.06 *  OT)) | float}}
          {% elif HC == 2.6 %}
            {{ "%.1f"%( CurveMove - System + 79.8 - ( 0.02045 * OT**2 ) - ( 2.18 *  OT)) | float}}
          {% elif HC == 2.7 %}
            {{ "%.1f"%( CurveMove - System + 82.1 - ( 0.0202 * OT**2 ) - ( 2.3 *  OT)) | float}}
          {% elif HC == 2.8 %}
            {{ "%.1f"%( CurveMove - System + 84.4 - ( 0.01995 * OT**2 ) - ( 2.42 *  OT)) | float}}
          {% elif HC == 2.9 %}
            {{ "%.1f"%( CurveMove - System + 86.7 - ( 0.0197 * OT**2 ) - ( 2.54 *  OT)) | float}}
          {% elif HC == 3.0 %}
            {{ "%.1f"%( CurveMove - System + 89.0 - ( 0.01945 * OT**2 ) - ( 2.66 *  OT)) | float}}
          {% endif %}
        friendly_name: Temperatura krzywa grzewcza obieg 1
        unit_of_measurement: °C

Pomocnicy HA, imput number i imput select powinni być w ESP aby uzależnić się od braku łączności z HA.

Da się to ogarnąć w ESPHome ?
Pozdrawiam.

Template Sensor

https://esphome.io/components/sensor/template.html

Home Assistant Binary Sensor

https://esphome.io/components/binary_sensor/homeassistant.html

Pierwszy link, tak czułem że tak sie to skończy :slight_smile:
Drugi link, ja nie chcę pobierać wartości ustawionych w HA, chcę je ustawiać w ESPHome

1 Like