homeassistant-config/esphome/m5stack-atom-echo.yaml

141 lines
2.7 KiB
YAML
Raw Normal View History

substitutions:
name: "m5stack-atom-echo"
friendly_name: "M5Stack Atom Echo"
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: False
project:
name: m5stack.atom-echo
version: "1.0"
min_version: 2023.5.0
esp32:
board: m5stack-atom
framework:
type: arduino
# Enable Home Assistant API
api:
encryption:
key: !secret apikey
ota:
password: !secret ota
wifi:
ssid: Voltage-legacy
password: !secret voltage_legacy_psk
use_address: ${name}.home
power_save_mode: high
fast_connect: on
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Raspiaudio Fallback Hotspot"
password: !secret fallback_psk
logger:
dashboard_import:
package_import_url: github://esphome/media-players/m5stack-atom-echo.yaml@main
captive_portal:
improv_serial:
i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO19
microphone:
- platform: i2s_audio
id: echo_microphone
i2s_din_pin: GPIO23
adc_type: external
pdm: true
voice_assistant:
microphone: echo_microphone
on_start:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
effect: none
on_tts_start:
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
effect: none
on_tts_end:
2023-12-25 16:45:19 +01:00
- media_player.play_media: !lambda return x;
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
effect: pulse
on_end:
- delay: 1s
- wait_until:
not:
2023-12-25 16:45:19 +01:00
media_player.is_playing: media_out
- light.turn_off: led
on_error:
- light.turn_on:
id: led
blue: 0%
red: 100%
green: 0%
effect: none
- delay: 1s
- light.turn_off: led
binary_sensor:
- platform: gpio
pin:
number: GPIO39
inverted: true
name: Button
id: echo_button
on_multi_click:
- timing:
- ON FOR AT MOST 350ms
- OFF FOR AT LEAST 10ms
then:
- media_player.toggle: media_out
- timing:
- ON FOR AT LEAST 350ms
then:
- voice_assistant.start:
- timing:
- ON FOR AT LEAST 350ms
- OFF FOR AT LEAST 10ms
then:
- voice_assistant.stop:
media_player:
- platform: i2s_audio
id: media_out
name: None
dac_type: external
i2s_dout_pin: GPIO22
mode: mono
light:
- platform: esp32_rmt_led_strip
id: led
name: None
pin: GPIO27
default_transition_length: 0s
chipset: SK6812
num_leds: 1
rgb_order: grb
rmt_channel: 0
effects:
- pulse:
transition_length: 250ms
2023-12-25 16:45:19 +01:00
update_interval: 250ms