Hello all, need some help with esphome. I have a esp32 running a simple program; a voltage detector for high rate electricity. This is working. I want to add a sound signal with a external Dac amp and a speaker. I tried many different way to code it with chatgpt and gemini but always have the same issue when trying to install. Platform not found; i2s_audio not found. No matter how i write the code. Speaker , media player etc… chatgpt suggest that i dont have the latest esphome because it should be there. However i do and also have the latest home assistant version. What am I doing wrong?
Thanks for your help
Use the configuration code from the documentation.
You possibly forgot to tell ChatGPT and Gemini to read the official, up to date documentation, so they probably gave you outdated AI slop.
Post what code you are trying, compile and brief run logs, properly formatted.
I think you have used
framework:
type: arduino
instead of
framework:
type: esp-idf
I’m not entirely sure how it was, but as far as I remember, I used “i2s:” for the “arduino” framework
(example:
i2s:
bck_pin: 21 # BLCK, SCK
ws_pin: 20 # LRCLK, WS, FS
din_pin: 10 # DIN, SDIN, SD, SDATA, ADCDATA
...
)
and “i2s_audio:” for the “idf” framework.
(example:
i2s_audio:
- id: sz_i2s_output
# i2s_output data pin is GPIO10
i2s_lrclk_pin: GPIO11 #LRC an MAX98357A
i2s_bclk_pin: GPIO9 #BCL an MAX98357A
)
I’m currently only using the “idf” framework.
Thanks so much for your help. I thought I would solved it going to idf framework as it is in documentation.However, I was not able to make it work. In the end Chatgpt suggested that my esphome 2025.12.1 was broken and I should reinstall because of the missing i2s components. I am not sure about that. What Am I missing? Each try i get i2s platform not found…sorry new to this.
esphome:
name: esp-garage
friendly_name: ESP_Garage
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
audio: # <<< REQUIRED IN ESPHOME 2025.x
api:
encryption:
key:“xxxx=”
ota:
- platform: esphome
password: “xxxxx”
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: “ESP-Garage Fallback”
password: “fallback123”
captive_portal:
web_server:
=========================
I2S BUS (MAX98357A)
=========================
i2s_audio:
- id: i2s_out
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO26
i2s_dout_pin: GPIO22
=========================
SPEAKER
=========================
speaker:
- platform: i2s_audio
id: garage_speaker
dac_type: external
i2s_audio_id: i2s_out
mode: mono
=========================
MEDIA PLAYER
=========================
media_player:
- platform: speaker
id: garage_player
name: “Garage Alert Speaker”
speaker: garage_speaker
=========================
24VAC DETECTION
=========================
binary_sensor:
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
inverted: true
name: “Electricity High Rate (24VAC)”
id: high_rate_sensor
filters:- delayed_on: 100ms
- delayed_off: 100ms
on_press: - media_player.play_media:
id: garage_player
media_url: “media-source://media_source/local/chimes/high_rate_alert.wav”
audio: # <<< REQUIRED IN ESPHOME 2025.x
This entry does not match the documentation.
Try repeating the example without llm.
@ Francisclou: If you post code please use
YAML is an indentation-sensitive language. The number of spaces before each command is important. Supporting your code in a corrupted version is very difficult…
Thanks for the tips guys, yes i did try without the audio line without success. Always the same issue speaker. i2s_audio platform not found…
esphome:
name: esp-garage
friendly_name: ESP_Garage
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
api:
encryption:
key: "xxxxxx="
ota:
- platform: esphome
"Xxxxx"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "ESP-Garage Fallback"
password: "fallback123"
captive_portal:
web_server:
# =========================
# I2S BUS (MAX98357A)
# =========================
i2s_audio:
- id: i2s_out
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO26
i2s_dout_pin: GPIO22
# =========================
# SPEAKER
# =========================
speaker:
- platform: i2s_audio
id: garage_speaker
dac_type: external
i2s_audio_id: i2s_out
mode: mono
# =========================
# MEDIA PLAYER
# =========================
media_player:
- platform: speaker
id: garage_player
name: "Garage Alert Speaker"
speaker: garage_speaker
# =========================
# 24VAC DETECTION
# =========================
binary_sensor:
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
inverted: true
name: "Electricity High Rate (24VAC)"
id: high_rate_sensor
filters:
- delayed_on: 100ms
- delayed_off: 100ms
on_press:
- media_player.play_media:
id: garage_player
media_url: "media-source://media_source/local/chimes/high_rate_alert.wav"
Modified version that I can compile (with the correkt encryption key):
esphome:
name: esp-garage
friendly_name: ESP_Garage
esp32:
board: esp32dev
framework:
type: esp-idf
logger:
api:
encryption:
key: "XXXXXX"
ota:
- platform: esphome
password: "hallo"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "ESP-Garage Fallback"
password: "fallback123"
captive_portal:
web_server:
# =========================
# I2S BUS (MAX98357A)
# =========================
i2s_audio:
- id: i2s_out
i2s_lrclk_pin: GPIO25
i2s_bclk_pin: GPIO26
#INVALID FOR i2s_audio: i2s_dout_pin: GPIO22
# =========================
# SPEAKER
# =========================
speaker:
- platform: i2s_audio
id: garage_speaker
dac_type: external
i2s_dout_pin: GPIO22 #<=enter out pin here
i2s_audio_id: i2s_out
channel: mono # stereo
sample_rate: 16000
i2s_mode: primary
bits_per_sample: 16bit #One of 8bit, 16bit, 24bit, or 32bit. Defaults to 16bit.
# =========================
# MEDIA PLAYER
# =========================
media_player:
- platform: speaker
id: garage_player
name: "Garage Alert Speaker"
buffer_size: 40000 #Must be between 4000 and 4000000. Defaults to 100000
# codec_support_enabled: true
announcement_pipeline:
speaker: garage_speaker
format: WAV # FLAC is the least processor intensive codec
num_channels: 1 # Stereo audio is unnecessary for announcements
# =========================
# 24VAC DETECTION
# =========================
binary_sensor:
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
inverted: true
name: "Electricity High Rate (24VAC)"
id: high_rate_sensor
filters:
- delayed_on: 100ms
- delayed_off: 100ms
on_press:
- media_player.play_media:
id: garage_player
media_url: "media-source://media_source/local/chimes/high_rate_alert.wav"
If this is not working uninstall ESPHome and install it again.
Thank you LutzDe, I did try your code without sucess, then uninstalled EspHome, rebooted HA , Re-installed EspHome latest version 2025.12.2 with the same result;
INFO ESPHome 2025.12.2
INFO Reading configuration /config/esphome/esp-garage.yaml…
INFO Unable to import component i2s_audio.speaker: No module named ‘esphome.components.i2s_audio.speaker’
Failed config
Platform not found: ‘speaker.i2s_audio’
Not sure what to do next. Is the issue only related to EspHome? Can this issue be related to the Esp32 itself?
Thanks again for your help
If ESPHome displays an error message during compilation when the libraries for the final program are being combined, the problem lies with the ESPHome installation.
Error messages found in the log after flashing (if the ESP doesn’t crash immediately) are related to the ESP and the connected hardware.
It’s possible you selected the wrong board and don’t actually own an ESP32 (or a different model), but even then, the program should still compile using the
"
esp32:
board: esp32dev
framework:
type: esp-idf
"
setting.
On what hardware did you install ESPHome? For example, a Raspberry Pi 3 with 2 GB of RAM or less is usually insufficient to run ESPHome without errors.
The error I copied in this thread happen literally seconds after clicking install and is the complete text displayed also if i click on logs.
My board is this one: Carte de développement ESP32 ESP32 WiFi + Bluetooth Consommation d’énergie ultra-faible touristes ESP-32S de ESP-32 de base ESP 32 similaire ESP8266
https://a.aliexpress.com/_msekbRJ
I am running HA of a mini PC with 3Gb of ram so I dont think its an issue.
Thanks again for your help
As far as I know, the recommended minimum amount of RAM to run Home Assistant and ESP Home on a PC is 4GB. I’m using 8GB of RAM. The problem sounds suspiciously like a RAM shortage.
Go back, read the official documentation and see what the outdated AI bots forgot to tell you. You are missing a critical line in your yaml.
@IOT7712: OK, which critical line is missing? I can compile it on my system.
Hint: You have multiple I2S devices, hence the optional parameter is not optional for you. Just because it compiles without errors does not mean it is going to work correctly. You have to understand what you are doing.
Instead of spouting off so arrogantly, you could just say what’s wrong. He doesn’t have multiple IS2 devices here, just one speaker.
Of course, I haven’t actually tested this example myself, and I’m not claiming it works 100% because I don’t have the hardware here right now. However, I don’t see any significant configuration differences compared to my voice assistant, which works with two IS2 devices.
Everyone can easily overlook something important and appreciates quick help.
Anyone can do a little research and experimenting, but if you spot a serious error, you should point it out and not play games…
Did you actually go and RTFM like I so politely suggested, and guided you towards?
Your AI is probably not the ‘quick help’ you are hoping for.
