Clear TTS cache
Use this action to remove cached text-to-speech files and clear the in-memory cache. This is useful when you want to free up space or force messages to be generated again. To keep the messages you use regularly, only remove files that haven’t been used for a number of days.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To clear the cache from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- Search for and select Clear TTS cache.
- Select Save.
Options in the UI
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required. For how an automation or a script is built in YAML, refer to Automations in YAML and Scripts.
In YAML, refer to this action as tts.clear_cache. This example removes files that haven’t been used for 30 days:
action: tts.clear_cache
data:
days: 30
Options in YAML
Good to know
- Without
days, clearing the cache removes both the stored files and the in-memory cache. The next time a message is spoken, it is generated again. For more details, see the cache section. - With
days, a file counts as used each time a message is played from it. Messages that are still in the in-memory cache are never removed. - Home Assistant doesn’t clear the cache on its own. To keep it small, call this action with
daysfrom an automation, for example once a week.
Still stuck?
To test the action on its own, run it in the automation editor with Run action, and check the message that it shows. To see what the action did when the automation ran, open the trace of that run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, the Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.
Related actions
Explore related actions:
-
Speak: Speaks a message on a media player using text-to-speech.
-
Say a TTS message: Says a message on a media player using a legacy text-to-speech platform.