-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmatrix_voice.yaml
173 lines (156 loc) · 3.42 KB
/
matrix_voice.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
external_components:
#- source:
# type: git
# url: https://github.com/gnumpi/esphome_matrixio
# ref: main
- source:
type: local
path: esphome/components/
esphome:
name: matrixio-voice
esp32:
board: esp32dev
framework:
type: esp-idf
version: recommended
wifi:
ssid: SSID
password: PASSWORD
fast_connect: true
logger:
ota:
api:
spi:
clk_pin: GPIO32
mosi_pin: GPIO33
miso_pin: GPIO21
matrixio:
id: matrixio_dev
cs_pin: GPIO23
light:
- platform: matrixio
name: everloop
id: everloop
microphone:
- platform: matrixio
id: matrixio_mic
speaker:
- platform: matrixio
id: matrixio_speaker_hp
# [headphone,speakers], default: headphone
audio_out: headphone
# 0..100, in percent, default: 80
volume: 90
voice_assistant:
id: va
microphone: matrixio_mic
speaker: matrixio_speaker_hp
on_listening:
- light.turn_on:
id: everloop
blue: 100%
red: 0%
green: 0%
white: 0%
brightness: 60%
on_stt_vad_end:
- light.turn_on:
id: everloop
blue: 50%
red: 0%
green: 100%
white: 0%
brightness: 60%
on_tts_start:
- light.turn_on:
id: everloop
blue: 100%
red: 100%
green: 0%
white: 0%
brightness: 60%
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: everloop
red: 100%
green: 0%
blue: 0%
white: 0%
brightness: 60%
- delay: 1s
- script.execute: reset_led
on_client_connected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
- script.execute: reset_led
on_client_disconnected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
- light.turn_off: everloop
script:
- id: reset_led
then:
- if:
condition:
- switch.is_on: use_wake_word
- switch.is_on: use_listen_light
then:
- light.turn_on:
id: everloop
red: 100%
green: 89%
blue: 71%
white: 0%
brightness: 60%
else:
- light.turn_off: everloop
switch:
- platform: template
name: 'Use wake word'
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(va).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
- script.execute: reset_led
on_turn_off:
- voice_assistant.stop
- lambda: id(va).set_use_wake_word(false);
- script.execute: reset_led
- platform: template
name: 'Use Listen Light'
id: use_listen_light
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- script.execute: reset_led
on_turn_off:
- script.execute: reset_led
- platform: template
name: "Start Listening"
turn_on_action:
- voice_assistant.start:
silence_detection: false
turn_off_action:
- voice_assistant.stop:
- script.execute: reset_led