Compare commits

..

No commits in common. "40e18e493b811b959cc9217db51db4440628f331" and "0c2d11f7fafe2e3d8e2e1d18717484b555e0e5aa" have entirely different histories.

3 changed files with 40 additions and 261 deletions

View File

@ -1 +1 @@
2023.5.4
2023.5.2

View File

@ -1,148 +0,0 @@
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: m5stack-atom-echo.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
speaker: atom_echo_speaker
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:
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
effect: pulse
on_end:
- delay: 1s
- wait_until:
not:
speaker.is_playing: atom_echo_speaker
- 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
speaker:
- platform: i2s_audio
id: atom_echo_speaker
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
update_interval: 250ms

View File

@ -21,18 +21,11 @@ wifi:
password: !secret fallback_psk
esphome:
name: ${name}
friendly_name: ${friendly_name}
name: "${name}"
name_add_mac_suffix: false
project:
name: raspiaudio.muse-luxe
version: "1.0"
min_version: 2023.5.0
on_boot:
then:
- media_player.volume_set:
id: luxe_out
volume: 50%
esp32:
board: esp-wrover-kit
@ -53,20 +46,17 @@ captive_portal:
improv_serial:
external_components:
- source: github://pr#3552 # DAC support https://github.com/esphome/esphome/pull/3552
- source: github://pr#3552
components: [es8388]
refresh: 0s
es8388:
i2s_audio:
- i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO5
media_player:
- platform: i2s_audio
name: None
id: luxe_out
name: ${friendly_name}
dac_type: external
i2s_dout_pin: GPIO26
mode: stereo
@ -74,79 +64,26 @@ media_player:
number: GPIO21
inverted: true
speaker:
- platform: i2s_audio
id: luxe_out_speaker
dac_type: external
i2s_dout_pin: GPIO26
mode: stereo
microphone:
- platform: i2s_audio
id: luxe_microphone
i2s_din_pin: GPIO35
adc_type: external
pdm: false
voice_assistant:
microphone: luxe_microphone
speaker: luxe_out_speaker
on_start:
- light.turn_on:
id: top_led
blue: 100%
red: 0%
green: 0%
effect: none
on_tts_start:
- light.turn_on:
id: top_led
blue: 60%
red: 20%
green: 20%
effect: none
on_tts_end:
- light.turn_on:
id: top_led
blue: 60%
red: 20%
green: 20%
effect: pulse
on_end:
- delay: 1s
- wait_until:
not:
speaker.is_playing: luxe_out_speaker
- light.turn_off: top_led
on_error:
- light.turn_on:
id: top_led
blue: 0%
red: 100%
green: 0%
effect: none
- delay: 1s
- light.turn_off: top_led
es8388:
sensor:
- platform: adc
pin: GPIO33
name: Battery
icon: "mdi:battery-outline"
device_class: voltage
state_class: measurement
entity_category: diagnostic
unit_of_measurement: V
update_interval: 15s
accuracy_decimals: 3
attenuation: 11db
raw: true
filters:
- multiply: 0.00173913 # 2300 -> 4, for attenuation 11db, based on Olivier's code
- exponential_moving_average:
alpha: 0.2
send_every: 2
- delta: 0.002
- platform: adc
pin: GPIO33
name: ${name} Battery
icon: "mdi:battery-outline"
device_class: voltage
state_class: measurement
unit_of_measurement: V
update_interval: 15s
accuracy_decimals: 3
attenuation: 11db
raw: true
filters:
- multiply: 0.00173913 # 2300 -> 4, for attenuation 11db, based on Olivier's code
- exponential_moving_average:
alpha: 0.2
send_every: 2
- delta: 0.002
binary_sensor:
- platform: gpio
@ -156,9 +93,9 @@ binary_sensor:
mode:
input: true
pullup: true
name: Volume Up
name: ${friendly_name} Volume Up
on_click:
- media_player.volume_up: luxe_out
- media_player.volume_up:
- platform: gpio
pin:
number: GPIO32
@ -166,9 +103,9 @@ binary_sensor:
mode:
input: true
pullup: true
name: Volume Down
name: ${friendly_name} Volume Down
on_click:
- media_player.volume_down: luxe_out
- media_player.volume_down:
- platform: gpio
pin:
number: GPIO12
@ -176,33 +113,23 @@ binary_sensor:
mode:
input: true
pullup: true
name: Action
on_multi_click:
- timing:
- ON FOR AT MOST 350ms
- OFF FOR AT LEAST 10ms
then:
- media_player.toggle: luxe_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:
name: ${friendly_name} Play Button
on_press:
- voice_assistant.start:
on_release:
- voice_assistant.stop:
light:
- platform: fastled_clockless
name: None
id: top_led
name: ${friendly_name}
pin: GPIO22
chipset: SK6812
num_leds: 1
rgb_order: grb
gamma_correct: 2.8
effects:
- pulse:
transition_length: 250ms
update_interval: 250ms
microphone:
- platform: i2s_audio
id: lux_microphone
i2s_din_pin: GPIO35
voice_assistant:
microphone: lux_microphone