From daaeb0793c50301eb8f214381cd93bb49777988f Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Tue, 9 May 2023 20:32:58 +0200 Subject: [PATCH] m5 Stack sample --- M5Stack-sample.md | 15 +++++ M5withMIC.yml | 152 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) create mode 100644 M5Stack-sample.md create mode 100644 M5withMIC.yml diff --git a/M5Stack-sample.md b/M5Stack-sample.md new file mode 100644 index 0000000..ed627e2 --- /dev/null +++ b/M5Stack-sample.md @@ -0,0 +1,15 @@ +# M5 Stack Sample + +## caution + +This is not the hardware paulus used in his videos for the demonstration. The M5Stack atom echo is sold **out**. So, I used another hardware without a speaker! + +The "M5Stack ATOM Lite ESP32 Development Kit" with "M5Stack PDM MEMS Microphone Unit (SPM1423)" were used. The M5Stack Atom Echo needs another pin configuration! + +The setup was just for demonstration, you should **never** power your matrix via the esp32!!! + +## video + +[Youtube](https://www.youtube.com/watch?v=CsOir14DCbM) + +**Use at your own risk!!!!!** \ No newline at end of file diff --git a/M5withMIC.yml b/M5withMIC.yml new file mode 100644 index 0000000..e77cfbe --- /dev/null +++ b/M5withMIC.yml @@ -0,0 +1,152 @@ +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: + - lambda: |- + id(rgb8x32)->show_alarm(120,0,0,2); + on_release: + - voice_assistant.stop: + - lambda: |- + id(rgb8x32)->hide_alarm(); + +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 + \ No newline at end of file