Hi All, I have two thermostats in my ESP script. One is connected to a sensor in the floor, the other to a sensor in the room. If the room gets colder than 18, the switch is activated until it reaches 19.
If the floor thermostat gets colder than 17, it activates the switch until the sensor in the floor reaches 19.
But when both thermostats are activated, the thermostat who first reaches his setpoint, deactivates the switch. I want the last thermostat to deactivate the switch.
My goal was to set two variabeles, and let the variabele control the switch.
Is this possible? Or is there another possibility?
Any help wil be appreciated.
Best regards.
Where is your code?
So… You’re taking 2 temp readings, one from the floor and another one measures air temp? You’re using both sensors to create 2 seperate Thermostat’s and both Thermostats use the same switch to heat? There’s only one source of heat?
Hi Poo, thanks for reaching out.
Correct, the switch controls the floor heating. I also have a wood burner and don’t like the floor getting to cold.
It is working fine most of the time, but sometimes the things happen like described before and the thermostat wont function like I want to.
my code is
switch:
- platform: gpio
name: "Relais voor verbreken verwarm signaal"
pin: GPIO32
id: relais_verbreken_verwarmsignaal
inverted: true
- platform: gpio
name: "Relais voor forceer maken verwarm signaal"
pin: GPIO33
id: relais_forceer_maken_verwarm_signaal
inverted: true
- platform: gpio
name: "Relais voor tele thermostaat"
pin: GPIO25
id: relais_tele_thermostaat
inverted: true
- platform: gpio
name: "Relais voor pomp"
id: relais_pomp
pin: GPIO26
inverted: true
- platform: restart
name: "Thermostaat Restart"
climate:
- platform: thermostat
name: "Thermostaat Vloerverwarming"
sensor: vloerverwarming_vloer_temperatuur
min_heating_off_time: 600s
min_heating_run_time: 600s
min_idle_time: 30s
heat_deadband: 0.8 # The minimum temperature differential (temperature below the set point) before engaging heat
heat_overrun: 0.0 # The minimum temperature differential (heating beyond the set point) before disengaging heat
heat_action:
- switch.turn_on: relais_tele_thermostaat
idle_action:
- switch.turn_off: relais_tele_thermostaat
default_preset: Home
preset:
- name: Home
default_target_temperature_low: 18.0 °C
- name: Eco
default_target_temperature_low: 16.5 °C
- name: Sleep
default_target_temperature_low: 17.0 °C
- name: Away
default_target_temperature_low: 10 °C
- platform: thermostat
name: "Thermostaat Woonkamerverwarming"
sensor: woonkamer_temperatuur
min_heating_off_time: 300s
min_heating_run_time: 300s
min_idle_time: 30s
heat_deadband: 0.2 # The minimum temperature differential (temperature below the set point) before engaging heat
heat_overrun: 0.0 # The minimum temperature differential (heating beyond the set point) before disengaging heat
heat_action:
- switch.turn_on: relais_tele_thermostaat
idle_action:
- switch.turn_off: relais_tele_thermostaat
default_preset: Home
preset:
- name: Home
default_target_temperature_low: 19 °C
- name: Sleep
default_target_temperature_low: 18.5 °C
- name: Away
default_target_temperature_low: 10 °C
Do these 2 areas you have temp sensors, do they vary a lot or do they both track roughly the same temperature?
Just off the top of my head, it would seem like combining the 2 sensors and then using their average for your Climate sensor, rather than 2 sensors controlling 1 switch.
You need to make a condition for the idle actions to check the state of the other thermostat.
Hi Poo,
Sometimes the floor gets really cold while the temperature in the room is ok.
Average temperature doesn’t sound like the best solution.
I want them both to control independently that swich.
Hi Karosm,
That sounds promising, do you have an example of how to code?
Thanks in advance.
I would suggest using a single thermostat, controlled by a template sensor that combines the state of the two actual sensors. Probably need a lambda to do the combination. Controlling one switch with two thermostats is always going to be messy.
I would suggest to create an input boolean per thermostat
(my example uses a different one because I need heat and cool, but the idea is the same.
climate:
- platform: dual_smart_thermostat
unique_id: Thermostaat woonkamer voor
name: Thermostaat woonkamer voor
heater: input_boolean.heater_living_room_front
cooler: input_boolean.cooler_living_room_front
target_sensor: sensor.temp_kamer_voor_temperature
heat_cool_mode: true
# cold_tolerance: 0.1
# hot_tolerance: 0
target_temp_step: 0.5
- platform: dual_smart_thermostat
unique_id: hermostat woonkamer achter
name: Thermostat woonkamer achter
heater: input_boolean.heater_living_room_back
cooler: input_boolean.cooler_living_room_back
target_sensor: sensor.temp_kamer_achter_temperature
heat_cool_mode: true
# cold_tolerance: 0.1
# hot_tolerance: 0
target_temp_step: 0.5
and then create an automation on state change of this input bool the determine it the switch should be set or not.
Hi bkbartk
Thanks.
When you say create automation, I think you mean an automation in home assistant right?
I would like to keep al the logic in this ESP device.
regards!