Reset heater timer when relay turns off

This commit is contained in:
2024-05-07 23:14:25 +02:00
parent 312aa4142f
commit 5461ff8889
2 changed files with 18 additions and 10 deletions
+11 -10
View File
@@ -8,13 +8,14 @@ esphome:
packages:
device_base: !include templates/mystrom.yaml
sensor:
- platform: duty_time
id: row_heating_time
name: Row heating time
lambda: "return id(mystrom_relay).state;"
on_value_range:
above: 18000 # 5h
then:
- switch.turn_off: mystrom_relay
- sensor.duty_time.reset: row_heating_time
interval:
- interval: 1min
then:
- if:
condition:
sensor.in_range:
id: continuous_on_time
above: 18000 # 5h
then:
- switch.turn_off: mystrom_relay
+7
View File
@@ -118,6 +118,11 @@ sensor:
then:
- switch.turn_off: mystrom_relay
- platform: duty_time
id: continuous_on_time
name: Continuous on time
lambda: "return id(mystrom_relay).state;"
switch:
- platform: gpio
name: None # Main entity for the device.
@@ -125,3 +130,5 @@ switch:
id: mystrom_relay
restore_mode: RESTORE_DEFAULT_ON
device_class: outlet
on_turn_off:
- sensor.duty_time.reset: continuous_on_time