-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
pokypow.yaml
171 lines (147 loc) · 3.19 KB
/
pokypow.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
esphome:
name: gaming-pokypow
friendly_name: gaming-pokypow
on_boot:
priority: -100 # Lower priority to ensure it runs after boot is complete
then:
- light.turn_on:
id: led_strip
red: 0
green: 100%
blue: 0
brightness: 50%
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
flash_size: 4MB
# Enable logging
logger:
# level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "JF2lAtubt9VdSATyOL66WJsqe+Sh1hB8HxZx4ck1V5s="
on_client_connected:
then:
- light.turn_on:
id: led_strip
red: 0
green: 0
blue: 100%
brightness: 50%
on_client_disconnected:
then:
- light.turn_on:
id: led_strip
red: 100%
green: 100%
blue: 0
brightness: 50%
ota:
- platform: esphome
password: "9a276257164827a77c20a46ee176b36e"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.178.144
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Server Fallback Hotspot"
password: "8xAFIJNdv8xb"
captive_portal:
web_server:
port: 80
light:
- platform: neopixelbus
type: GRBW
variant: SK6812
pin: GPIO5
id: led_strip
num_leds: 1
name: "LED Strip"
effects:
- addressable_rainbow:
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 2s
switch:
- platform: gpio
pin:
number: GPIO7
inverted: true
mode:
output: true
pulldown: true
id: power_pin
internal: true
- platform: gpio
pin:
number: GPIO6
inverted: true
mode:
output: true
pulldown: true
id: reset_pin
internal: true
- platform: template
name: "Power Switch"
id: power_switch
internal: true
turn_on_action:
- switch.turn_on: power_pin
- delay: 2000ms
- switch.turn_off: power_pin
- platform: template
name: "Power Switch Force"
id: power_switch_force
internal: true
turn_on_action:
- switch.turn_on: power_pin
- delay: 10000ms
- switch.turn_off: power_pin
- platform: template
name: "Reset Switch"
id: reset_switch
internal: true
turn_on_action:
- switch.turn_on: reset_pin
- delay: 1000ms
- switch.turn_off: reset_pin
binary_sensor:
- platform: gpio
pin:
number: GPIO04
mode:
input: true
pullup: true
inverted: false
id: pc_power_sensor
name: "Power State"
device_class: running
icon: "mdi:desktop-classic"
button:
- platform: template
name: "Power Button"
id: power_button
icon: "mdi:power-standby"
on_press:
then:
- switch.toggle: power_switch
- platform: template
name: "Force Power Off"
id: force_power_off
icon: "mdi:power-plug-off"
on_press:
then:
- switch.toggle: power_switch_force
- delay: 1000ms
- switch.turn_off: power_switch_force
- platform: template
name: "Reset Button"
id: reset_button
icon: "mdi:restart"
on_press:
then:
- switch.toggle: reset_pin