Files
esphome/storage-heater.yaml
T
artem 0acd5c7d72 Give each mystrom a separate file
This allows to set friendly_name (required for default
entity) and make an area suggestion, while also simplifying
reflash.sh script.
2024-01-25 19:36:32 +01:00

30 lines
646 B
YAML

substitutions:
name: "storage-heater"
friendly_name: "Storage heater"
esphome:
area: "Storage"
packages:
device_base: !include templates/mystrom.yaml
globals:
- id: heater_was_on_previous_interval
type: bool
restore_value: no
initial_value: "false"
interval:
- interval: 3hours
then:
# Turn off the heater if it's on for 3-6 hours in a row.
lambda: |-
if (id(mystrom_relay).state) {
if (id(heater_was_on_previous_interval)) {
id(mystrom_relay).turn_off();
}
id(heater_was_on_previous_interval) = true;
} else {
id(heater_was_on_previous_interval) = false;
}