substitutions:
name: "atom-echo"
friendly_name: "Atom Echo"
esphome:
name: "${name}"
friendly_name: "${friendly_name}"
name_add_mac_suffix: false
project:
name: m5stack.atom-echo-voice-assistant
version: "1.0"
min_version: 2023.11.1
on_boot:
- priority: -100
then:
- wait_until: api.connected
- delay: 1s
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
esp32:
board: m5stack-atom
framework:
type: esp-idf
dashboard_import:
package_import_url: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
logger:
api:
ota:
safe_mode: true
num_attempts: 5
password: !secret ota_password
web_server:
improv_serial:
wifi:
ssid: !secret esphome_ssid
password: !secret esphome_pwd
manual_ip:
static_ip: 192.168.1.139
gateway: !secret esphome_gateway
subnet: !secret esphome_subnet
dns1: !secret esphome_dns1
dns2: !secret esphome_dns2
fast_connect: true
text_sensor:
- platform: wifi_info
mac_address:
name: "${friendly_name} Mac Address"
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
speaker:
- platform: i2s_audio
id: echo_speaker
i2s_dout_pin: GPIO22
dac_type: external
mode: mono
voice_assistant:
id: va
microphone: echo_microphone
speaker: echo_speaker
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
vad_threshold: 3
on_listening:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
effect: "Slow Pulse"
on_stt_vad_end:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
effect: "Fast Pulse"
on_tts_start:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
brightness: 100%
effect: none
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: led
red: 100%
green: 0%
blue: 0%
brightness: 100%
effect: none
- delay: 1s
- script.execute: reset_led
on_client_connected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
- script.execute: reset_led
on_client_disconnected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
- light.turn_off: led
binary_sensor:
- platform: gpio
pin:
number: GPIO39
inverted: true
name: Button
disabled_by_default: true
entity_category: diagnostic
id: echo_button
on_click:
- if:
condition:
switch.is_off: use_wake_word
then:
- if:
condition: voice_assistant.is_running
then:
- voice_assistant.stop:
- script.execute: reset_led
else:
- voice_assistant.start:
else:
- voice_assistant.stop
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- voice_assistant.start_continuous:
light:
- platform: esp32_rmt_led_strip
id: led
name: None
disabled_by_default: true
entity_category: config
pin: GPIO27
default_transition_length: 0s
chipset: SK6812
num_leds: 1
rgb_order: grb
rmt_channel: 0
effects:
- pulse:
name: "Slow Pulse"
transition_length: 250ms
update_interval: 250ms
min_brightness: 50%
max_brightness: 100%
- pulse:
name: "Fast Pulse"
transition_length: 100ms
update_interval: 100ms
min_brightness: 50%
max_brightness: 100%
script:
- id: reset_led
then:
- if:
condition:
- switch.is_on: use_wake_word
- switch.is_on: use_listen_light
then:
- light.turn_on:
id: led
red: 100%
green: 89%
blue: 71%
brightness: 60%
effect: none
else:
- light.turn_off: led
switch:
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(va).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
- script.execute: reset_led
on_turn_off:
- voice_assistant.stop
- lambda: id(va).set_use_wake_word(false);
- script.execute: reset_led
- platform: template
name: Use Listen Light
id: use_listen_light
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- script.execute: reset_led
on_turn_off:
- script.execute: reset_led
external_components:
- source: github://pr#5230
components:
- esp_adf
refresh: 0s
esp_adf:
INFO ESPHome 2023.12.8
INFO Reading configuration /config/esphome/atom-echo.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
INFO Updating https://github.com/espressif/[email protected]
INFO Compiling app...
Processing atom-echo (board: m5stack-atom; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- framework-espidf @ 3.40405.230623 (4.4.5)
- tool-cmake @ 3.16.9
- tool-ninja @ 1.10.2
- toolchain-esp32ulp @ 2.35.0-20220830
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
JSONDecodeError: Expecting value: line 1 column 1 (char 0):
File "/usr/local/lib/python3.11/dist-packages/platformio/builder/main.py", line 173:
env.SConscript("$BUILD_SCRIPT")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/espressif32/builder/main.py", line 312:
target_elf = env.BuildProgram()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 61:
env.ProcessProgramDeps()
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 121:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
return self.method(*nargs, **kwargs)
File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 342:
SConscript(env.GetFrameworkScript(name), exports="env")
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662:
return method(*args, **kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
return _SConscript(self.fs, *files, **subst_kw)
File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/data/cache/platformio/platforms/espressif32/builder/frameworks/espidf.py", line 1326:
project_codemodel = get_cmake_code_model(
File "/data/cache/platformio/platforms/espressif32/builder/frameworks/espidf.py", line 222:
codemodel = json.load(fp)
File "/usr/lib/python3.11/json/__init__.py", line 293:
return loads(fp.read(),
File "/usr/lib/python3.11/json/__init__.py", line 346:
return _default_decoder.decode(s)
File "/usr/lib/python3.11/json/decoder.py", line 337:
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.11/json/decoder.py", line 355:
raise JSONDecodeError("Expecting value", s, err.value) from None
========================== [FAILED] Took 6.36 seconds ==========================