-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathesphome_neopixel_clock_effect.yaml
More file actions
105 lines (93 loc) · 2.28 KB
/
Copy pathesphome_neopixel_clock_effect.yaml
File metadata and controls
105 lines (93 loc) · 2.28 KB
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
substitutions:
num_leds: "60"
esp8266:
board: nodemcuv2
framework:
version: recommended
restore_from_flash: true
esphome:
name: nodemcu_uhr
includes:
- "clock.h"
on_boot:
# set "loading" effect while initializing
priority: 500.0
then:
# enable clock effect after boot
- light.turn_on:
id: light_ring
brightness: 100%
effect: Sync
wifi:
fast_connect: True # only needed for hidden SSID
networks:
- ssid: !secret wifi_iot_ssid
bssid: !secret wifi_iot_bssid
password: !secret wifi_iot_password
hidden: true
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Clock FB AP"
password: !secret clock_fallback_ap_password
captive_portal:
ota:
platform: esphome
password: !secret clock_ota_password
globals:
- id: clock_brightness
type: int
restore_value: yes
initial_value: '255'
time:
- platform: sntp
id: sntp_time
timezone: Europe/Berlin
on_time_sync:
then:
- light.turn_on:
id: light_ring
effect: Clock
switch:
- platform: template
id: clock_indicators_switch
name: "Clock Indicators"
optimistic: True
restore_mode: RESTORE_DEFAULT_ON
entity_category: "config"
- platform: template
id: clock_seconds_switch
name: "Clock Seconds"
icon: mdi:update
optimistic: True
restore_mode: RESTORE_DEFAULT_ON
entity_category: "config"
- platform: template
id: wide_hour_hand_switch
name: "Wide Hour Hand"
optimistic: True
restore_mode: RESTORE_DEFAULT_OFF
entity_category: "config"
light:
- id: light_ring
internal: False
platform: neopixelbus
type: GRB
variant: SK6812 # WS2812X
pin: RX #GPIO23
num_leds: "${num_leds}"
method: ESP8266_DMA
name: "NeoPixel Light"
color_correct: [50%, 50%, 50%]
effects:
- addressable_lambda:
name: "Clock"
update_interval: 32ms
lambda: |-
auto time = id(sntp_time).now();
int offset = 0;
static Color clock_ring_colors [${num_leds}];
update_clock_hands(it, time, clock_ring_colors, offset);
- addressable_scan:
name: Sync
move_interval: 100ms
scan_width: 1