-
Notifications
You must be signed in to change notification settings - Fork 2
/
rgb-led-status.yaml
executable file
·98 lines (92 loc) · 2.13 KB
/
rgb-led-status.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
# Required substitutions:
# device_name
# rgb_led_pin, e.g. GPIO38
# https://esphome.io/components/external_components.html
external_components:
# TODO: Add RGB LED for status_indicator
# https://github.com/esphome/esphome/pull/5814
- source: github://pr#5814
components: [ status_indicator, wifi ]
# https://esphome.io/components/light/
light:
# https://esphome.io/components/light/esp32_rmt_led_strip
- platform: esp32_rmt_led_strip
name: ${device_name}_rgb_led
id: rgb_led
disabled_by_default: true
entity_category: config
rgb_order: GRB
pin: ${rgb_led_pin}
num_leds: 1
rmt_channel: 0
chipset: WS2812
# https://esphome.io/components/light/#light-effects
effects:
- pulse:
name: slow_pulse
transition_length: 250ms
update_interval: 250ms
min_brightness: 25%
max_brightness: 50%
- pulse:
name: fast_pulse
transition_length: 100ms
update_interval: 100ms
min_brightness: 25%
max_brightness: 50%
# https://github.com/esphome/esphome/pull/5814
status_indicator:
on_turn_off:
then:
- light.turn_on:
id: rgb_led
red: 0%
green: 100%
blue: 0%
brightness: 25%
effect: none
on_app_error:
then:
- light.turn_on:
id: rgb_led
red: 100%
green: 0%
blue: 0%
brightness: 50%
effect: none
on_app_warning:
then:
- light.turn_on:
id: rgb_led
red: 100%
green: 0%
blue: 0%
brightness: 50%
effect: slow_pulse
on_wifi_ap_enabled:
then:
- light.turn_on:
id: rgb_led
red: 100%
green: 100%
blue: 50%
brightness: 50%
effect: none
on_network_disconnected:
then:
- light.turn_on:
id: rgb_led
red: 100%
green: 0%
blue: 0%
brightness: 50%
effect: fast_pulse
on_api_disconnected:
then:
- light.turn_on:
id: rgb_led
red: 100%
green: 100%
blue: 0%
brightness: 50%
effect: fast_pulse