climate:
- platform: thermostat
name: "$DeviceName"
id: "Heater"
sensor: "Temperature"
default_target_temperature_low: 50 °C
startup_delay: true
min_heating_off_time: 10s
min_heating_run_time: 0s
min_idle_time: 10s
visual:
min_temperature: 50 °C
max_temperature: 85 °C
temperature_step: 1 °C
heat_action:
- if:
condition:
- " I don't know how to set the condition for select as ECO " ?
then:
- switch.turn_on: "r1"
- if:
condition:
- " I don't know how to set the condition for select as Normal " ?
then:
- switch.turn_on: "r1"
- switch.turn_on: "r2"
- " also switch.turn_off: "r2" when reache 90% id(Heater).target_temperature " ?
- if:
condition:
- " I don't know how to set the condition for select as Boost " ?
then:
- switch.turn_on: "r1"
- switch.turn_on: "r3"
- switch.turn_on: "r3"
- " also switch.turn_off: "r2" when reache 90% id(Heater).target_temperature " ?
- " also switch.turn_off: "r3" when reache 80% id(Heater).target_temperature " ?
idle_action:
- switch.turn_off: "r1"
- switch.turn_off: "r2"
- switch.turn_off: "r3"
/config/water-heater.yaml: In lambda function:
/config/water-heater.yaml:187:28: error: 'ECO' was not declared in this scope; did you mean 'EIO'?
187 | - lambda: "return id(Mode).state = ECO;"
| ^~~
| EIO
*** [.pioenvs/water-heater/src/main.cpp.o] Error 1
========================== [FAILED] Took 5.53 seconds ==========================
2- switch.turn_off when reache 90% id(Heater).target_temperature
I’m not familiar with three-element water heaters, but with two elements, they generally have two temperature sensors.
If the bottom one (where the cold water comes in) gets below a set temperature, that element comes on to keep the whole tank up to temp. The top one only gets below the desired temperature if you’ve used up almost all the hot water, and a quick recovery is needed. Then the top one comes on and the bottom one shuts off. This way the water heater only requires wiring and breakers for one heating element at a time.
Ahh, totally different animal than what I was talking about. Not really sure what the goal is there. Do the three elements have different power levels? Or is the idea you can use one, two or three at a time to recover slower or faster? Of course it takes exactly the same amount of power to heat a given volume of water to a given temperature, so I don’t know where you’d get an energy savings. You might save money if your power is priced based on time of day or demand.
Compiling .pioenvs/water-heater/src/main.cpp.o
/config/water-heater.yaml: In lambda function:
/config/water-heater.yaml:187:36: error: 'ECO' was not declared in this scope; did you mean 'EIO'?
187 | - lambda: "return id(Mode).state.c_str() = ECO;"
| ^~~
| EIO
*** [.pioenvs/water-heater/src/main.cpp.o] Error 1
========================== [FAILED] Took 5.61 seconds ==========================
Compiling .pioenvs/water-heater/src/main.cpp.o
/config/water-heater.yaml: In lambda function:
/config/water-heater.yaml:187:29: error: ‘ECO’ was not declared in this scope; did you mean ‘EIO’?
187 | - lambda: “return id(Mode).state == ECO;”
| ^~~
| EIO
*** [.pioenvs/water-heater/src/main.cpp.o] Error 1
========================== [FAILED] Took 5.38 seconds ==========================
It also uses Select with options and lambda conditions with state. Difference is that here the quotation marks are set around the value and the if is set within the lambda action.
on_value:
then:
lambda: |-
if ((id(effect_block_level).state == "None")) {
id(block_relay_a).turn_off();
id(block_relay_b).turn_off(); }
else if ((id(effect_block_level).state == "A")) {
id(block_relay_a).turn_on();
id(block_relay_b).turn_off(); }
else if ((id(effect_block_level).state == "B")) {
id(block_relay_a).turn_off();
id(block_relay_b).turn_on(); }
else if ((id(effect_block_level).state == "A+B")) {
id(block_relay_a).turn_on();
id(block_relay_b).turn_on(); }
However maybe something for you to think about is that for 85 degrees it might be logic to stop at 90% but for 60 degrees at 70%, because otherwise the temp will go trough.