Using Piper TTS in automations
This procedure shows you how to create a text-to-speech actionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called sequence. [Learn more]. For this, we use our local text-to-speech engine, Piper, and the media player serviceThe term “service” in Home Assistant is used in the sense of an information service. For example, the municipal waste management service that provides entities for organic, paper, and packaging waste. In terms of functionality, the information service is like a device. It is called service to avoid confusion, as it does not come with a piece of hardware. [Learn more]. Home Assistant can then speak to you over your media player as part of an automationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more].
- Go to Settings > Automations & Scenes, and select Create automation.
- Select Create new automation, then Add action.
- From the drop-down menu, select Play media and select the media player you want to use for this automation.
- Select Pick media, then, select Text-to-speech.
- To use fully local text-to-speech processing, select Piper.
- Enter the text you want to hear for this automation.
- Your text-to-speech action is now ready to be used in your script or automation.
- Save your action.