I will try this option as well. Can someone check if I did it right? Maybe I’m missing something…
script:
- id: my_script1
then:- delay: 60s
- switch.turn_on: switch_retea
- delay: 300s
- switch.turn_off: switch_start_stop_generator
- delay: 60s
- switch.turn_off: switch_generator
- id: my_script2
- switch.turn_on: switch_start_stop_generator
- delay: 60s
- switch.turn_off: switch_retea
- delay: 60s
- switch.turn_on: switch_generator
binary_sensor:
- platform: gpio
pin:
number: GPIO5
inverted: true
name: “Sensor Retea”
id: sensor_retea
on_press:
then:
- script.execute: my_script1
- script.stop: my_script2
on_release:
then:
- script.execute: my_script2
- script.stop: my_script1
switch: - platform: gpio
pin: GPIO14
name: “Switch Retea”
id: switch_retea
inverted: true
interlock: switch_generator - platform: gpio
pin: GPIO4
name: “Switch Generator”
id: switch_generator
inverted: true
interlock: switch_retea - platform: gpio
pin: GPIO16
name: “Switch Start/Stop Generator”
id: switch_start_stop_generator
inverted: true