Has anyone got Speaker Audio Media Player running on anything like an esp32-s3-zero pls?
I’ve had a nightmare with updates breaking my DIY smart speaker for ages now… towards the end of last year I re-did it from scratch, brute-forcing what worked and what didnt. Had to settle on using the arduino framework and media player, nothing else would work out.
Over the last few months updates to both esphome and HA core break it in various ways again. So I’ve had to stop running the latest versions of both.
I saw mention of the (new?) Speaker Audio Media Player a couple of days ago, so thought I’d give it a try. Just a media player to begin with, which I’d use for various TTS notifications from HA. Then maybe a voice assistant.
I cant get it to make any noise at all, using the example from here, and hardware/connections that have worked with older versions of HA and esphome.
Other than the basic definition of the board, wifi, pins, an LED, I’ve copied/pasted the example.
Has anyone got this example working on anything like an esp32-s3?
Or can anyone see what I’m doing wrong?
Is this just not hardware that can be used for a smart speaker/media player now? Is there any DIY hardware that would work?
The yaml that isn’t working for me:
substitutions:
friendly_name: Jarvis2
host_name: jarvis2
led_brightness: 25% # RGB LED brightness for simple on/off
min_led_brightness: 20% # Min LED brghtness for effects
max_led_brightness: 40% # Max LED brghtness for effects
log_level: DEBUG # NONE, ERROR, WARN, INFO, DEBUG (Default), VERBOSE, VERY_VERBOSE
static_ip: 192.168.5.36 # Static ID details
static_gateway: 192.168.5.254
static_subnet: 255.255.255.0
static_dns: 192.168.5.2
vol_up_pin: GPIO12 # Button for Vol+
vol_down_pin: GPIO11 # Button for Vol-
amp_din_pin: GPIO04 # Amp DIN
amp_bclk_pin: GPIO05 # Amp BCLK
amp_lrc_pin: GPIO06 # Amp LRC
rgb_led_pin: GPIO21 # RGB LED pin, GPIO21 for onboard LED
no_leds: "1" # Number of RGB LEDs, 1 for onboard LED
api: # Enable Home Assistant API.
encryption:
key: !secret api_encryption_key
ota:
platform: esphome # For 2024.6.1+
password: !secret ota_password
safe_mode: # For 2024.6.1+
esphome:
name: $host_name
friendly_name: $friendly_name
platformio_options:
board_build.flash_mode: dio
on_boot:
- logger.log:
level: ERROR
format: "****Booted"
- light.turn_on:
id: rgb_led
brightness: $led_brightness
blue: 0%
red: 100%
green: 100%
esp32:
board: esp32-s3-devkitc-1
flash_size: 4MB
variant: esp32s3
framework:
type: esp-idf
version: recommended
psram:
mode: quad
speed: 80MHz
wifi: # WiFi connection details. Without domain:, defaults to .local. https://esphome.io/components/wifi.html
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
manual_ip:
static_ip: $static_ip
gateway: $static_gateway
subnet: $static_subnet
dns1: $static_dns
power_save_mode: none # NONE, LIGHT, HIGH
ap: # Enable fallback hotspot (captive portal) in case wifi connection fails
ssid: "${friendly_name} Fallback"
password: !secret fallback_password
captive_portal:
web_server:
port: 80
include_internal: true # include internal entities
local: true # Load everything locally rather than over the web
sensor:
- platform: wifi_signal # Reports the WiFi signal strength in dB. https://esphome.io/components/sensor/wifi_signal.html
name: "WiFi Signal dB" # Uncomment to show signal DB in HA
id: wifi_signal_db
update_interval: 60s # Report signal every minute
entity_category: "diagnostic"
device_class: "signal_strength"
disabled_by_default: true # Shows entity in HA, but disabled by default
internal: true
- platform: copy # Reports the WiFi signal strength %
source_id: wifi_signal_db
name: "WiFi Signal"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "%"
entity_category: "diagnostic"
device_class: "signal_strength"
disabled_by_default: true # Shows entity in HA, but disabled by default
- platform: uptime
id: uptime_seconds
# update_interval: 10s
internal: true # Uncomment to leave internal and not send to HA
name: "Uptime seconds"
entity_category: "diagnostic"
disabled_by_default: true # Shows entity in HA, but disabled by default
button:
- platform: restart
id: "restart_device"
name: "Restart"
entity_category: "diagnostic"
- platform: safe_mode
id: "restart_device_safe_mode"
name: "Restart (Safe Mode)"
entity_category: "diagnostic"
disabled_by_default: true # Shows entity in HA, but disabled by default
- platform: factory_reset
name: Restart with Factory Default Settings
disabled_by_default: true
entity_category: diagnostic
- platform: shutdown
name: "Shutdown"
disabled_by_default: true
entity_category: diagnostic
debug:
update_interval: 5s
text_sensor:
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: Wi-Fi IP
icon: mdi:wifi
mac_address:
name: Wi-Fi MAC
icon: mdi:wifi
- platform: version
name: "ESPHome Version"
icon: mdi:wrench-outline
disabled_by_default: true
- platform: debug
device:
name: "Device Info"
reset_reason:
name: "Reset Reason"
# Sync time with Home Assistant
time:
- platform: homeassistant
id: ha_time
logger: # Enable logging. https://esphome.io/components/logger.html
level: $log_level
baud_rate: 0 # Stops logging over onboard UART
binary_sensor:
- platform: status
name: "API Status"
- platform: gpio
pin:
number: $vol_up_pin
mode:
input: true
pullup: true
name: "Vol+"
filters:
- invert:
internal: true
on_press:
- media_player.volume_up
- light.turn_on:
id: rgb_led
brightness: $led_brightness
blue: 100%
red: 100%
green: 0%
- platform: gpio
pin:
number: $vol_down_pin
mode:
input: true
pullup: true
name: "Vol-"
filters:
- invert:
internal: true
on_press:
- media_player.volume_down
- light.turn_on:
id: rgb_led
brightness: $led_brightness
blue: 100%
red: 100%
green: 0%
light:
- platform: esp32_rmt_led_strip
id: "rgb_led"
name: "RGB LED"
pin: $rgb_led_pin
num_leds: 1
# rmt_channel: 0
rgb_order: GRB
chipset: ws2812
default_transition_length: 0ms
effects:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: $min_led_brightness
max_brightness: $max_led_brightness
- pulse:
name: "Slow Pulse"
# transition_length: 1s # defaults to 1s
update_interval: 2s
min_brightness: $min_led_brightness
max_brightness: $max_led_brightness
- pulse:
name: "Breathe"
transition_length:
on_length: 1s
off_length: 500ms
update_interval: 1.5s
min_brightness: $min_led_brightness
max_brightness: $led_brightness
- random:
name: Random
- random:
name: Random, custom timing
transition_length: 500ms
update_interval: 2s
- strobe:
- strobe:
name: Strobe Effect, RGBW
colors:
- state: true
brightness: $led_brightness
red: 100%
green: 0%
blue: 0%
duration: 1000ms
- state: true
brightness: $led_brightness
red: 0%
green: 100%
blue: 0%
duration: 1000ms
- state: true
brightness: $led_brightness
red: 0%
green: 0%
blue: 100%
duration: 1000ms
- state: true
brightness: $led_brightness
red: 100%
green: 100%
blue: 100%
duration: 1000ms
- flicker:
- flicker:
name: Flicker Effect With Custom Values
alpha: 95%
intensity: 1.5%
- lambda:
name: Lambda
update_interval: 1s
lambda: |-
static int state = 0;
auto call = id(rgb_led).turn_on();
// Transition of 1000ms = 1s
call.set_transition_length(1000);
if (state == 0) {
call.set_rgb(1.0, 1.0, 1.0);
} else if (state == 1) {
call.set_rgb(1.0, 0.0, 1.0);
} else if (state == 2) {
call.set_rgb(0.0, 0.0, 1.0);
} else {
call.set_rgb(1.0, 0.0, 0.0);
}
call.perform();
state += 1;
if (state == 4)
state = 0;
- addressable_rainbow:
- addressable_color_wipe:
- addressable_twinkle:
- addressable_random_twinkle:
i2s_audio:
i2s_lrclk_pin: $amp_lrc_pin
i2s_bclk_pin: $amp_bclk_pin
# sample_rate: 48000
speaker:
- platform: i2s_audio
id: speaker_id
dac_type: external
i2s_dout_pin: $amp_din_pin
sample_rate: 48000
- platform: mixer
id: mixer_speaker_id
output_speaker: speaker_id
source_speakers:
- id: announcement_spk_mixer_input
- id: media_spk_mixer_input
- platform: resampler
id: media_spk_resampling_input
output_speaker: media_spk_mixer_input
- platform: resampler
id: announcement_spk_resampling_input
output_speaker: announcement_spk_mixer_input
media_player:
- platform: speaker
name: "Speaker Media Player"
id: speaker_media_player_id
media_pipeline:
speaker: media_spk_resampling_input
num_channels: 2
announcement_pipeline:
speaker: announcement_spk_resampling_input
num_channels: 1
files:
- id: alarm_sound
file: pip.flac # Placed in the yaml directory. Should be encoded with a 48000 Hz sample rate, mono or stereo audio, and 16 bits per sample.
switch:
- platform: template
name: "Ring Timer"
id: timer_ringing
optimistic: true
restore_mode: ALWAYS_OFF
on_turn_off:
# Stop playing the alarm
- media_player.stop:
announcement: true
- mixer_speaker.apply_ducking: # Stop ducking the media stream over 2 seconds
id: media_spk_mixer_input
decibel_reduction: 0
duration: 2.0s
on_turn_on:
# Duck media audio by 20 decibels instantly
- mixer_speaker.apply_ducking:
id: media_spk_mixer_input
decibel_reduction: 20
duration: 0.0s
- while:
condition:
switch.is_on: timer_ringing
then:
# Play the alarm sound as an announcement
- media_player.speaker.play_on_device_media_file:
media_file: alarm_sound
# announcement: true
# Wait until the alarm sound starts playing
- wait_until:
media_player.is_announcing:
# Wait until the alarm sound stops playing
- wait_until:
not:
media_player.is_announcing:
Thanks a lot