Homepod mini as a media player (and tts output)

Hi,

I never tried to use my homepod as a media player outside of Apple’s ecosystem, but now I’m trying to implement some tts and the only media player at me is this. I found it cannot be used to play any media unless it is coming from itunes :slight_smile:

I’m getting the following error for any attempt to stream things there

/api/tts_proxy/38a89d72770e234062a0413f2b4f668ed97e10d3_hu-hu_74f2e47be6_tts.piper.wav (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate

My system uses nginx + let’s encrypt certificate, so it is not self signed

What’s wrong here? Is this even possible?

Thanks for your help
L:

Hi @vladx,

It might be that the issue isn’t with your SSL certificate, but instead caused by using a URL which isn’t available publicly.

How are you trying to play the TTS audio? I am using a HomePod mini which I added to Home Assistant using the Apple TV integration, and I can use standard TTS services with it as the target media_player entity.

I also tried the standard mediaplayer way. I even tried with a simple local media… this is strange

Perhaps the media folder isn’t accessible to the Apple TV integration?
Do you have media_source: included in your HA instance’s configuration.yaml file?

This is by default

For Home Assistant OS, Supervised and Container users, this folder is by default configured in the path /media .

Have you tried using another TTS platform? That way you could determine if the issue is with Piper.

Yes, I tried different tts platforms including piper and microsoft and I have the same errors, so this is why I decided to test with a simple media streaming and this produced the same ssl errors

I see, then it sounds like it indeed is an issue with the SSL. I suggest you review your NGINX & Let’s Encrypt settings.

Nothing fancy there. privkey.pem and fullchain.pem and the proper hostname and this works perfectly either internally or externally using the ‘hostname’. No certificate warning. So either tts/media play not connecting to the ‘hostname’ (maybe using the IP address of HA) or something else is wrong here but I can’t figure out…

If everything is correct with NGIX and Let’s Encrypt…maybe the HomePod is the issue?
If you don’t have any other media_player entities to test with, I suggest you install the Browser Mod integration which will provide you with a media_player entity on your computer/phone. That way you can rule out the HomePod being the cause of the issue.

Thank you. It seems this is specific to Homepod because with browser_mod it is working on my Mac and on iPhone too… I still don’t fully understand what is the workflow here, so when some trigger want to play a media (either local or tts) on Homepod, homepod will connect to HA and call some service? If this is true, it is either some strange root certificate issue (someone mentioned latest let’s encrypt certificate is not installed on all the homepods), or homepod trying to connect to somewhere else (e.g. the IP address of the HA instance…)

I think this is the bug behind it

Ssl-error with AppleTV-integration · Issue #97075 · home-assistant/core (github.com)

Or maybe not… it seems in my network when HA resolves the address of itself, it resolves to the external address which is blocked by the firewall… maybe Homepod also trying to access the media using the external address of HA which is blocked by the FW… I’m trying to figure out why…

So, finally it is clear this was nothing with HA, it was a pure network/DNS issue. After thinking a bit and fixing my resolver config, so HA no longer want to resolve itself to the external address, everything is fine… IT IS ALWAYS THE NETWORK! :slight_smile:

Happy you found the issue :+1: