time:
- platform: sntp
+ on_time:
+ - seconds: 0
+ minutes: 0
+ hours: 6
+ then:
+ climate.control:
+ id: ntc_climate
+ mode: HEAT
+ target_temperature: 21°C
+
+ - seconds: 0
+ minutes: 30
+ hours: 09
+ then:
+ climate.control:
+ id: ntc_climate
+ mode: HEAT
+ target_temperature: 10°C
mqtt:
on_connect:
case ${domo_thresh}: /* Temperature setpoint */
id(temp_setpoint) = x["svalue1"].as<float>();
+ auto call = id(ntc_climate).make_call();
+ call.set_mode("HEAT");
+ call.set_target_temperature(id(temp_setpoint));
+ call.perform();
ESP_LOGD("mqtt", "Got temp_setpoint %f", id(temp_setpoint));
break;
}
# - 12.55 kOhm - > 17.6°C
- 12.30 kOhm -> 18.2°C
- 9.97 kOhm -> 23.5°C
- name: "Bathroom floor temperature"
+ id: ntc_temperature
filters:
- clamp:
min_value: 5
if (!isnan(x))
id(tell_domo_svalue)->execute(${domo_temp}, std::to_string(x));
- bool cur_state = id(ufh_relay).state;
- bool want_state;
- if (x > id(temp_setpoint))
- want_state = false;
- else if (x < id (temp_setpoint))
- want_state = true;
- else
- return;
-
- if (want_state != cur_state) {
- time_t now = ::time(NULL);
- if (now < id(relay_stable_time)) {
- ESP_LOGD("UFH", "Too soon to turn %s (%ld seconds)", want_state ? "ON" : "OFF",
- now - id(relay_stable_time));
- } else {
- id(ufh_relay).toggle();
- }
- }
-
- platform: resistance
id: ntc_resistance
sensor: ntc_adc
# 2.52 -> 2.49
# 1.99 -> 1.96
+climate:
+ - platform: thermostat
+ id: ntc_climate
+ name: "Bathroom floor"
+ sensor: ntc_temperature
+ min_heating_off_time: 300s
+ min_heating_run_time: 300s
+ min_idle_time: 30s
+ heat_action:
+ - switch.turn_on: ufh_relay
+ idle_action:
+ - switch.turn_off: ufh_relay
+ on_control:
+ - lambda: ESP_LOGI("CLIMATE", "on_control");
+ on_state:
+ - lambda: |-
+ if (id(ntc_climate).target_temperature != id(temp_setpoint)) {
+ ESP_LOGI("UFH", "Tell domo target changed from %f °C to %f °C",
+ id(temp_setpoint), id(ntc_climate).target_temperature);
+ id(temp_setpoint) = id(ntc_climate).target_temperature;
+ id(tell_domo_nsvalues)->execute(${domo_thresh}, 2, std::to_string(id(temp_setpoint)));
+ }
+
+
interval:
- interval: 60s
then: