-
Notifications
You must be signed in to change notification settings - Fork 0
/
novo_common.yaml
123 lines (115 loc) · 3.38 KB
/
novo_common.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Common code for Novostella 20W Flood Lights
#Novostella 20W Flood Light, https://smile.amazon.com/gp/product/B07VH1VHYL
#https://fccid.io/2AI5T-SFGD-002
#https://blakadder.github.io/templates/novostella_20W_flood.html
packages:
device_base: !include zz_common_device_base.yaml
esp8266:
# early_pin_init: false # Prevent the physical relay flipping on reboot.
restore_from_flash: true #writes each state change to flash for switch or light with restore_mode: RESTORE_DEFAULT_OFF/ON, see https://esphome.io/components/esphome.html#esp8266-restore-from-flash
# Output pins
output:
- platform: esp8266_pwm
id: red
pin: GPIO4
inverted: False
- platform: esp8266_pwm
id: green
pin: GPIO12
inverted: False
- platform: esp8266_pwm
id: blue
pin: GPIO14
inverted: False
- platform: esp8266_pwm
id: cold_white
pin: GPIO5
inverted: False
- platform: esp8266_pwm
id: warm_white
pin: GPIO13
inverted: False
light:
- platform: cwww
name: ${friendly_name}
cold_white: cold_white
warm_white: warm_white
cold_white_color_temperature: 6500 K
warm_white_color_temperature: 2700 K
constant_brightness: true
id: thelight
restore_mode: RESTORE_DEFAULT_ON
effects:
- random:
- strobe:
- flicker:
alpha: 50% #The percentage that the last color value should affect the light. More or less the “forget-factor” of an exponential moving average. Defaults to 95%.
intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
- lambda:
name: Throb
update_interval: 1s
lambda: |-
static int state = 0;
auto call = id(thelight).turn_on();
// Transtion of 1000ms = 1s
call.set_transition_length(1000);
if (state == 0) {
call.set_brightness(1.0);
} else {
call.set_brightness(0.01);
}
call.perform();
state += 1;
if (state == 2)
state = 0;
- platform: rgb
name: ${friendly_name} Color
red: red
green: green
blue: blue
id: thelightrgb
restore_mode: RESTORE_DEFAULT_OFF
effects:
- random:
- strobe:
- flicker:
alpha: 50% #The percentage that the last color value should affect the light. More or less the “forget-factor” of an exponential moving average. Defaults to 95%.
intensity: 50% #The intensity of the flickering, basically the maximum amplitude of the random offsets. Defaults to 1.5%.
- lambda:
name: Throb
update_interval: 1s
lambda: |-
static int state = 0;
auto call = id(thelight).turn_on();
// Transtion of 1000ms = 1s
call.set_transition_length(1000);
if (state == 0) {
call.set_brightness(1.0);
} else {
call.set_brightness(0.01);
}
call.perform();
state += 1;
if (state == 2)
state = 0;
- platform: monochromatic
id: justred
output: red
restore_mode: ALWAYS_OFF
# Blink the light if we aren't connected to WiFi.
interval:
- interval: 500ms
then:
- if:
condition:
not:
wifi.connected:
then:
- light.turn_on:
id: justred
brightness: 10%
transition_length: 0s
- delay: 250ms
- light.turn_off:
id: justred
transition_length: 250ms