95 lines
1.9 KiB
YAML
95 lines
1.9 KiB
YAML
substitutions:
|
|
device_name: "m5-atom-echo"
|
|
friendly_name: "M5 atom echo"
|
|
comment: "esp32, mic, dac, RGB, Btn"
|
|
api_password: !secret esp32-atom-echo_api
|
|
ota_password: !secret ota_password
|
|
wifi_ssid: !secret wifi_ssid
|
|
wifi_password: !secret wifi_password
|
|
gateway: !secret ip_gateway
|
|
subnet: !secret ip_subnet
|
|
ip: !secret esp32-atom-echo_ip
|
|
pin_lrclk: GPIO33
|
|
pin_bclk: GPIO19
|
|
pin_i2sdin: GPIO23
|
|
pin_i2sdout: GPIO22
|
|
pin_button: GPIO39
|
|
pin_LEDS: GPIO27
|
|
|
|
packages:
|
|
board: !include boards/m5atom.yaml
|
|
connection: !include common/wifi.yaml
|
|
device_base: !include common/common.yaml
|
|
logger: !include templates/logger.yaml
|
|
|
|
i2s_audio:
|
|
i2s_lrclk_pin: ${pin_lrclk}
|
|
i2s_bclk_pin: ${pin_bclk}
|
|
|
|
microphone:
|
|
- platform: i2s_audio
|
|
id: atom_mic
|
|
i2s_din_pin: ${pin_i2sdin}
|
|
|
|
voice_assistant:
|
|
microphone: atom_mic
|
|
on_tts_start:
|
|
then:
|
|
- light.turn_on:
|
|
id: led
|
|
brightness: 100%
|
|
red: 0
|
|
green: 100%
|
|
blue: 0
|
|
on_tts_end:
|
|
then:
|
|
- light.turn_off:
|
|
id: led
|
|
on_error:
|
|
then:
|
|
- light.turn_on:
|
|
id: led
|
|
brightness: 100%
|
|
red: 100%
|
|
green: 0%
|
|
blue: 0
|
|
- delay: 5s
|
|
- light.turn_off:
|
|
id: led
|
|
|
|
media_player:
|
|
- platform: i2s_audio
|
|
id: media_out
|
|
name: "mediaplayer"
|
|
dac_type: external
|
|
i2s_dout_pin: ${pin_i2sdout}
|
|
mode: mono
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: ${pin_button}
|
|
inverted: true
|
|
name: "button"
|
|
on_press:
|
|
- voice_assistant.start:
|
|
on_release:
|
|
- voice_assistant.stop:
|
|
|
|
light:
|
|
- platform: neopixelbus
|
|
type: GRB
|
|
variant: ws2812X
|
|
pin: ${pin_LEDS}
|
|
num_leds: 1
|
|
name: "RGB_Light"
|
|
id: led
|
|
effects:
|
|
- random:
|
|
name: "Random"
|
|
transition_length: 4s
|
|
update_interval: 5s
|
|
- addressable_rainbow:
|
|
name: Rainbow Effect
|
|
speed: 10
|
|
width: 50 |