I can’t find where this timeout is defined. I assume that if it’s increased, it will correct this.
I had the same issue (“HTTP_CLIENT: Connection timed out before data was ready!”) when the TTS took too long to respond. I traced the timeout to this line in the “nabu” component: client_config.timeout_ms = 5000;.
What I’ve done is copied the nabu component to a folder with custom components, increased the timeout on that line in the copied component and added the following to my esphome config to load my custom components folder (change the path to reflect your setup):
external_components:
- source:
type: local
path: /home/homeassistant/esphome_config/.esphome/custom_components
Now it waits for TTS to finish producing the response and announces it correctly, even for long responses!