Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jaymunro test 1 #2

Merged
merged 38 commits into from
Mar 30, 2024
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5c2b740
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
01fdb6c
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
b2c954b
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
92a35cd
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
1aa32af
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
5f3c27d
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
19869de
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
70d93ea
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
4c8dcce
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
7c63d53
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
45955c4
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
a0d846a
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
261506b
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
e0cf43c
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
d18dfa9
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
4347cfb
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
9125b74
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
f9943ba
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
11508d8
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
5474921
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
6228e96
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
7b2c6a7
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
300d277
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
09652b7
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
0c4a23b
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
b77a833
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
ef29da7
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
332c23f
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
f82e4e9
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
fb763fa
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
ed2216a
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
1491d8a
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
beaea73
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
1f65373
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
363c054
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
8718338
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
789247e
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
fdd9472
Update esp32-s3-box-3.yaml
jaymunro Mar 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 49 additions & 12 deletions wake-word-voice-assistant/esp32-s3-box-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
thinking_illustration_background_color: "FFFFFF"
replying_illustration_background_color: "FFFFFF"
error_illustration_background_color: "000000"
text_outline_color: "888888"

voice_assist_idle_phase_id: "1"
voice_assist_listening_phase_id: "2"
Expand All @@ -25,7 +26,7 @@
voice_assist_muted_phase_id: "12"

# These unqiue characters have been extracted from every test file of every language available on https://github.com/home-assistant/intents (14 March 2024)
allowed_characters: " !#%""'()+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWYZ[]_abcdefghijklmnopqrstuvwxyz{|}°²³µ¿ÁÂÄÅÉÖÚßàáâãäåæçèéêëìíîðñòóôõöøùúûüýþāăąćčďĐđēėęěğĮįıļľŁłńňőřśšťũūůűųźŻżŽžơưșțΆΈΌΐΑΒΓΔΕΖΗΘΚΜΝΠΡΣΤΥΦάέήίαβγδεζηθικλμνξοπρςστυφχψωϊόύώАБВГДЕЖЗИКЛМНОПРСТУХЦЧШЪЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёђєіїјљњћאבגדהוזחטיכלםמןנסעפץצקרשת،ءآأإئابةتجحخدذرزسشصضطظعغفقكلمنهوىيٹپچڈکگںھہیےংকচতধনফবযরলশষস়ািু্చయలిెొ్ംഅആഇഈഉഎഓകഗങചജഞടഡണതദധനപഫബഭമയരറലളവശസഹാിീുൂെേൈ്ൺൻർൽൾაბგდევზთილმნოპრსტუფქყშჩცძჭხạảấầẩậắặẹẽếềểệỉịọỏốồổỗộớờởợụủứừửữựỳ—、一上不个中为主乾了些亮人任低佔何作供依侧係個側偵充光入全关冇冷几切到制前動區卧厅厨及口另右吊后吗启吸呀咗哪唔問啟嗎嘅嘛器圍在场執場外多大始安定客室家密寵对將小少左已帘常幫幾库度庫廊廚廳开式後恆感態成我戲戶户房所扇手打执把拔换掉控插摄整斯新明是景暗更最會有未本模機檯櫃欄次正氏水沒没洗活派温測源溫漏潮激濕灯為無煙照熱燈燥物狀玄现現瓦用發的盞目着睡私空窗立笛管節簾籬紅線红罐置聚聲脚腦腳臥色节著行衣解設調請謝警设调走路車车运連遊運過道邊部都量鎖锁門閂閉開關门闭除隱離電震霧面音頂題顏颜風风食餅餵가간감갔강개거게겨결경고공과관그금급기길깥꺼껐꼽나난내네놀누는능니다닫담대더데도동됐되된됨둡드든등디때떤뜨라래러렇렌려로료른를리림링마많명몇모무문물뭐바밝방배변보부불블빨뽑사산상색서설성세센션소쇼수스습시신실싱아안않알았애야어얼업없었에여연열옆오온완외왼요운움워원위으은을음의이인일임입있작잠장재전절정제져조족종주줄중줘지직진짐쪽차창천최추출충치침커컴켜켰쿠크키탁탄태탬터텔통트튼티파팬퍼폰표퓨플핑한함해했행혀현화활후휴힘,?"
allowed_characters: " !#%\"'()+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWYZ[]_abcdefghijklmnopqrstuvwxyz{|}°²³µ¿ÁÂÄÅÉÖÚßàáâãäåæçèéêëìíîðñòóôõöøùúûüýþāăąćčďĐđēėęěğĮįıļľŁłńňőřśšťũūůűųźŻżŽžơưșțΆΈΌΐΑΒΓΔΕΖΗΘΚΜΝΠΡΣΤΥΦάέήίαβγδεζηθικλμνξοπρςστυφχψωϊόύώАБВГДЕЖЗИКЛМНОПРСТУХЦЧШЪЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёђєіїјљњћאבגדהוזחטיכלםמןנסעפץצקרשת،ءآأإئابةتجحخدذرزسشصضطظعغفقكلمنهوىيٹپچڈکگںھہیےংকচতধনফবযরলশষস়ািু্చయలిెొ్ംഅആഇഈഉഎഓകഗങചജഞടഡണതദധനപഫബഭമയരറലളവശസഹാിീുൂെേൈ്ൺൻർൽൾაბგდევზთილმნოპრსტუფქყშჩცძჭხạảấầẩậắặẹẽếềểệỉịọỏốồổỗộớờởợụủứừửữựỳ—、一上不个中为主乾了些亮人任低佔何作供依侧係個側偵充光入全关冇冷几切到制前動區卧厅厨及口另右吊后吗启吸呀咗哪唔問啟嗎嘅嘛器圍在场執場外多大始安定客室家密寵对將小少左已帘常幫幾库度庫廊廚廳开式後恆感態成我戲戶户房所扇手打执把拔换掉控插摄整斯新明是景暗更最會有未本模機檯櫃欄次正氏水沒没洗活派温測源溫漏潮激濕灯為無煙照熱燈燥物狀玄现現瓦用發的盞目着睡私空窗立笛管節簾籬紅線红罐置聚聲脚腦腳臥色节著行衣解設調請謝警设调走路車车运連遊運過道邊部都量鎖锁門閂閉開關门闭除隱離電震霧面音頂題顏颜風风食餅餵가간감갔강개거게겨결경고공과관그금급기길깥꺼껐꼽나난내네놀누는능니다닫담대더데도동됐되된됨둡드든등디때떤뜨라래러렇렌려로료른를리림링마많명몇모무문물뭐바밝방배변보부불블빨뽑사산상색서설성세센션소쇼수스습시신실싱아안않알았애야어얼업없었에여연열옆오온완외왼요운움워원위으은을음의이인일임입있작잠장재전절정제져조족종주줄중줘지직진짐쪽차창천최추출충치침커컴켜켰쿠크키탁탄태탬터텔통트튼티파팬퍼폰표퓨플핑한함해했행혀현화활후휴힘,?"

micro_wake_word_model: okay_nabu

Expand Down Expand Up @@ -180,7 +181,6 @@
- voice_assistant.start:
wake_word: !lambda return wake_word;


voice_assistant:
id: va
microphone: box_mic
Expand Down Expand Up @@ -270,7 +270,7 @@
then:
# - logger.log: "(on_client_connected) Returning to idle by script"
- script.execute: return_to_idle
# - logger.log: "(on-end) exiting"

Check warning on line 273 in wake-word-voice-assistant/esp32-s3-box-3.yaml

View workflow job for this annotation

GitHub Actions / yamllint

comment not indented like content
on_error:
# - logger.log: "(on_error) started"
- if:
Expand All @@ -294,7 +294,7 @@
else:
- lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id};
- script.execute: draw_display
# - logger.log: "(on_error) exiting"

Check warning on line 297 in wake-word-voice-assistant/esp32-s3-box-3.yaml

View workflow job for this annotation

GitHub Actions / yamllint

comment not indented like content
on_client_connected:
# - logger.log: "(on_client_connected) started"
- if:
Expand Down Expand Up @@ -343,7 +343,7 @@
- wait_until:
condition:
lambda: return !(id(voice_assistant_phase) == ${voice_assist_replying_phase_id});
# normally this would complete and move to next phase with on_tts_stream_end,
# normally this would complete and move to next phase with on_tts_stream_end,
# but sometimes this is missed so put a time limit on the wait
timeout: 10s
- delay: 1s # Give time for the stream to end and the phase to be switched back to listening and this timeout to be reset
Expand Down Expand Up @@ -470,7 +470,7 @@
on_turn_on:
- script.execute: draw_display

- platform: template
- platform: template
name: Display text
id: display_text
optimistic: true
Expand Down Expand Up @@ -696,11 +696,11 @@
font:
- file:
type: gfonts
family: Figtree
family: Roboto
weight: 300
glyphs: ${allowed_characters}
id: font_text
size: 15
size: 16
- file:
type: gfonts
family: Figtree
Expand Down Expand Up @@ -752,7 +752,8 @@
hex: ${loading_illustration_background_color}
- id: error_color
hex: ${error_illustration_background_color}

- id: text_outline_color
hex: ${text_outline_color}
spi:
clk_pin: 7
mosi_pin: 6
Expand Down Expand Up @@ -795,7 +796,19 @@
it.fill(id(idle_color));
it.image((it.get_width() / 2), (it.get_height() / 2), id(casita_idle), ImageAlign::CENTER);
if ( id(display_text).state ) {
it.print( 10, 10, id(font_text), Color::WHITE, "${wake_word_prompt}" );

int x1, y1, text_width, text_height;
it.get_text_bounds(0, 0, "${wake_word_prompt}", id(font_text), TextAlign::TOP_LEFT, &x1, &y1, &text_width, &text_height); // Get the text dimensions
int rect_width = text_width + 10; // 5-pixel padding
int rect_height = text_height + 10; // 5-pixel padding
int rect_x = 10; // Margin from the left
int rect_y = 10; // Margin from the top
int text_x = rect_x + 5; // 5-pixel padding
int text_y = rect_y + 5; // 5-pixel padding

it.filled_rectangle(rect_x, rect_y, rect_width, rect_height, Color::BLACK); // Draw the black rectangle
it.rectangle(rect_x, rect_y, rect_width, rect_height, text_outline_color); // Draw the outline
it.print( text_x, text_y, id(font_text), Color::WHITE, "${wake_word_prompt}" ); // Print the text in white
}

if ( std::string(id(date_format_string).c_str()) != "" or std::string(id(time_format_string).c_str()) != "" ) {
Expand All @@ -821,14 +834,30 @@
pos = date_time_text.find(" 0", pos); // Find the next occurrence
}
}
it.printf( it.get_width() / 2, it.get_height() - 10, id(font_text), Color::WHITE, TextAlign::BOTTOM_CENTER, "%s", date_time_text.c_str() );

int x1, y1, text_width, text_height;
it.get_text_bounds(0, 0, date_time_text.c_str(), id(font_text), TextAlign::TOP_LEFT, &x1, &y1, &text_width, &text_height); // Get the text dimensions
int rect_width = text_width + 10; // 5-pixel padding
int rect_height = text_height + 10; // 5-pixel padding
int rect_x = (it.get_width() - rect_width) / 2; // Centered
int rect_y = it.get_height() - rect_height - 10; // margin from the bottom is 10
int text_x = rect_x + (rect_width - text_width) / 2; // Centered
int text_y = rect_y + 5; // 5-pixel padding

it.filled_rectangle(rect_x, rect_y, rect_width, rect_height, Color::BLACK); // Draw the black rectangle
it.rectangle(rect_x, rect_y, rect_width, rect_height, text_outline_color); // Draw the outline
it.printf( text_x, text_y, id(font_text), Color::WHITE, TextAlign::TOP_LEFT, "%s", date_time_text.c_str() ); // Print the text in white
}
- id: listening_page
lambda: |-
it.fill(id(listening_color));
it.image((it.get_width() / 2), (it.get_height() / 2), id(casita_listening), ImageAlign::CENTER);
if ( id(display_text).state ) {
it.print( 10, 10, id(font_text), Color::BLACK, "${listening_prompt}" );
int x1, y1, text_width, text_height;
it.get_text_bounds(0, 0, "${listening_prompt}", id(font_text), TextAlign::TOP_LEFT, &x1, &y1, &text_width, &text_height); // Get the text dimensions
it.filled_rectangle(10, 10, text_width + 10, text_height + 10, Color::WHITE); // Draw the white rectangle
it.rectangle(10, 10, text_width + 10, text_height + 10, text_outline_color); // Draw the outline
it.print( 15, 15, id(font_text), Color::BLACK, "${listening_prompt}" ); // Print the text in black
}
- id: thinking_page
lambda: |-
Expand Down Expand Up @@ -856,7 +885,11 @@
it.fill(id(error_color));
it.image((it.get_width() / 2), (it.get_height() / 2), id(casita_error), ImageAlign::CENTER);
if ( id(display_text).state ) {
it.print( 10, 10, id(font_text), Color::WHITE, "${error_prompt}" );
int x1, y1, text_width, text_height;
it.get_text_bounds(0, 0, "${error_prompt}", id(font_text), TextAlign::TOP_LEFT, &x1, &y1, &text_width, &text_height); // Get the text dimensions
it.filled_rectangle(10, 10, text_width + 10, text_height + 10, Color::BLACK); // Draw the black rectangle
it.rectangle(10, 10, text_width + 10, text_height + 10, text_outline_color); // Draw the outline
it.print( 15, 15, id(font_text), Color::WHITE, "${error_prompt}" ); // Print the text in white
}
- id: no_ha_page
lambda: |-
Expand All @@ -869,7 +902,11 @@
it.fill(id(loading_color));
it.image((it.get_width() / 2), (it.get_height() / 2), id(casita_initializing), ImageAlign::CENTER);
if ( id(display_text).state ) {
it.print( 10, 10, id(font_text), Color::WHITE, "${starting_up}" );
int x1, y1, text_width, text_height;
it.get_text_bounds(0, 0, "${starting_up}", id(font_text), TextAlign::TOP_LEFT, &x1, &y1, &text_width, &text_height); // Get the text dimensions
it.filled_rectangle(10, 10, text_width + 10, text_height + 10, Color::BLACK); // Draw the black rectangle
it.rectangle(10, 10, text_width + 10, text_height + 10, text_outline_color); // Draw the outline
it.print( 15, 15, id(font_text), Color::WHITE, "${starting_up}" ); // Print the text in white
}
- id: muted_page
lambda: |-
Expand Down
Loading