Bob
Avril 9, 2025, 9:18
1
Bonsoir,
j’ai un souci avec les blocs d’action TTS sur un media_player ESP32.
Lorsque l’automatisation est exécutée, le message vocal est ensuite répété toutes les minutes.
Rien de particulier dans les log de l’ESP32, le mp3 généré par l’automatisation est bien supprimé de \192.168.1.32\config\tts, il le retrouve peut être en cache !
Donc toutes les minutes j’ai le droit au message sur mon media_player !!!
C’est une automatisation est lancée via un bouton:
L’automatisation, la seule qui n’a pas de trigger, c’est peut être le problème et je devrais sans doute passer par un script ?
Rien dans l’historique d’exécution lors de la diffusion de message, les autres actions ne sont pas exécutées.
C’est un problème très récent .
alias: Localisation iPhone Bob
description: ""
triggers: []
conditions: []
actions:
- metadata: {}
data:
message: Mon iPhone est ici
title: Phone
data:
push:
sound:
name: default
critical: 1
volume: 1
action: notify.mobile_app_iphone_x2
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: media_player.esp32_voice_control_1_mediasat1
message: >-
Il est {{ now().strftime('%H:%M')}}, as-tu trouvé ton téléphone situé
{{state_attr('sensor.iphone_x2_geocoded_location','Name') }} ?
target:
entity_id: tts.piper
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- action: tts.clear_cache
metadata: {}
data: {}
mode: single
Après redémarrage, fin des messages, à suivre.
EDIT: même souci avec une autre automatisation « TTS », qui elle a un déclencheur !
Pour résumer, une fois l’automatisation déclenchée, le message se répète sans arrêt toutes les minutes, je dois redémarrer HA pour stopper le problème.
Je pense que c’est depuis la dernière maj HA ou ESPHome builder.
Bob
Salut,
pourquoi tu le mets en cache ?
Avec cache: false
et supprimer :
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- action: tts.clear_cache
metadata: {}
data: {}
Ça donne quoi ?
Bob
Avril 10, 2025, 7:56
3
Bonjour @WarC0zes
J’ai suivi ton idée, puis j’ai rechargé les automatisations, pas mieux, redémarrer HA pour voir mais pas mieux.
Ce n’ai pas l’automatisation qui diffuse les messages toutes les minutes car j’ai le même problème si je désactive l’automatisation.
Donc côté ESP32 j’ai fait un « clean build files » et flasher, mais toujours le problème (ESPHome builder : 2025.3.3).
Extrait code ESP32 media_player:
captive_portal:
# voice assistant
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO26 #WS / LRC
i2s_bclk_pin: GPIO25 #SCK /BCLK
microphone:
- platform: i2s_audio
adc_type: external
pdm: false
id: mic_i2s
bits_per_sample: 32bit
i2s_audio_id: i2s_in
i2s_din_pin: GPIO33 #SD
media_player:
- platform: i2s_audio
id: mediasat1
name: "mediasat1"
i2s_dout_pin: GPIO27
dac_type: external
mode: mono
button:
- platform: restart
id: reboot
name: "Reboot V1"
switch:
- platform: gpio
name: "LedBleu2"
id: led
pin: 2
# Example configuration entry
web_server:
port: 80
Je viens aussi de tester une autre automatisation sur mon assistant vocal ESP32:
alias: Vocale faire sonner iPhone
description: ""
triggers:
- command:
- Où est mon téléphone
- Fait sonner mon téléphone
- J'ai perdu mon téléphone
trigger: conversation
conditions: []
actions:
- metadata: {}
data:
message: Mon iPhone est ici
title: Phone
data:
push:
sound:
name: default
critical: 1
volume: 1
action: notify.mobile_app_iphone_x2
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- set_conversation_response: >-
Il est {{ now().strftime('%H:%M')}}, Bruno, as-tu trouvé ton téléphone
situé {{ state_attr('sensor.iphone_x2_geocoded_location','Name') }}, bonne
journée Bruno.
mode: single
Même problème, il me répète le message toutes les minutes.
Une vraie cacophonie à la maison
Bob
1 « J'aime »
Je n’ai pas de esp avec media_player, je ne peux pas tester. Le TTS fonctionne bien sur mes Google Home, je n’ai pas ce problème.
Ça viendrait de esphome, je pense a voir les issues :
ouvert 01:01PM - 08 Apr 25 UTC
### The problem
After the update to ESPHOME 2025.3.X when I issue TTS message w… ith cloud to the esphome media_player, the message repeats from the speaker indifferently with a period of around the 30s.
It is doing this on my all esphome speakers. Both are running platform arduino, one is ESP32 the other is ESP32S3.
The current fix is to call pause for the media player after some delay.
### Which version of ESPHome has the issue?
2025.3.X
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2025.4.X
### What platform are you using?
ESP32
### Board
ESP32 and ESP32S3
### Component causing the issue
media_player
### YAML Config
One:
```yaml
esphome:
name: paster-display
platformio_options:
build_flags: “-DBOARD_HAS_PSRAM”
esp32:
board: lolin_s3
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ***********
ota:
- platform: esphome
password: ********************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Paster-Old Fallback Hotspot"
password: **************
captive_portal:
spi:
clk_pin: GPIO40
mosi_pin: GPIO41
miso_pin: GPIO39
color: !include ./shared/my_colors.yaml
font: !include ./shared/my_fonts.yaml
display:
- platform: ili9xxx
model: ST7796
data_rate: 40MHz
rotation: 90
invert_colors: false
dc_pin: GPIO42
reset_pin: GPIO2
update_interval: 1s
lambda: |-
it.fill(COLOR_BLACK);
it.print(0, 0, id(helvetica_24), id(my_red), TextAlign::TOP_LEFT, "Hello World!");
static int xx = 10;
xx +=10;
if (xx > it.get_width())
xx = 0;
it.print(0, 50, id(helvetica_48), id(my_green), TextAlign::TOP_LEFT, "Hello World!");
it.print(xx, it.get_height(), id(helvetica_48), id(my_blue), TextAlign::BOTTOM_RIGHT, "Hello World!");
auto touch = id(my_touchscreen)->get_touch();
if (touch) // or touch.has_value()
it.filled_circle(touch.value().x, touch.value().y, 10, id(my_red));
touchscreen:
platform: xpt2046
id: my_touchscreen
cs_pin: GPIO38
interrupt_pin: GPIO48
update_interval: 50ms
threshold: 400
calibration:
x_min: 280
x_max: 3860
y_min: 340
y_max: 3860
on_touch:
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);
output:
- platform: ledc
pin: GPIO45
id: my_backlight_gpio
light:
- platform: monochromatic
output: my_backlight_gpio
#name: "Display Backlight"
id: my_backlight
restore_mode: ALWAYS_ON
i2s_audio:
i2s_lrclk_pin: GPIO47
i2s_bclk_pin: GPIO21
media_player:
- platform: i2s_audio
name: Paster player
dac_type: external
i2s_dout_pin: GPIO46
mode: mono
```
Second:
```yaml
esphome:
name: obchudek-zvonek
friendly_name: obchudek-zvonek
esp32:
board: lolin32_lite
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: *********
ota:
platform: esphome
password: ****************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Obchudek-Zvonek Fallback Hotspot"
password: ****************
sensor:
- platform: wifi_signal
name: "RSSI"
id: sensor_rssi
update_interval: 90s
entity_category: "diagnostic"
- platform: uptime
name: "Uptime"
id: sensor_uptime
update_interval: 300s
entity_category: "diagnostic"
status_led:
pin: GPIO22
media_player:
- platform: i2s_audio
name: "Repracek"
dac_type: external
i2s_dout_pin: GPIO4
mode: mono
i2s_audio:
i2s_lrclk_pin: GPIO17
i2s_bclk_pin: GPIO16
binary_sensor:
- platform: gpio
pin:
number: GPIO18
inverted: True
mode: INPUT_PULLUP
name: "Zvonek"
filters:
- delayed_on_off: 10ms
light:
- platform: neopixelbus
type: GRB
variant: WS2812
pin: GPIO14
num_leds: 1
name: "Indikator"
id: my_light
effects:
- pulse:
name: "Slow Pulse"
# transition_length: 1s # defaults to 1s
update_interval: 2s
i2c:
scl: GPIO26
sda: GPIO25
pn532_i2c:
update_interval: 1s
on_tag:
then:
- if:
condition:
lambda: !lambda |-
if (!tag.has_ndef_message()) {
return 0;
}
auto message = tag.get_ndef_message();
auto records = message->get_records();
for (auto &record : records) {
std::string payload = record->get_payload();
size_t pos = payload.find("https://www.home-assistant.io/tag/");
if (pos != std::string::npos) {
return 1;
}
}
return 0;
then:
- homeassistant.tag_scanned: !lambda |-
if (!tag.has_ndef_message()) {
return x;
}
auto message = tag.get_ndef_message();
auto records = message->get_records();
for (auto &record : records) {
std::string payload = record->get_payload();
size_t pos = payload.find("https://www.home-assistant.io/tag/");
if (pos != std::string::npos) {
return payload.substr(pos + 34);
}
}
return x;
else:
- logger.log: "NFC tag unsupported"
```
### Anything in the logs that might be useful for us?
When the error happens, in the logs I see only:
```txt
[15:03:00][W][component:237]: Component api took a long time for an operation (105 ms).
[15:03:00][W][component:238]: Components should block for at most 30 ms.
```
But with the correct announcement I get this:
```txt
[15:03:16][D][sensor:094]: 'RSSI': Sending state -54.00000 dBm with 0 decimals of accuracy
[15:03:40][D][media_player:074]: 'Repracek' - Setting
[15:03:40][D][media_player:081]: Media URL: http://192.168.100.34:8123/api/tts_proxy/Sm-SBtRkWBgO0HM_GQdmUA.mp3
[15:03:40][D][media_player:087]: Announcement: yes
[15:03:40][W][component:237]: Component api took a long time for an operation (109 ms).
[15:03:40][W][component:238]: Components should block for at most 30 ms.
```
### Additional information
_No response_
ouvert 03:38PM - 06 Apr 25 UTC
### The problem
so i dont know if anyone has reported this issue or not if so … sorry..
so i use nodered to export audio to little esphome esp32 devices in the last couple fixes prior it would work it would play audio and stop after 20 seconds.. now it doesnt stop it randomly plays the audio message
if you shut off nodered... if you remove esp devices from home assistant.. it still keeps playing the audio file.. nothing stops it except a reboot of the esp32.. so i use it to anouncing an incoming phone call.. but after 20 seconds it should stop playing and it does that... but then randomly every 20 seconds or what not it will repeat the audio.. like the audio is saved in the esp32 device and it keeps replaying it like a stuck in ram or stuck buffering or whatever you call it..
### Which version of ESPHome has the issue?
2025.3.3
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2025.4.1
### What platform are you using?
ESP32
### Board
_No response_
### Component causing the issue
_No response_
### YAML Config
```yaml
here is my code
##############
### Bedroom ###
##############
esphome:
name: speaker-1
friendly_name: "Speaker #1"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "NojvwCefQii8YN3rIz/vBGtcth0xMBB4KFvt8/nfaM4="
ota:
platform: esphome
password: "00b8433143fa1e2b21ddaf8da034f8a4"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Speaker-1 Fallback Hotspot"
password: "BHlK4SVkN5Cn"
captive_portal:
web_server:
i2s_audio:
i2s_lrclk_pin: GPIO16
i2s_bclk_pin: GPIO21
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
dac_type: external
i2s_dout_pin: GPIO17
mode: mono
switch:
#####################
### Reboot Switch ###
#####################
- platform: restart
name: "Restart"
binary_sensor:
- platform: status
name: "Status"
text_sensor:
######################################################
### Uptime Sesnor Template To Show In Hour Min Sec ###
######################################################
- platform: template
name: "Uptime"
id: uptime_human
icon: mdi:clock-start
sensor:
- platform: uptime
name: Uptime Sensor
id: uptime_sensor_speaker_1
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor_speaker_1).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
```
### Anything in the logs that might be useful for us?
```txt
[11:55:23][D][text_sensor:064]: 'Uptime': Sending state '43s'
[11:55:23][D][sensor:094]: 'Uptime Sensor': Sending state 42.65200 s with 0 decimals of accuracy
[11:55:41][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[11:55:41][D][esp32.preferences:114]: Saving 1 preferences to flash...
[11:55:41][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:56:23][D][text_sensor:064]: 'Uptime': Sending state '1m 43s'
[11:56:23][D][sensor:094]: 'Uptime Sensor': Sending state 102.64700 s with 0 decimals of accuracy
[11:57:23][D][text_sensor:064]: 'Uptime': Sending state '2m 43s'
[11:57:23][D][sensor:094]: 'Uptime Sensor': Sending state 162.65401 s with 0 decimals of accuracy
[11:58:23][D][text_sensor:064]: 'Uptime': Sending state '3m 43s'
[11:58:23][D][sensor:094]: 'Uptime Sensor': Sending state 222.64900 s with 0 decimals of accuracy
[11:59:23][D][text_sensor:064]: 'Uptime': Sending state '4m 43s'
[11:59:23][D][sensor:094]: 'Uptime Sensor': Sending state 282.64801 s with 0 decimals of accuracy
[12:00:23][D][text_sensor:064]: 'Uptime': Sending state '5m 43s'
[12:00:23][D][sensor:094]: 'Uptime Sensor': Sending state 342.64700 s with 0 decimals of accuracy
[12:01:23][D][text_sensor:064]: 'Uptime': Sending state '6m 43s'
[12:01:23][D][sensor:094]: 'Uptime Sensor': Sending state 402.64999 s with 0 decimals of accuracy
[12:02:23][D][text_sensor:064]: 'Uptime': Sending state '7m 43s'
[12:02:23][D][sensor:094]: 'Uptime Sensor': Sending state 462.64700 s with 0 decimals of accuracy
[12:02:36][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:36][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/1ORTctml5pYgE-02YLBtrw.mp3
[12:02:36][D][media_player:087]: Announcement: yes
[12:02:37][W][component:237]: Component i2s_audio.media_player took a long time for an operation (543 ms).
[12:02:37][W][component:238]: Components should block for at most 30 ms.
[12:02:39][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:39][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/u_fAnztL1h9b-Xqfj5r2hA.mp3
[12:02:39][D][media_player:087]: Announcement: yes
[12:02:39][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:39][W][component:238]: Components should block for at most 30 ms.
[12:02:42][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:42][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/y2ymGQtcQUT3MbTfNM5azA.mp3
[12:02:42][D][media_player:087]: Announcement: yes
[12:02:42][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:42][W][component:238]: Components should block for at most 30 ms.
[12:02:45][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:45][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/hyoVgPKoPJrCopy5R9dQQQ.mp3
[12:02:45][D][media_player:087]: Announcement: yes
[12:02:45][W][component:237]: Component api took a long time for an operation (112 ms).
[12:02:45][W][component:238]: Components should block for at most 30 ms.
[12:02:48][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:48][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/X3PauFjAzfXGaNn_kUj7xQ.mp3
[12:02:48][D][media_player:087]: Announcement: yes
[12:02:48][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:48][W][component:238]: Components should block for at most 30 ms.
[12:02:51][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:51][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/h3Ml9TMQPalCXB0SGAONxA.mp3
[12:02:51][D][media_player:087]: Announcement: yes
[12:02:51][W][component:237]: Component api took a long time for an operation (111 ms).
[12:02:51][W][component:238]: Components should block for at most 30 ms.
[12:02:54][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:54][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/fiFVJXDmA5ywPJt2W3jQmw.mp3
[12:02:54][D][media_player:087]: Announcement: yes
[12:02:54][W][component:237]: Component api took a long time for an operation (128 ms).
[12:02:54][W][component:238]: Components should block for at most 30 ms.
[12:03:23][D][text_sensor:064]: 'Uptime': Sending state '8m 43s'
[12:03:23][D][sensor:094]: 'Uptime Sensor': Sending state 522.64697 s with 0 decimals of accuracy
[12:04:00][W][component:237]: Component i2s_audio.media_player took a long time for an operation (85 ms).
[12:04:00][W][component:238]: Components should block for at most 30 ms.
[12:04:23][D][text_sensor:064]: 'Uptime': Sending state '9m 43s'
[12:04:23][D][sensor:094]: 'Uptime Sensor': Sending state 582.64697 s with 0 decimals of accuracy
[12:05:05][W][component:237]: Component i2s_audio.media_player took a long time for an operation (80 ms).
[12:05:05][W][component:238]: Components should block for at most 30 ms.
[12:05:23][D][text_sensor:064]: 'Uptime': Sending state '10m 43s'
[12:05:23][D][sensor:094]: 'Uptime Sensor': Sending state 642.64697 s with 0 decimals of accuracy
[12:06:10][W][component:237]: Component i2s_audio.media_player took a long time for an operation (82 ms).
[12:06:10][W][component:238]: Components should block for at most 30 ms.
[12:06:23][D][text_sensor:064]: 'Uptime': Sending state '11m 43s'
[12:06:23][D][sensor:094]: 'Uptime Sensor': Sending state 702.64697 s with 0 decimals of accuracy
[12:07:16][W][component:237]: Component i2s_audio.media_player took a long time for an operation (81 ms).
[12:07:16][W][component:238]: Components should block for at most 30 ms.
[12:07:23][D][text_sensor:064]: 'Uptime': Sending state '12m 43s'
[12:07:23][D][sensor:094]: 'Uptime Sensor': Sending state 762.64697 s with 0 decimals of accuracy
[12:08:21][W][component:237]: Component i2s_audio.media_player took a long time for an operation (79 ms).
[12:08:21][W][component:238]: Components should block for at most 30 ms.
[12:08:23][D][text_sensor:064]: 'Uptime': Sending state '13m 43s'
[12:08:23][D][sensor:094]: 'Uptime Sensor': Sending state 822.64697 s with 0 decimals of accuracy
[12:09:23][D][text_sensor:064]: 'Uptime': Sending state '14m 43s'
[12:09:23][D][sensor:094]: 'Uptime Sensor': Sending state 882.64697 s with 0 decimals of accuracy
[12:09:26][W][component:237]: Component i2s_audio.media_player took a long time for an operation (81 ms).
[12:09:26][W][component:238]: Components should block for at most 30 ms.
```
### Additional information
_No response_
Bob
Avril 10, 2025, 8:11
5
Ok, merci @WarC0zes , je n’ai pas eu le reflexe d’aller voir les issues.
Le reboot de l’ESP permet de mettre fin au message.
C’est moche mais j’ai ajouté ça dans l’automatisation après la partie TTS.
Je vais attendre la correction ESPHome Builder
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- action: button.press
metadata: {}
data: {}
target:
entity_id: button.esp32_voice_control_1_reboot_v1
Bob
1 « J'aime »
Salut @Bob ,
un nouveau ESPHome 2025.4.0 est sortie, je pense qu’il y a un fix pour ton problème :
esphome:dev
← gnumpi:fix_speaker_media_player_deadlock
ouvert 08:42AM - 11 Apr 25 UTC
# What does this implement/fix?
This PR addresses a potential deadlock in the… speaker-media-player component. The deadlock occurs when a new media file is requested (which sets the PIPELINE_COMMAND_STOP flag) after the reader task sets the READER_MESSAGE_LOADED_MEDIA_TYPE flag, but before it is cleared by the decoder thread.
The issue arises due to a circular dependency between two flags:
- The PIPELINE_COMMAND_STOP flag doesn't get cleared until the READER_MESSAGE_LOADED_MEDIA_TYPE flag is cleared.
- However, the READER_MESSAGE_LOADED_MEDIA_TYPE flag is only cleared if PIPELINE_COMMAND_STOP is not set.
This mutual dependency results in both flags blocking each other, causing the pipeline to hang.
In this fix, I chose to clear the READER_MESSAGE_LOADED_MEDIA_TYPE flag even if the PIPELINE_COMMAND_STOP flag is set, in order to break the deadlock.
Please review whether this is the preferred approach, or if it would be better to instead remove the dependency on READER_MESSAGE_LOADED_MEDIA_TYPE being cleared before allowing PIPELINE_COMMAND_STOP to be cleared.
## Types of changes
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
- [ ] Other
**Related issue or feature (if applicable):**
- fixes <link to issue>
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):**
- esphome/esphome-docs#<esphome-docs PR number goes here>
## Test Environment
- [ ] ESP32
- [x] ESP32 IDF
- [ ] ESP8266
- [ ] RP2040
- [ ] BK72xx
- [ ] RTL87xx
## Example entry for `config.yaml`:
```yaml
# Example config.yaml
```
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
Bob
Avril 17, 2025, 3:49
7
Bonjour @WarC0zes
tu te lèves aux aurores
J’ai fais la mise à jour mais je pense que l’issue :
ouvert 03:38PM - 06 Apr 25 UTC
### The problem
so i dont know if anyone has reported this issue or not if so … sorry..
so i use nodered to export audio to little esphome esp32 devices in the last couple fixes prior it would work it would play audio and stop after 20 seconds.. now it doesnt stop it randomly plays the audio message
if you shut off nodered... if you remove esp devices from home assistant.. it still keeps playing the audio file.. nothing stops it except a reboot of the esp32.. so i use it to anouncing an incoming phone call.. but after 20 seconds it should stop playing and it does that... but then randomly every 20 seconds or what not it will repeat the audio.. like the audio is saved in the esp32 device and it keeps replaying it like a stuck in ram or stuck buffering or whatever you call it..
### Which version of ESPHome has the issue?
2025.3.3
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2025.4.1
### What platform are you using?
ESP32
### Board
_No response_
### Component causing the issue
_No response_
### YAML Config
```yaml
here is my code
##############
### Bedroom ###
##############
esphome:
name: speaker-1
friendly_name: "Speaker #1"
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "NojvwCefQii8YN3rIz/vBGtcth0xMBB4KFvt8/nfaM4="
ota:
platform: esphome
password: "00b8433143fa1e2b21ddaf8da034f8a4"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Speaker-1 Fallback Hotspot"
password: "BHlK4SVkN5Cn"
captive_portal:
web_server:
i2s_audio:
i2s_lrclk_pin: GPIO16
i2s_bclk_pin: GPIO21
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
dac_type: external
i2s_dout_pin: GPIO17
mode: mono
switch:
#####################
### Reboot Switch ###
#####################
- platform: restart
name: "Restart"
binary_sensor:
- platform: status
name: "Status"
text_sensor:
######################################################
### Uptime Sesnor Template To Show In Hour Min Sec ###
######################################################
- platform: template
name: "Uptime"
id: uptime_human
icon: mdi:clock-start
sensor:
- platform: uptime
name: Uptime Sensor
id: uptime_sensor_speaker_1
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor_speaker_1).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
```
### Anything in the logs that might be useful for us?
```txt
[11:55:23][D][text_sensor:064]: 'Uptime': Sending state '43s'
[11:55:23][D][sensor:094]: 'Uptime Sensor': Sending state 42.65200 s with 0 decimals of accuracy
[11:55:41][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[11:55:41][D][esp32.preferences:114]: Saving 1 preferences to flash...
[11:55:41][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[11:56:23][D][text_sensor:064]: 'Uptime': Sending state '1m 43s'
[11:56:23][D][sensor:094]: 'Uptime Sensor': Sending state 102.64700 s with 0 decimals of accuracy
[11:57:23][D][text_sensor:064]: 'Uptime': Sending state '2m 43s'
[11:57:23][D][sensor:094]: 'Uptime Sensor': Sending state 162.65401 s with 0 decimals of accuracy
[11:58:23][D][text_sensor:064]: 'Uptime': Sending state '3m 43s'
[11:58:23][D][sensor:094]: 'Uptime Sensor': Sending state 222.64900 s with 0 decimals of accuracy
[11:59:23][D][text_sensor:064]: 'Uptime': Sending state '4m 43s'
[11:59:23][D][sensor:094]: 'Uptime Sensor': Sending state 282.64801 s with 0 decimals of accuracy
[12:00:23][D][text_sensor:064]: 'Uptime': Sending state '5m 43s'
[12:00:23][D][sensor:094]: 'Uptime Sensor': Sending state 342.64700 s with 0 decimals of accuracy
[12:01:23][D][text_sensor:064]: 'Uptime': Sending state '6m 43s'
[12:01:23][D][sensor:094]: 'Uptime Sensor': Sending state 402.64999 s with 0 decimals of accuracy
[12:02:23][D][text_sensor:064]: 'Uptime': Sending state '7m 43s'
[12:02:23][D][sensor:094]: 'Uptime Sensor': Sending state 462.64700 s with 0 decimals of accuracy
[12:02:36][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:36][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/1ORTctml5pYgE-02YLBtrw.mp3
[12:02:36][D][media_player:087]: Announcement: yes
[12:02:37][W][component:237]: Component i2s_audio.media_player took a long time for an operation (543 ms).
[12:02:37][W][component:238]: Components should block for at most 30 ms.
[12:02:39][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:39][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/u_fAnztL1h9b-Xqfj5r2hA.mp3
[12:02:39][D][media_player:087]: Announcement: yes
[12:02:39][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:39][W][component:238]: Components should block for at most 30 ms.
[12:02:42][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:42][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/y2ymGQtcQUT3MbTfNM5azA.mp3
[12:02:42][D][media_player:087]: Announcement: yes
[12:02:42][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:42][W][component:238]: Components should block for at most 30 ms.
[12:02:45][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:45][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/hyoVgPKoPJrCopy5R9dQQQ.mp3
[12:02:45][D][media_player:087]: Announcement: yes
[12:02:45][W][component:237]: Component api took a long time for an operation (112 ms).
[12:02:45][W][component:238]: Components should block for at most 30 ms.
[12:02:48][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:48][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/X3PauFjAzfXGaNn_kUj7xQ.mp3
[12:02:48][D][media_player:087]: Announcement: yes
[12:02:48][W][component:237]: Component api took a long time for an operation (113 ms).
[12:02:48][W][component:238]: Components should block for at most 30 ms.
[12:02:51][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:51][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/h3Ml9TMQPalCXB0SGAONxA.mp3
[12:02:51][D][media_player:087]: Announcement: yes
[12:02:51][W][component:237]: Component api took a long time for an operation (111 ms).
[12:02:51][W][component:238]: Components should block for at most 30 ms.
[12:02:54][D][media_player:074]: 'ESPHome I2S Media Player' - Setting
[12:02:54][D][media_player:081]: Media URL: http://192.168.20.12:8123/api/tts_proxy/fiFVJXDmA5ywPJt2W3jQmw.mp3
[12:02:54][D][media_player:087]: Announcement: yes
[12:02:54][W][component:237]: Component api took a long time for an operation (128 ms).
[12:02:54][W][component:238]: Components should block for at most 30 ms.
[12:03:23][D][text_sensor:064]: 'Uptime': Sending state '8m 43s'
[12:03:23][D][sensor:094]: 'Uptime Sensor': Sending state 522.64697 s with 0 decimals of accuracy
[12:04:00][W][component:237]: Component i2s_audio.media_player took a long time for an operation (85 ms).
[12:04:00][W][component:238]: Components should block for at most 30 ms.
[12:04:23][D][text_sensor:064]: 'Uptime': Sending state '9m 43s'
[12:04:23][D][sensor:094]: 'Uptime Sensor': Sending state 582.64697 s with 0 decimals of accuracy
[12:05:05][W][component:237]: Component i2s_audio.media_player took a long time for an operation (80 ms).
[12:05:05][W][component:238]: Components should block for at most 30 ms.
[12:05:23][D][text_sensor:064]: 'Uptime': Sending state '10m 43s'
[12:05:23][D][sensor:094]: 'Uptime Sensor': Sending state 642.64697 s with 0 decimals of accuracy
[12:06:10][W][component:237]: Component i2s_audio.media_player took a long time for an operation (82 ms).
[12:06:10][W][component:238]: Components should block for at most 30 ms.
[12:06:23][D][text_sensor:064]: 'Uptime': Sending state '11m 43s'
[12:06:23][D][sensor:094]: 'Uptime Sensor': Sending state 702.64697 s with 0 decimals of accuracy
[12:07:16][W][component:237]: Component i2s_audio.media_player took a long time for an operation (81 ms).
[12:07:16][W][component:238]: Components should block for at most 30 ms.
[12:07:23][D][text_sensor:064]: 'Uptime': Sending state '12m 43s'
[12:07:23][D][sensor:094]: 'Uptime Sensor': Sending state 762.64697 s with 0 decimals of accuracy
[12:08:21][W][component:237]: Component i2s_audio.media_player took a long time for an operation (79 ms).
[12:08:21][W][component:238]: Components should block for at most 30 ms.
[12:08:23][D][text_sensor:064]: 'Uptime': Sending state '13m 43s'
[12:08:23][D][sensor:094]: 'Uptime Sensor': Sending state 822.64697 s with 0 decimals of accuracy
[12:09:23][D][text_sensor:064]: 'Uptime': Sending state '14m 43s'
[12:09:23][D][sensor:094]: 'Uptime Sensor': Sending state 882.64697 s with 0 decimals of accuracy
[12:09:26][W][component:237]: Component i2s_audio.media_player took a long time for an operation (81 ms).
[12:09:26][W][component:238]: Components should block for at most 30 ms.
```
### Additional information
_No response_
n’est pas corrigée, toujours le souci
Merci pour cette pensée très matinale.
J’ai commenté l’issue
Bob
Bob
Avril 18, 2025, 10:41
8
Suite au message privé d’un ami j’ai fait ceci et ça fonctionne:
Remplacement de :
esp32:
board: esp32dev
framework:
type: arduino
Par:
esp32:
board: esp32dev
framework:
type: esp-idf
Et remplacement de :
media_player:
- platform: i2s_audio
id: mediasat1
name: "mediasat1"
i2s_dout_pin: GPIO27
dac_type: external
mode: mono
Par :
speaker:
- platform: i2s_audio
id: output_speaker
i2s_dout_pin: GPIO27
dac_type: external
bits_per_sample: 32bit
channel: right
buffer_duration: 60ms
media_player:
- platform: speaker
name: "mediasat1"
id: mediasat1
announcement_pipeline:
speaker: output_speaker
format: WAV
codec_support_enabled: false
buffer_size: 6000
on_pause:
- logger.log: "Playback paused!"
on_idle:
- logger.log: "Playback finished!"
Merci.
Bob
1 « J'aime »
je me doute de qui c’est, le pro du voice assistant
qu’on le voit plus ces derniers mois.
1 « J'aime »
Bob
Avril 18, 2025, 11:33
10
Bon, ça fonctionne pour l’ESP32 qui fait juste player, pour l’assistant vocal, non et en plus je retombe sur un problème que j’avais déjà rencontré, ça fonctionne une fois (la requête vocale) et ensuite plus de détection.
C’est assez pénible ces changements fréquents sur ESPHome !
Bob
Oui, j’avoue… je ne peux plus compiler le firmware pour mon atom echo , ça demande trop au RPI4 maintenant et le fais crash.
Bob
Avril 18, 2025, 1:12
12
Oui parfois je dois arrêter NodeRed, InfluxDB et tout ce que je peux pour avoir assez de mémoire sur les 4Go.
Bob
bentou
Avril 18, 2025, 1:40
13
Sans compter qu’une fois recompilé, tu n’est pas certain que tout fonctionne et il te vire l’ancien binaire qui marchait…
faudrait pouvoir mettre un flag pour laisser la version telle qu’elle est et gérer un historique de plusieurs versions de firmware sur le rpi/pc…
pasque là c’est le foutware !!!
1 « J'aime »
AH , ça serait un problème de RAM, le plantage sur RPI4. J’ai que 2GO/4GO utilisé.
Bob
Avril 18, 2025, 1:47
15
Retour à la version 2024.12.1 d’ESPHome, toujours le problème, il y a peut-être aussi un souci côté HA non ?
Bob
Bob
Avril 18, 2025, 1:48
16
En compil ESP-IDF je tombais sous les 500 Mo et ça plantait d’où l’arrêt du maximum de modules avant de compiler.
Bob
Ok, donc ça consomme pas mal en RAM. Pour les restes des compilations, bluetooth proxy ou autre esp32 en esp-idf, ne pose pas de problème.
Salut @Bob ,
Finalement, j’ai installé ESPHome sur mon minipc sous win11 et j’ai mis à jour mon atom echo avec le firmware wake-word-voice-assistants, qui inclut le media_player.
Ça fonctionne bien, en plus j’ai supprimé l’esp de HA et a la réinstallation, ça m’a proposé d’utiliser en local avec speech to phrase. L’installation, c’est faite automatiquement et ça fonctionne plutôt bien sur un RPI4.
Du coup j’ai supprimé VOSK.