OliP
(Oli)
October 13, 2023, 1:58pm
1
Hey, i’ve just upgraded an M5 echo to the latest Assist - it’s all working but a purple LED is at full brightness the whole time and the LED control is showing as unavailable in my HA.
Flashed a new M5 echo and get the same behaviour - is this expected?
Can i disable this somehow - as it will light up a room at night at current brightness.
Appreciate any advice anyone can offer.
Flashed using the web-installer from the “$13 voice assistant” blog post.
OliP
(Oli)
October 13, 2023, 2:07pm
2
Enabled the LED device in HA and can now turn the light off.
OliP
(Oli)
October 16, 2023, 11:40am
3
Still struggling with this actually.
Whenever the wake word detection is enabled, the LED is on full brightness.
If i turn off the LED, it turns back on after a few seconds, looking at the log it say it was caused by the light.turn_off service, which doesn’t make sense to me?
Log of me turning off both LEDs, and one immediately coming back on, but not the other.
I was able to change the LED brightness by changing some of the options within the config file.
Example file is here:
There are two main areas to adjust LED brightness:
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
blue: 100%
red: 100%
green: 0%
brightness: 100% # Edit standby brightness (Purple)
effect: none
else:
- light.turn_off: led
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%
brightness: 100% # Edit listening brightness (Blue pulse)
effect: pulse
on_tts_start:
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
brightness: 100% # Edit voice response brightness (Green pulse)
effect: pulse
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: led
blue: 0%
red: 100%
green: 0%
brightness: 100% # Edit error brightness (Red)
effect: none
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- lambda: |-
if (code == "wake-provider-missing" || code == "wake-engine-missing") {
id(use_wake_word).turn_off();
}
Hope that helps you out
1 Like
OliP
(Oli)
October 19, 2023, 1:53pm
5
Thanks, appreciate the prod in the right direction.
spudje
October 27, 2023, 9:45pm
6
Cool! However, how do I do this. The default config for the Atom in ESPHome is very limited. Should I replace it with the full config you posted or can I just change the brightness options under substitions? If so, how, can you give an example? Thanks!
OliP
(Oli)
October 27, 2023, 9:56pm
7
Use the full config.
Change this line:
brightness: 100% # Edit standby brightness (Purple)
I’ve set brightness to 0% when on standby.
Hope that helps.
1 Like
fanuch
November 1, 2023, 11:44pm
9
For anyone else who wants easier instructions:
Comment out these lines:
# packages:
# m5stack.atom-echo-voice-assistant: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
# esphome:
# name: ${name}
# name_add_mac_suffix: false
# friendly_name: ${friendly_name}
Note you should have something that looks like this at the end:
substitutions:
name: [redacted]
friendly_name: [redacted]
# packages:
# m5stack.atom-echo-voice-assistant: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
# esphome:
# name: ${name}
# name_add_mac_suffix: false
# friendly_name: ${friendly_name}
api:
encryption:
key: [redacted]
Then paste this in at the end of your file. I’ve already set and commented on brightness: 100%
to brightness 0%
under the script
section:
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.10.0
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
logger:
ota:
dashboard_import:
package_import_url: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
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
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%
brightness: 100%
effect: pulse
on_tts_start:
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
brightness: 100%
effect: pulse
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: led
blue: 0%
red: 100%
green: 0%
brightness: 100%
effect: none
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- lambda: |-
if (code == "wake-provider-missing" || code == "wake-engine-missing") {
id(use_wake_word).turn_off();
}
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:
transition_length: 250ms
update_interval: 250ms
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
blue: 100%
red: 100%
green: 0%
brightness: 0% ## Made this 0% from 100% for standby
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:
Then install
2 Likes