-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelements.yaml
278 lines (261 loc) · 11 KB
/
elements.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
packages:
fonts: !include common/fonts.yaml
colors: !include common/colors.yaml
# Board
esp32:
board: esp32dev
framework:
type: arduino
i2c:
- sda: GPIO21
scl: GPIO22
one_wire:
- platform: gpio
pin: GPIO33
# ESPHome
esphome:
name: elements
friendly_name: Elements
name_add_mac_suffix: true
# Logging
logger:
# Updates
ota:
- platform: esphome
password: ""
# Homeassistant
api:
time:
- platform: homeassistant
id: current_time
# WiFi
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: !secret captive_portal_ssid
password: !secret captive_portal_password
captive_portal:
# Sensors
sensor:
# Internal Sensors
- platform: bh1750
id: illuminance
name: "Illuminance"
address: 0x23
- platform: dallas_temp
id: temperature
name: "Temperature"
address: 0xbd00000051c98a28
# External Sensors
- platform: homeassistant
id: inside_temperature
entity_id: sensor.apollo_air_1_sen55_temperature
- platform: homeassistant
id: outside_temperature
entity_id: sensor.meteo_swiss_temperature
text_sensor:
- platform: homeassistant
id: outside_weather
entity_id: weather.forecast_home
- platform: homeassistant
id: timer_state
entity_id: timer.default
- platform: homeassistant
id: timer_remaining
entity_id: timer.default
attribute: remaining
# Fonts
font:
# https://pictogrammers.com/library/mdi/
- file: assets/fonts/materialdesignicons-webfont.ttf
id: font_mdi_16
size: 16
glyphs: &mdi_icons
- "\U000F0594" # mdi:weather-night
- "\U000F0590" # mdi:weather-cloudy
- "\U000F05D6" # mdi:alert-circle-outline
- "\U000F0591" # mdi:weather-fog
- "\U000F0592" # mdi:weather-hail
- "\U000F0593" # mdi:weather-lightning
- "\U000F067E" # mdi:weather-lightning-rainy
- "\U000F0596" # mdi:weather-pouring
- "\U000F0597" # mdi:weather-rainy
- "\U000F0598" # mdi:weather-snowy
- "\U000F067F" # mdi:weather-snowy-rainy
- "\U000F0599" # mdi:weather-sunny
- "\U000F059D" # mdi:weather-windy
- "\U000F059E" # mdi:weather-windy-variant
- "\U000F0595" # mdi:weather-partly-cloudy
- file: assets/fonts/materialdesignicons-webfont.ttf
id: font_mdi_32
size: 32
glyphs: *mdi_icons
light:
# Physical grids
- platform: neopixelbus
id: led_grid_1
variant: WS2812X
method:
type: esp32_rmt
channel: 0
pin: GPIO16
num_leds: 512
type: GRB
restore_mode: ALWAYS_OFF
- platform: neopixelbus
id: led_grid_2
variant: WS2812X
method:
type: esp32_rmt
channel: 1
pin: GPIO17
num_leds: 512
type: GRB
restore_mode: ALWAYS_OFF
# Combined light
- platform: partition
id: led_grid
color_correct: [50%, 50%, 50%]
segments:
- id: led_grid_1
from: 0
to: 511
- id: led_grid_2
from: 0
to: 511
display:
- platform: addressable_light
id: led_display
addressable_light_id: led_grid
width: 32
height: 32
pixel_mapper: |-
static const uint16_t PIXEL_MAPPING[32][32] = {
{496, 495, 464, 463, 432, 431, 400, 399, 368, 367, 336, 335, 304, 303, 272, 271, 1008, 1007, 976, 975, 944, 943, 912, 911, 880, 879, 848, 847, 816, 815, 784, 783},
{497, 494, 465, 462, 433, 430, 401, 398, 369, 366, 337, 334, 305, 302, 273, 270, 1009, 1006, 977, 974, 945, 942, 913, 910, 881, 878, 849, 846, 817, 814, 785, 782},
{498, 493, 466, 461, 434, 429, 402, 397, 370, 365, 338, 333, 306, 301, 274, 269, 1010, 1005, 978, 973, 946, 941, 914, 909, 882, 877, 850, 845, 818, 813, 786, 781},
{499, 492, 467, 460, 435, 428, 403, 396, 371, 364, 339, 332, 307, 300, 275, 268, 1011, 1004, 979, 972, 947, 940, 915, 908, 883, 876, 851, 844, 819, 812, 787, 780},
{500, 491, 468, 459, 436, 427, 404, 395, 372, 363, 340, 331, 308, 299, 276, 267, 1012, 1003, 980, 971, 948, 939, 916, 907, 884, 875, 852, 843, 820, 811, 788, 779},
{501, 490, 469, 458, 437, 426, 405, 394, 373, 362, 341, 330, 309, 298, 277, 266, 1013, 1002, 981, 970, 949, 938, 917, 906, 885, 874, 853, 842, 821, 810, 789, 778},
{502, 489, 470, 457, 438, 425, 406, 393, 374, 361, 342, 329, 310, 297, 278, 265, 1014, 1001, 982, 969, 950, 937, 918, 905, 886, 873, 854, 841, 822, 809, 790, 777},
{503, 488, 471, 456, 439, 424, 407, 392, 375, 360, 343, 328, 311, 296, 279, 264, 1015, 1000, 983, 968, 951, 936, 919, 904, 887, 872, 855, 840, 823, 808, 791, 776},
{504, 487, 472, 455, 440, 423, 408, 391, 376, 359, 344, 327, 312, 295, 280, 263, 1016, 999, 984, 967, 952, 935, 920, 903, 888, 871, 856, 839, 824, 807, 792, 775},
{505, 486, 473, 454, 441, 422, 409, 390, 377, 358, 345, 326, 313, 294, 281, 262, 1017, 998, 985, 966, 953, 934, 921, 902, 889, 870, 857, 838, 825, 806, 793, 774},
{506, 485, 474, 453, 442, 421, 410, 389, 378, 357, 346, 325, 314, 293, 282, 261, 1018, 997, 986, 965, 954, 933, 922, 901, 890, 869, 858, 837, 826, 805, 794, 773},
{507, 484, 475, 452, 443, 420, 411, 388, 379, 356, 347, 324, 315, 292, 283, 260, 1019, 996, 987, 964, 955, 932, 923, 900, 891, 868, 859, 836, 827, 804, 795, 772},
{508, 483, 476, 451, 444, 419, 412, 387, 380, 355, 348, 323, 316, 291, 284, 259, 1020, 995, 988, 963, 956, 931, 924, 899, 892, 867, 860, 835, 828, 803, 796, 771},
{509, 482, 477, 450, 445, 418, 413, 386, 381, 354, 349, 322, 317, 290, 285, 258, 1021, 994, 989, 962, 957, 930, 925, 898, 893, 866, 861, 834, 829, 802, 797, 770},
{510, 481, 478, 449, 446, 417, 414, 385, 382, 353, 350, 321, 318, 289, 286, 257, 1022, 993, 990, 961, 958, 929, 926, 897, 894, 865, 862, 833, 830, 801, 798, 769},
{511, 480, 479, 448, 447, 416, 415, 384, 383, 352, 351, 320, 319, 288, 287, 256, 1023, 992, 991, 960, 959, 928, 927, 896, 895, 864, 863, 832, 831, 800, 799, 768},
{0, 31, 32, 63, 64, 95, 96, 127, 128, 159, 160, 191, 192, 223, 224, 255, 512, 543, 544, 575, 576, 607, 608, 639, 640, 671, 672, 703, 704, 735, 736, 767},
{1, 30, 33, 62, 65, 94, 97, 126, 129, 158, 161, 190, 193, 222, 225, 254, 513, 542, 545, 574, 577, 606, 609, 638, 641, 670, 673, 702, 705, 734, 737, 766},
{2, 29, 34, 61, 66, 93, 98, 125, 130, 157, 162, 189, 194, 221, 226, 253, 514, 541, 546, 573, 578, 605, 610, 637, 642, 669, 674, 701, 706, 733, 738, 765},
{3, 28, 35, 60, 67, 92, 99, 124, 131, 156, 163, 188, 195, 220, 227, 252, 515, 540, 547, 572, 579, 604, 611, 636, 643, 668, 675, 700, 707, 732, 739, 764},
{4, 27, 36, 59, 68, 91, 100, 123, 132, 155, 164, 187, 196, 219, 228, 251, 516, 539, 548, 571, 580, 603, 612, 635, 644, 667, 676, 699, 708, 731, 740, 763},
{5, 26, 37, 58, 69, 90, 101, 122, 133, 154, 165, 186, 197, 218, 229, 250, 517, 538, 549, 570, 581, 602, 613, 634, 645, 666, 677, 698, 709, 730, 741, 762},
{6, 25, 38, 57, 70, 89, 102, 121, 134, 153, 166, 185, 198, 217, 230, 249, 518, 537, 550, 569, 582, 601, 614, 633, 646, 665, 678, 697, 710, 729, 742, 761},
{7, 24, 39, 56, 71, 88, 103, 120, 135, 152, 167, 184, 199, 216, 231, 248, 519, 536, 551, 568, 583, 600, 615, 632, 647, 664, 679, 696, 711, 728, 743, 760},
{8, 23, 40, 55, 72, 87, 104, 119, 136, 151, 168, 183, 200, 215, 232, 247, 520, 535, 552, 567, 584, 599, 616, 631, 648, 663, 680, 695, 712, 727, 744, 759},
{9, 22, 41, 54, 73, 86, 105, 118, 137, 150, 169, 182, 201, 214, 233, 246, 521, 534, 553, 566, 585, 598, 617, 630, 649, 662, 681, 694, 713, 726, 745, 758},
{10, 21, 42, 53, 74, 85, 106, 117, 138, 149, 170, 181, 202, 213, 234, 245, 522, 533, 554, 565, 586, 597, 618, 629, 650, 661, 682, 693, 714, 725, 746, 757},
{11, 20, 43, 52, 75, 84, 107, 116, 139, 148, 171, 180, 203, 212, 235, 244, 523, 532, 555, 564, 587, 596, 619, 628, 651, 660, 683, 692, 715, 724, 747, 756},
{12, 19, 44, 51, 76, 83, 108, 115, 140, 147, 172, 179, 204, 211, 236, 243, 524, 531, 556, 563, 588, 595, 620, 627, 652, 659, 684, 691, 716, 723, 748, 755},
{13, 18, 45, 50, 77, 82, 109, 114, 141, 146, 173, 178, 205, 210, 237, 242, 525, 530, 557, 562, 589, 594, 621, 626, 653, 658, 685, 690, 717, 722, 749, 754},
{14, 17, 46, 49, 78, 81, 110, 113, 142, 145, 174, 177, 206, 209, 238, 241, 526, 529, 558, 561, 590, 593, 622, 625, 654, 657, 686, 689, 718, 721, 750, 753},
{15, 16, 47, 48, 79, 80, 111, 112, 143, 144, 175, 176, 207, 208, 239, 240, 527, 528, 559, 560, 591, 592, 623, 624, 655, 656, 687, 688, 719, 720, 751, 752},
};
return PIXEL_MAPPING[y][x];
image:
rgb:
- id: cat
file: https://raw.githubusercontent.com/gammasoft/fatcow/refs/heads/master/32x32/cat.png
- id: guitar
file: https://raw.githubusercontent.com/gammasoft/fatcow/refs/heads/master/32x32/acoustic_guitar.png
- id: leaf
file: https://raw.githubusercontent.com/gammasoft/fatcow/refs/heads/master/32x32/green.png
elements:
id: elements_display
display: led_display
# some sensor values
# element:
# type: sequence
# duration: 5s
# elements:
# - type: dynamic_text
# font: font_chunky_8
# color: "#00ff00"
# lambda: |-
# return id(temperature).has_state() ? str_sprintf("%.2f", id(temperature).state) : "";
# - type: dynamic_text
# font: font_chunky_8
# color: "#0000ff"
# lambda: |-
# return id(illuminance).has_state() ? str_sprintf("%.2f", id(illuminance).state) : "";
# - type: time_text
# font: font_chunky_8
# time: current_time
# text animations
# element:
# type: sequence
# duration: 5s
# elements:
# - type: clock
# time: current_time
# - type: text
# font: font_chunky_8
# color: yellow
# scroll_mode: TOP_TO_BOTTOM
# text: "1"
# - type: image
# image: leaf
# - type: text
# font: font_chunky_8
# color: orange
# scroll_mode: BOTTOM_TO_TOP
# text: "2"
# - type: image
# image: cat
# - type: text
# font: font_chunky_8
# color: violet
# scroll_mode: LEFT_TO_RIGHT
# text: "3"
# - type: image
# image: guitar
# - type: text
# font: font_chunky_8
# color: red
# scroll_mode: RIGHT_TO_LEFT
# text: "4"
# element composition
# element:
# type: vertical
# elements:
# - type: horizontal
# elements:
# - type: vertical
# elements:
# - type: time_text
# time: current_time
# font: font_chunky_6
# format: "%a"
# - type: time_text
# time: current_time
# font: font_chunky_6
# format: "%b"
# - type: vertical
# elements:
# - type: time_text
# time: current_time
# font: font_chunky_6
# format: "%e"
# - type: time_text
# time: current_time
# font: font_chunky_6
# format: "%Y"
# - type: time_text
# time: current_time
# font: font_chunky_8
element:
type: custom