You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
840 B
33 lines
840 B
substitutions: |
|
hostname: heating-upstairs |
|
friendly_name: Heating Upstairs |
|
relay_on_action: turn_on |
|
|
|
wifi: |
|
use_address: 192.168.10.17 |
|
|
|
packages: |
|
device: !include devices/sonoff-basic.yaml |
|
|
|
|
|
# Give the user a graphical control over the timeout |
|
# See: https://esphome.io/components/number/template.html |
|
number: |
|
- name: "${friendly_name} Timeout" |
|
id: timeout_length |
|
platform: template |
|
# TODO: maybe it's a better UX to do this in hours and minutes and do the conversion in esphome |
|
unit_of_measurement: minutes |
|
min_value: 10 |
|
# Never want it on for more than 3 hours |
|
# 3*60 = 180 |
|
max_value: 180 |
|
initial_value: 60 |
|
step: 10 |
|
optimistic: true |
|
|
|
script: |
|
- id: turn_on |
|
then: |
|
- delay: !lambda 'return id(timeout_length).state * 60 * 1000;' |
|
- lambda: !lambda id(relay).turn_off();
|
|
|