You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
EspHoMaTriXv2/M5withMIC.yml

147 lines
2.9 KiB

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