Since the 2025.4 update, I noticed that after I call the tts.microsoft_say after it finishes the TTS, the state does not go to IDLE. so it loops once a minute the TTS text. Anyone know what changed?
Please look in the releasenotes. - Media player toggle action changed
The media player just stays in “playing” state after the TTS run.
This happens only on TTS, not when I play MP3 files.
Could it be because the media player is ESP32 with ESPhome?
This is the script i use:
alias: Voice Notification - Lab
sequence:
- metadata:
title: com_on.mp3
thumbnail: null
media_class: music
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
- media_content_type: ""
media_content_id: media-source://media_source/local/STTNG
data:
media_content_id: media-source://media_source/local/STTNG/com_on.mp3
media_content_type: audio/mpeg
target:
entity_id: media_player.media_player_lab_media_player_lab
action: media_player.play_media
- wait_for_trigger:
- entity_id:
- media_player.media_player_lab_media_player_lab
to: idle
trigger: state
- data:
cache: false
entity_id: media_player.media_player_lab_media_player_lab
message: "{{ TTS_text }}"
language: en-US-JennyNeural
action: tts.microsoft_say
- wait_for_trigger:
- entity_id:
- media_player.media_player_lab_media_player_lab
to: "off"
trigger: state
continue_on_timeout: false
- metadata:
title: com_off.mp3
thumbnail: null
media_class: music
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
- media_content_type: ""
media_content_id: media-source://media_source/local/STTNG
data:
media_content_id: media-source://media_source/local/STTNG/com_off.mp3
media_content_type: audio/mpeg
target:
entity_id: media_player.media_player_lab_media_player_lab
action: media_player.play_media
description: ""
icon: mdi:speaker
mode: queued
max: 10
I suspect your mediaplayer does not have an ilde status, you could test it with an other mediaplayer. I have checked mine and all work like they should. I get the states, off, on., paused, idle, playing and unavailable.
I checked the esp32 media player logs and this happens
[13:16:08][W][component:237]: Component i2s_audio.media_player took a long time for an operation (83 ms).
[13:16:08][W][component:238]: Components should block for at most 30 ms.
Whenever this happens, the TTS is played again.
I guess i would have to wait for the next ESP Home update
You could try squeezelite esp32 if your main goal is a mediaplayer. It’s an easy install via the webinstaller.
Hello, everyone.
I have a similar problem, I searched for the reason for a long time.
I want to add the fact I found: if you play mp3 via a player, then there are no repetitions, but if you play a message using text-to-speech, then the repetitions are endless.
this is my esphome code
esphome:
name: media-player-lab
friendly_name: Media Player Lab
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: <API key>
ota:
- platform: esphome
password: <OTA key>
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.0.162
subnet: 255.255.255.0
gateway: 192.168.0.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Media-Player-Lab"
password: <AP key>
captive_portal:
i2s_audio:
i2s_lrclk_pin: GPIO25 #WS / LRC
i2s_bclk_pin: GPIO26 #SCK /BCLK
media_player:
- platform: i2s_audio
name: "Media Player Lab"
dac_type: external
i2s_dout_pin: GPIO27
mode: mono
switch:
- platform: restart
name: "Media Player Lab Reboot"
id: reboot_media_player_lab_reboot
sensor:
- platform: wifi_signal
name: "Media Player Lab WiFi Signal Sensor"
update_interval: 60s
I found a temporary solution, until the global fix.
It is necessary to create an additional command to play only the point.
There will be no sound, but the player will go into an idle state.
My temporary solution is to disable all my TTS notifications for now. Hahaha
I want to explain my solution: it is necessary to create an event (automation) that will play a “dot” using TTS on a timer. And after the “dot” is played, there will be no repetitions. I have been using this solution for the second day - it works great.
I have the same problem since updating to 2024.4: TTS to a homemade ESP Home media player repeats every minute.
I have the same output in the log as described by @11125 .
Disabling TTS is not an option as it is used for my doorbell.
@Maksys, I did not understand your solution. Are you playing another TTS with “.” after the one you sent?
Yes.
I spent half a day looking for a way out of the repetition problem and found a pattern: if you play MP3 (I saved some messages as a cache in mp3 and play them via mp3) - there are no repetitions. If you play the text via TTS - the last message is repeated endlessly.
You can stop repetitions only with the TTS command with the message content dot (“.”).
In my smart home I use Node RED, and I created a parallel command to play a TTS message “.” after 5…10 sec (depending on the main message) after the start of playing the main message.
When the problem is solved - I will simply delete the parallel TTS command.
The problem with this workaround is that we don’t actually know when the TTS message ends. I have different messages with different lengths. Also, not hearing anything doesnt mean that the “playing the dot” doesn’t waste resources.
The problem is still present in HA 2025.4.2.
I think that should be fixed in ESPHome.
I found that if I pass it a template {{ text string }} then in doesn’t go back to idle, just loops over and over again. BUT, if I pass the same {{ text string }} to the custom component ChimeTTS (which adds a chime MP3 and send it to TTS) then it works fine. So for now I use a chime with all my TTS notifications.
This approach solves the timing problem as you don’t need to know how long each one is.
Today’s update didnt solved the problem. I found a post about the problem at esphome
(post deleted by author)