-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
M5withMIC.yml
147 lines (129 loc) · 2.94 KB
/
M5withMIC.yml
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
substitutions:
devicename: m5mic
external_components:
- source:
type: git
url: https://github.com/lubeda/EsphoMaTrix
refresh: 60s
components: [ehmtxv2]
web_server:
esphome:
name: $devicename
comment: 8x32 Statusdisplay mit Microphone
on_boot:
lambda: |-
id(rgb8x32)->set_display_on();
esp32:
board: m5stack-atom
i2s_audio:
i2s_lrclk_pin: GPIO32
i2s_bclk_pin: GPIO19 # Egal
microphone:
- platform: i2s_audio
id: echo_microphone
i2s_din_pin: GPIO26
voice_assistant:
microphone: echo_microphone
on_stt_end:
lambda: |-
id(rgb8x32)->icon_screen("home_assistant",x.c_str());
id(rgb8x32)->force_screen("home_assistant");
on_tts_start:
lambda: |-
id(rgb8x32)->icon_screen("mic",x.c_str());
id(rgb8x32)->force_screen("mic");
binary_sensor:
- platform: status
name: "$devicename Status"
- platform: gpio
pin:
number: GPIO39
inverted: true
name: ${devicename} Button
id: echo_button
on_press:
- voice_assistant.start:
on_release:
- voice_assistant.stop:
font: !include library/ehmtx_font.yaml
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();
logger:
level: DEBUG
api:
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: GPIO25
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();
ehmtxv2:
id: rgb8x32
matrix_component: ehmtx_display
time_component: ehmtx_time
icons2html: true
default_font_id: ehmtx_font
special_font_id: ehmtx_font
icons:
- id: error
lameid: 40530
- id: home_assistant
lameid: 47693
- id: temperature
lameid: 2056
- id: lightbulb
lameid: 1762
- id: music
lameid: 45625
- id: phone
lameid: 1232
- id: car
lameid: 2819
- id: sleep8x32
url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif