106 lines
1.8 KiB
YAML
106 lines
1.8 KiB
YAML
---
|
|
|
|
substitutions:
|
|
macsuffix: "3f5817"
|
|
|
|
wifi:
|
|
power_save_mode: LIGHT
|
|
|
|
improv_serial:
|
|
|
|
script:
|
|
- id: set_light_on_air
|
|
then:
|
|
- light.turn_on:
|
|
id: indicator
|
|
red: 1
|
|
green: 0
|
|
blue: 0
|
|
effect: "None"
|
|
brightness: 70%
|
|
- id: set_light_online
|
|
then:
|
|
- light.turn_on:
|
|
id: indicator
|
|
red: 0.9
|
|
green: 0.9
|
|
blue: 0.9
|
|
effect: "None"
|
|
brightness: 40%
|
|
- id: set_light_disconnected
|
|
then:
|
|
- light.turn_on:
|
|
id: indicator
|
|
red: 0
|
|
green: 0
|
|
blue: 0
|
|
effect: "None"
|
|
brightness: 0%
|
|
- id: set_light_no_wifi
|
|
then:
|
|
- light.turn_on:
|
|
id: indicator
|
|
red: 0
|
|
green: 0
|
|
blue: 1
|
|
effect: "None"
|
|
brightness: 30%
|
|
|
|
esphome:
|
|
name: "d1-mini-on-air-${macsuffix}"
|
|
on_boot:
|
|
then:
|
|
- delay: 60s
|
|
- if:
|
|
condition:
|
|
not:
|
|
wifi.connected
|
|
then:
|
|
- wifi.disable
|
|
- script.execute:
|
|
id: set_light_no_wifi
|
|
|
|
esp8266:
|
|
board: d1_mini
|
|
|
|
captive_portal:
|
|
|
|
logger:
|
|
level: DEBUG
|
|
logs:
|
|
light: INFO
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
api:
|
|
reboot_timeout: 0s
|
|
|
|
button:
|
|
- platform: template
|
|
name: "${macsuffix} Disconnected"
|
|
on_press:
|
|
- script.execute:
|
|
id: set_light_disconnected
|
|
- platform: template
|
|
name: "${macsuffix} Off-Air"
|
|
on_press:
|
|
- script.execute:
|
|
id: set_light_online
|
|
- platform: template
|
|
name: "${macsuffix} On-Air"
|
|
on_press:
|
|
- script.execute:
|
|
id: set_light_on_air
|
|
|
|
light:
|
|
- platform: neopixelbus
|
|
id: indicator
|
|
name: "${macsuffix} Light"
|
|
type: GRB
|
|
variant: WS2812
|
|
pin: GPIO0
|
|
num_leds: 17
|
|
initial_state:
|
|
state: off
|