My way to use the HomePod as TTS device and for FM Radio with Siri

Hi,

I was using 1 Amazon Echo device for streaming live FM radio (TuneIn) and as a TTS output device (Reminders), but I am living in a Apple universe with Apple devices all around me, including smarthome devices connected to Homekit and using Siri and the Home app all day. With the release of the HomePod on this Monday in Germany, I needed to buy one even with the lack of some main features, because I am an Apple follower :). So I tried to solve this 2 missing main feateurs for me:

  • I want to say: “Hey Siri, play SWR3” and the HomePod should stream that radio station
  • I want to get TTS reminders from the HomePod

I managed to get both working in a real simple way! How? Read on:

What do you need:

  • Home Assistant :slight_smile:
  • HomePod
  • Apple TV (3rd or 4th Gen)

What are the needed steps:

  • Use the HA Homekit integration: HomeKit Bridge - Home Assistant
  • Integrate the Apple TV as a media player in HA: Apple TV - Home Assistant
  • Use the HomePod as default audio output device for the Apple TV device (this can be configured in the ATV settings directly)
  • Create an input_binary called “Radio” and expose it to Homekit (its then a Homekit switch)
  • Create an automation which controls the media player

Here are my configurations:

configuration.yaml

apple_tv:
  - host: 192.168.0.7
    login_id: 00000000-10de-bab8-5c52-32452354234506e
    credentials: 8E6491D051D64EEA:AAAAAAAAAA226B2D409E446BC34B6AA65E2773F427471992AAAAAAAA57768

input_boolean.yaml:

radio:
  name: HomePod Radio
  icon: mdi:radio

automations.yaml:

- id: Radio_ein
  alias: Radio_ein
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: input_boolean.radio
    to: 'on'
  condition: []
  action:
  - service: media_player.play_media
    data:
      entity_id: media_player.apple_tv
      media_content_id: http://mp3-live.swr3.de/swr3_m.m3u
      media_content_type: music

- id: Radio_aus
  alias: Radio_aus
  initial_state: 'on'
  trigger:
  - platform: state
    entity_id: input_boolean.radio
    to: 'off'
  condition: []
  action:
  - service: media_player.media_stop
    data:
      entity_id: media_player.apple_tv

In the Home App I changed the Name of the device from “Radio” to “SWR3”, and with that I can just say “Hey Siri start SWR3” and Radio is starting! With “Hey Siri stop SWR3” I can stop it again. Without changing this Siri interprets “Radio” to start Beats1 Radio from Apple Music, what I dont want to hear. So you need another name for the HomePod radio switch.

As a side effect I can use TTS with this ATV-workaround, too. My HomePod is now saying thing like “It begins to rain and your roof window ist still open”… :slight_smile:

Now I can get rid of my non Apple device from Amazon! :smiley:

Have fun!

5 Likes

Thanks for sharing this trick!
However I might missing something about TTS because it’s been diffused through tv speakers even if HomePod output is chosen.
Do you have an idea to get TTS through HomePod only?

Thanks!

Well I’m sorry, I didn’t upgraded my Apple TV …

Works well in TVOS 12 :slight_smile:

Sorry for the convenience.

This is a nice solution, but unfortunately it’s far away from perfect.

Because as I understand this, this is only possible on the apple tv (used as media player and a connected homepod)

I’m also a apple follower, but actually I want to ask alexa/siri something like “was the postman here already”. This also should be possible for all alexa/siri devices. And it should answer on the the I have spoken too.

This is already possible with alexa and the alexa mediaplayer component.

Would be great to have that to for siri. But I think that will never happen, as this would mean that devices like the iphone have to be mediaplayers. Only than you could send tts to them after you triggered an automation with siri.

By the way the alexa mediaplayer component team uses a sensor called sensor.last_alexa to be able to send tts to the last called alexa device. This way she answers to the device you called.

1 Like

I took an old ThinkPad T440 and installed MacOS on it. I installed the iTunes API from github on that laptop and then added the itunes media_player component. This allows home assistant to control iTunes on the laptop and toggle on and off AirPlay devices. This includes AirPlay 2 devices like stereo homepods. You cannot control Stereo or AirPlay 2 from Windows iTunes.

I was also about to generate TTS links and then add them to iTunes. I was then able to trigger items in my iTunes library using the itunes component. This includes TTS links I added manually to iTunes. I think it could be automated to get TTS links, add them to itunes and then trigger iTunes to play it.

Using this I am able to control 4 Stereo HomePods with few glitches. There is still a lot to be desired but I think its better than using the appletv.

1 Like

What exactly to you mean with “TTS links” are those files with “recorded” TTS messaged and then you play those certain files?

At the very end there is an example for getting a tts url.

2 Likes

I just found this “Homebridge” plugin: https://github.com/mcfisto/homebridge-airtunes-radio. Its completly independent of any “middleware” like my AppleTV, sounds just great to me :slight_smile:

Perhaps it is possible to integrate this directly in the Homekit solution of Home Assistant or as an additional custom component?! Unfortunately I am no developer…

As an alternative it would be great to have this directly as a Home Assistant mediaplayer: You could vote this feature request here: HomePod as a media player

1 Like

Seems somebody else is working on it as well

@nicx Quick question, when you send TTS messages to your homepod while music is playing how do you resume the music? Does it resume automatically or is it a manual process?

as far as i know it just resumes the playback after playing an audio file… but i am not sure anymore. i dont use this solution anymore because the airtunes-radio plugin for homebridge just stopped working a view months ago. working. for now i am waiting for ios 13 which includes fm radio playback directly :slight_smile:

maybe with this new ios version its even possible to find a new direct solution to playback tts files…but i dont know if this could be possible.

Does it also report back the player information (song name, play/pause status, etc.) when you control the HomePod directly via voice?

I believe it did but I have since migrated to just using binary switches forwarded to homekit that turn it on and off and don’t use TTS.

I was finding that the itunes component does not work great and the homepods would not always work in hass.

Does this technique still work? Is it the only way for now to do TTS with HomePod?

I don’t know if this still works, because I don’t use it anymore.

Radio Stations can be played directly with HomePod, and for TTS I am using forked-daapd with a HA media player device, which is working great.

I trying this way ton send TTS text to homepod, but unsuccesfully. I cannot connect on the Web UI of the add on how have you do this ?

Hey Guys, please check out this post https://bbs.hassbian.com/thread-13513-1-1.html
A custom component has been created to make tts available on HomePods.