Hello everyone! I wanted to share my journey and create a step-by-step guide for setting up Text-to-Speech (TTS) announcements on HomePods, including multiroom audio functionality. After spending quite some time researching and experimenting, I thought it would be helpful to document my process here in case others are looking to achieve the same setup.
My Setup
Before diving into the details, let me give you a quick overview of my setup:
- OpenHAB: Running on a Raspberry Pi 5 (8GB) with OpenHAB 4.3.2.
- Zigbee2MQTT: Running on a Raspberry Pi 4 (4GB) for Zigbee device management.
- QNAP NAS: TS-451+ with Container Station installed, which I use to manage Docker containers.
- HomePods: Several units spread throughout the house.
Relevant Software Components
- OpenHAB: The backbone of my smart home ecosystem.
- Pico TTS: A lightweight, offline TTS engine that doesn’t require internet connectivity.
- Owntone: A tool to stream music and control HomePods via Airplay.
Step-by-Step Guide
1. Setting Up Owntone
- Create a Dedicated User: I started by creating a dedicated user on my NAS for Owntone. This user needs read and write permissions for the required folders.
- Install Docker Image: I installed the official Owntone Docker image on my NAS. Make sure to configure the user, folder paths, and assign a fixed IP for Owntone.
- Test Connection: Access the Owntone web UI using the assigned IP and port. Test playing an MP3 file to ensure it works with your HomePods.
2. Mounting the Media Folder
To keep things organized, I mounted the Owntone media folder on my Raspberry Pi:
bash
sudo mkdir -p /mnt/nas_owntone_media
Edit /etc/fstab
to include the mount details:
bash
//192.168.1.103/owntone/media /mnt/nas_owntone_media cifs username=xxx,password=xxx,vers=3.0,uid=openhab,gid=openhab 0 0
Mount the folder and verify the setup:
bash
sudo mount -a
sudo systemctl daemon-reload
ls /mnt/nas_owntone_media
3. Installing Pico TTS
Install Pico TTS on your Raspberry Pi:
bash
sudo apt install libttspico-utils
Configure Pico TTS in the OpenHAB web UI, selecting it as the default TTS engine and choosing your preferred voice.
4. Rules for TTS Announcements
I created two rules to handle the TTS announcements:
Rule 1: Encode and Queue Messages
java
rule “tts-2”
when Item TabletTTSMessage received update
then
val newMessage = TabletTTSMessage.state.toString
// … (rest of the rule as described in the original post)
end
Rule 2: Generate WAV File and Play via HomePods
java
rule “tts-1”
when Item TabletTTSOutgoingMessage received update
then
// … (rest of the rule as described in the original post)
end
5. HomePod Configuration
I configured rules to control specific HomePods based on their IDs. For example, to play announcements in specific rooms, I mapped each HomePod to its respective ID and set the volume appropriately.
Final Thoughts
This setup has been working wonderfully for me, allowing me to send TTS announcements to specific HomePods throughout my house. The integration with OpenHAB makes it seamless to trigger these announcements from various automations and rules.
If you have any questions or need further clarification on any part of the setup, feel free to ask! I’d be happy to help.
Cheers,
[Your Name]