-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbeer_light.yaml
93 lines (82 loc) · 1.86 KB
/
beer_light.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
esphome:
name: beer-light
friendly_name: Beer Light
esp8266:
board: nodemcu
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret beerlight_api_encryption_key
ota:
- platform: esphome
password: !secret beerlight_ota_pw
wifi:
ssid: !secret iot_wifi_ssid
password: !secret iot_wifi_psk
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Beer-Light Fallback Hotspot"
password: !secret beerlight_fallback_ap_pw
captive_portal:
text_sensor:
- platform: version
name: "Beer Light ESPHome Version"
output:
- platform: gpio
pin: D0
id: gpio_d0
- platform: gpio
pin: D1
id: gpio_d1
- platform: gpio
pin: D2
id: gpio_d2
- platform: gpio
pin: D3
id: gpio_d3
light:
- platform: binary
name: "Beer LED 1"
id: beer_led1
output: gpio_d0
- platform: binary
name: "Beer LED 2"
id: beer_led2
output: gpio_d1
- platform: binary
name: "Beer LED 3"
id: beer_led3
output: gpio_d3
- platform: binary
name: "Beer LED 4"
id: beer_led4
output: gpio_d2
switch:
- platform: template
name: "Carousel"
optimistic: yes
id: carousel
turn_on_action:
- while:
condition:
lambda: 'return true;'
then:
- light.turn_on: beer_led1
- delay: 50ms
- light.turn_off: beer_led1
- light.turn_on: beer_led2
- delay: 50ms
- light.turn_off: beer_led2
- light.turn_on: beer_led3
- delay: 50ms
- light.turn_off: beer_led3
- light.turn_on: beer_led4
- delay: 50ms
- light.turn_off: beer_led4
turn_off_action:
- light.turn_off: beer_led1
- light.turn_off: beer_led2
- light.turn_off: beer_led3
- light.turn_off: beer_led4