Esphome krzywa grzewcza

Witam, ogrzewaniem w domu steruję sterownikiem obiegów grzewczych. Ma on dwa niezależne obiegi które z krzywej grzewczej sterują zaworem trójdrogowym i regulują temperaturę czynnika grzewczego.
Chciałem go zastąpić ESPHome ponieważ sterownik ma zamknięte API.
Podpowiedzcie jak zrealizować krzywą grzewczą ?

Z bardzo dobrym przybliżeniem dla temperatur zewnętrznych poniżej 15C możesz to odwzorować za pomocą funkcji liniowej (równanie prostej). Praktycznie to można w całym zakresie uznać jako prostą, będzie to dość dobre przybliżenie, Gdy odczytasz z wykresu to zobaczysz, że te współczynniki 0.6-4 to tg(alfa) czyli nachylenie prostej. Tyle w obszarze matematyki - teraz trzeba przenieść to do ESPHomu ( tu nie pomogę).

1 polubienie

To mój template do krzywej grzewczej. Liczone przez HA. Z esphome nie korzystam, ale może cię na coś nakieruje

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

Możesz pokazać cały kod całego czujnika ?

To nie czujnik. To moje podejście do sterowania temperaturą kotła gazowego. Połączenie pogodówki i sterowania PID. Jakoś ponad 300 linii kodu. Nie bardzo się nadaje na publikacje bo jest w trakcie rozwoju i dużo do tłumaczenia. Utrzymuję temperaturę w domu w granicach +/- 0,1C czasami +/- 0,05C i

Czy mierzysz z taką dokładnością?

Dałem wykres. Pomiar to średnia z kilku termometrów Xiaomi

Miało być … czym mierzysz? :wink: jedna literka a jaka róźnica.