forked from lubeda/EsphoMaTrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ehmtx8266-select.yaml
281 lines (266 loc) · 6.38 KB
/
ehmtx8266-select.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
278
279
280
281
substitutions:
devicename: ehmtx8266
mypin: GPIO02
# GPIO04
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
ref: main
refresh: 120s
components: [ ehmtx ]
#type: local
#path: components
esphome:
name: $devicename
esp8266:
board: d1_mini
font:
- file: _fonts/monobit.ttf
id: ehmtx_font
size: 16
glyphs: |
!?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz€@<>/
binary_sensor:
- platform: status
name: "$devicename Status"
logger:
# Enable Home Assistant API
api:
services:
- service: alarm
variables:
icon_name: string
text: string
then:
lambda: |-
id(rgb8x32)->add_screen(icon_name,text,7,true);
id(rgb8x32)->force_screen(icon_name);
- service: screen
variables:
icon_name: string
text: string
then:
- ehmtx.add.screen:
id: rgb8x32
text: !lambda return text;
icon_name: !lambda return icon_name;
alarm: false
- service: brightness
variables:
brightness: int
then:
lambda: |-
id(rgb8x32)->set_brightness(brightness);
- service: status
then:
lambda: |-
id(rgb8x32)->get_status();
- service: del_screen
variables:
icon_name: string
then:
- ehmtx.delete.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: indicator_on
variables:
r: int
g: int
b: int
then:
- ehmtx.indicator.on:
id: rgb8x32
red: !lambda return r;
green: !lambda return g;
blue: !lambda return b;
- service: force_screen
variables:
icon_name: string
then:
- ehmtx.force.screen:
id: rgb8x32
icon_name: !lambda return icon_name;
- service: text_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_text_color(r,g,b);
- service: alarm_color
variables:
r: int
g: int
b: int
then:
lambda: |-
id(rgb8x32)->set_alarm_color(r,g,b);
- service: indicator_off
then:
- ehmtx.indicator.off:
id: rgb8x32
- service: display_on
then:
- ehmtx.display.on:
id: rgb8x32
- service: display_off
then:
- ehmtx.display.off:
id: rgb8x32
number:
- platform: template
name: "$devicename brightness"
min_value: 0
max_value: 255
step: 1
lambda: |-
return id(rgb8x32)->get_brightness();
set_action:
lambda: |-
id(rgb8x32)->set_brightness(x);
switch:
- platform: template
name: "$devicename Display"
icon: "mdi:power"
restore_mode: ALWAYS_ON
lambda: |-
return id(rgb8x32)->show_display;
turn_on_action:
lambda: |-
id(rgb8x32)->set_display_on();
turn_off_action:
lambda: |-
id(rgb8x32)->set_display_off();
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
light:
- platform: neopixelbus
id: ehmtx_light
type: GRB
variant: WS2812
pin: $mypin
num_leds: 256
color_correct: [30%, 30%, 30%]
name: "$devicename Light"
restore_mode: ALWAYS_OFF
on_turn_on:
lambda: |-
id(ehmtx_display)->set_enabled(false);
on_turn_off:
lambda: |-
id(ehmtx_display)->set_enabled(true);
time:
- platform: homeassistant
id: ehmtx_time
display:
- platform: addressable_light
id: ehmtx_display
addressable_light_id: ehmtx_light
width: 32
height: 8
pixel_mapper: |-
if (x % 2 == 0) {
return (x * 8) + y;
}
return (x * 8) + (7 - y);
rotation: 0°
update_interval: 16ms
auto_clear_enabled: true
lambda: |-
id(rgb8x32)->tick();
id(rgb8x32)->draw();
ehmtx:
id: rgb8x32
show_clock: 4
show_screen: 6
display8x32: ehmtx_display
time: ehmtx_time
week_start_monday: false
duration: 7
font_id: ehmtx_font
icons:
- file: _icons/TAKE OFF ROCKET START COUNTDOWN_8631.gif
id: boot
- file: _icons/Garage Door open_30081.gif
id: garage
- file: _icons/Wind_22148.gif
id: wind
- file: _icons/Rain 1H_6427.gif
id: rain
- file: _icons/dog_2698.png
id: dog
- file: _icons/Pool_28103.gif
id: pool
- file: _icons/shop_18567.gif
id: shop
- file: _icons/Phonering_1232.gif
id: phone
- file: _icons/Fire_9272.gif
id: fire
- file: _icons/Alexa Ani_31194.gif
id: alexa
- file: _icons/TV Start_9754.gif
id: tv
- file: _icons/MovieReel_1944.gif
id: media
- file: _icons/ring doorbell_24087.gif
id: ring
- file: _icons/Cold Icy Ice Snow -bmt _17140.gif
id: frost
- file: _icons/wheelie bin_11034.png
id: muell
- file: _icons/Gasoline_18757.png
id: sprit
- file: _icons/Wifi_3925.gif
id: wlan
- file: _icons/Rice Cooker_22604.gif
id: cookit
- file: _icons/Avengers _12091.gif
id: avengers
- file: _icons/Beach_23726.gif
id: nature
- file: _icons/Chair moves to desk_2074.gif
id: work
- file: _icons/nintendo switch_15121.gif
id: nintendo
- file: _icons/Bike strava3_22841.gif
id: bike
- file: _icons/School I Schule_42529.gif
id: school
- file: _icons/Amazon_656.png
id: amazon
- file: _icons/Abstract Post Logo_13998.png
id: post
- file: _icons/Money Gagi_35538.gif
id: money
- file: _icons/power2_32930.gif
id: power
- file: _icons/solar-power_27464.gif
id: solar
- file: _icons/3d printing_10527.gif
id: print3d
- file: _icons/yoga-bridge-R-gil_37276.gif
id: yoga
- file: _icons/Star Trek_43568.gif
id: startrek
- file: _icons/Princess Leia_6582.png
id: leia
- file: _icons/Cookie Monster_20492.gif
id: cookie
- file: _icons/energy_today_26034.png
id: energy
- file: _icons/SUN_5807.gif
id: sun
- file: _icons/Vacuum_30171.png
id: vacuum
- file: _icons/Rain_12018.gif
id: rainprecip
- file: _icons/Enterprise Orbit_10714.png
id: iss
- file: _icons/Thunder_37533.gif
id: thunder