ESPHome’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
media_player domain transforms ESP32 devices into fully functional Home Assistant media player entities. Using an I2S DAC (like the MAX98357A or PCM5102) or a compatible audio output peripheral, your ESP32 can stream audio from URLs, receive TTS announcements, maintain a play queue, and respond to media controls — all with native Home Assistant integration.
ESPHome media players require Home Assistant 2022.6 or newer.
Minimal Example
Base Media Player Configuration
Manually specify the ID for code generation. At least one of
id and name must be specified.The name of the media player in Home Assistant. Set to
None to inherit the device’s friendly_name.Manually override the MDI icon shown in the frontend.
If
true, the media player is not exposed to the frontend. Defaults to false.If
true, the entity is hidden in Home Assistant until manually enabled. Defaults to false.The entity category (
config, diagnostic). Set to "" to remove the default.Media Player Actions
All actions work with a single media player without specifying anid. When multiple players are defined, provide id: explicitly.
Not all actions are supported by every media player platform. Availability depends on the specific platform implementation.
media_player.play_media
Start playing audio from a URL.
media_player.enqueue
Add media to the player’s queue without interrupting current playback.
media_player.play / media_player.pause / media_player.stop
media_player.toggle
Toggle between play and pause.
media_player.volume_set
media_player.volume_up / media_player.volume_down
media_player.mute / media_player.unmute
Queue Management
Repeat and Shuffle
Power Control
Media Player Triggers
Media Player Conditions
media_player.is_announcing, media_player.is_muted, media_player.is_on, media_player.is_off.
Playing Media in Sequence
Usewait_until with media_player.is_idle to chain audio files.
Announcement Mode
Theannouncement parameter targets a separate audio pipeline (if supported by the platform), allowing TTS announcements to interrupt or overlay regular media.
Complete I2S Audio Example
Voice Assistant Integration
Media players integrate withvoice_assistant for TTS response playback.