-
Notifications
You must be signed in to change notification settings - Fork 0
/
prototype_christmas_tree.yaml
105 lines (93 loc) · 1.98 KB
/
prototype_christmas_tree.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
esphome:
name: prototype_christmas_tree
platform: ESP32
board: wemos_d1_mini32
build_path: build/prototype_christmas_tree
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
domain: .home
# Enable logging
logger:
logs:
sensor: INFO
adc: INFO
api:
reboot_timeout: 0s
ota:
safe_mode: true
password: !secret ota_password
time:
- platform: sntp
id: homeassistant_time
servers: 192.168.88.1
timezone: Europe/Kiev
globals:
- id: christmas_status
type: boolean
restore_value: true
initial_value: "true"
switch:
- platform: template
name: "Christmas Lights"
id: switch_both_lights
lambda: |-
return id(christmas_status);
turn_on_action:
- lambda: |-
id(christmas_status) = true;
- light.turn_on: led_a
- light.turn_on: led_b
turn_off_action:
- lambda: |-
id(christmas_status) = false;
- light.turn_off: led_a
- light.turn_off: led_b
light:
- platform: monochromatic
id: led_a
name: "Garland A"
output: led_pwm_a
internal: true
restore_mode: RESTORE_DEFAULT_ON
effects:
- pulse:
name: default_pulse_a
transition_length: 2.9s
update_interval: 3s
on_turn_on:
then:
- light.control:
id: led_a
effect: default_pulse_a
- platform: monochromatic
id: led_b
name: "Garland B"
output: led_pwm_b
internal: true
restore_mode: RESTORE_DEFAULT_ON
effects:
- pulse:
name: default_pulse_b
transition_length: 3.9s
update_interval: 4s
on_turn_on:
then:
- light.control:
id: led_b
effect: default_pulse_b
output:
- platform: ledc
id: led_pwm_a
pin: D5
- platform: ledc
id: led_pwm_b
pin: D6
binary_sensor:
- platform: gpio
pin:
number: D7
mode: INPUT_PULLUP
name: "Control Button"
on_press:
- switch.toggle: switch_both_lights