-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpet-fountain.yaml
56 lines (51 loc) · 1.16 KB
/
pet-fountain.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
substitutions:
name: pet-fountain
friendly_name: Pet Fountain
wifi_ap: lounge
packages:
common: !include modules/devices/kogan-pet-fountain.yaml
wifi: !include modules/common/wifi.yaml
number:
- platform: template
restore_value: true
name: "Run Time"
id: run_time
optimistic: true
min_value: 1
max_value: 60
step: 1
unit_of_measurement: minutes
- platform: template
restore_value: true
name: "Off Time"
id: off_time
optimistic: true
min_value: 1
max_value: 60
step: 1
unit_of_measurement: minutes
switch:
- platform: template
name: "Timer"
id: timer_switch
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
turn_on_action:
- script.execute: run_timer
turn_off_action:
then:
- script.stop: run_timer
- switch.turn_on: pump
script:
- id: run_timer
mode: queued
then:
- switch.turn_on: pump
- delay: !lambda "return id(run_time).state * 60 * 1000;"
- switch.turn_off: pump
- delay: !lambda "return id(off_time).state * 60 * 1000;"
- script.execute: run_timer
web_server:
include_internal: true
version: 3