-
Notifications
You must be signed in to change notification settings - Fork 0
/
livingroom-lightstring.yaml
136 lines (120 loc) · 2.73 KB
/
livingroom-lightstring.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
124
125
126
127
128
129
130
131
132
133
134
135
136
substitutions:
device_name: "Livingroom Light String"
esphome:
name: "livingroom-lightstring"
platformio_options:
board_build.f_flash: 40000000L
board_build.flash_mode: dio
board_build.flash_size: 4MB
esp32:
board: lolin_s2_mini
variant: ESP32S2
framework:
type: esp-idf
# version: 2.0.3
# platform_version: 5.0.0
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
#use_address: 10.0.30.25
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${device_name} Hotspot
password: !secret esphome_fallback_pass
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
text_sensor:
- platform: wifi_info
ip_address:
name: "${device_name} IP Address"
ssid:
name: "${device_name} SSID"
bssid:
name: "${device_name} BSSID"
- platform: version
name: "${device_name} ESPHome Version"
# status_led:
# pin:
# number: GPIO15
# Sensors with general information.
sensor:
# Uptime sensor.
- platform: uptime
name: ${device_name} Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: ${device_name} WiFi Signal
update_interval: 60s
- platform: adc
pin: GPIO3
name: "${device_name} Output Voltage"
update_interval: 1s
device_class: Voltage
entity_category: diagnostic
filters:
- multiply: 6.2
- or:
- throttle_average: 60s
- delta: 0.1
output:
- platform: ledc
pin:
number: GPIO12
mode:
output: true
pulldown: true
frequency: "1000Hz"
max_power: 0.4
id: pwm_output
light:
- platform: monochromatic
name: ${device_name}
output: pwm_output
gamma_correct: 2
id: lightstrip
effects:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
- pulse:
name: "Slow Pulse"
transition_length: 2.5s # defaults to 1s
update_interval: 3s
binary_sensor:
- platform: gpio
name: ${device_name} Button
pin:
number: GPIO16
inverted: true
mode:
input: true
pullup: true
filters:
- delayed_on: 10ms
on_click:
- min_length: 50ms
max_length: 350ms
then:
- light.toggle: lightstrip
- min_length: 500ms
max_length: 10s
then:
- light.turn_on:
id: lightstrip
brightness: 50%
# - min_length: 50ms
# max_length: 350ms
# then:
# - light.toggle:
# id: lightstrip
# - min_length: 500ms
# #max_length: 1000ms
# then:
# - light.turn_on:
# id: lightstrip
# brightness: 50%