Error playing audio from Home Assistant to ESPHome device

I got a Muse Luxe and flashed it with ESP32. Then I set up the media player in home assistant. However, when I play something, I see the following error message on the console of the ESP:

[D][media_player:059]: 'RaspiAudio Muse Luxe' - Setting
[D][media_player:066]:   Media URL: https://ha.mydomain.net:8123/media/local/Door-Chime.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4YTQ1NDUzODJjM2U0YTg5ODgxNzViMzM5YTY0ZmI0MSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvRG9vci1DaGltZS5tcDMiLCJwYXJhbXMiOnt9LCJpYXQiOjE2Njg4OTc2NTMsImV4cCI6MTY2ODk4NDA1M30.LHXHa-GRXXt-Mv9H2N-Dsr6n3nWI9WEl1hH39upYK0s
[E][ssl_client.cpp:98] start_ssl_client(): Connect to Server failed!
[E][WiFiClientSecure.cpp:133] connect(): start_ssl_client: -1

Is the ESP trying to connect back to Home Assistant? If this is the case, can either of this be achieved?

  1. Set a specific media URL for the media player in Home Assistant. Home Assistant should NOT use ha.mydomain.net but 10.227.68.10. It also should NOT use TLS since it is a secured network
  2. Define a static host entry on the ESPhome device that resolves ha.mydomain.net to 10.227.68.10 ?

I am using my ESP devices in a dedicated VLAN without DHCP or DNS. There is deliberately no DNS server.

What did you tell it to play? Something stored on your HA machine?

Yes, Door-Chime.mp3 on the HA machine

What is are the network setting urls set to here Open your Home Assistant instance and manage your systems network configuration.

Both “Internet” and “Local Network” are set to: https://ha.mydomain.net:8123
For “Local Network”, “Automatic” is disabled.

Note that I have my own domain and DNS set up and I want my HA to be accessed with app and browser via https://ha.mydomain.net:8123, regardless of if I am home or not.
But what I do want is that when a request to play media is sent to some ESPhome device or squeezelite-esp32, that the URL does not use DNS but IP only. I hope this makes sense.

EDIT: I edited my original post to reflect ha.mydomain.net.

EDIT2: I just see it says “Configure what website addresses Home Assistant should share with other devices when they need to fetch data from Home Assistant (eg. to play text-to-speech or other hosted media).”. Does that mean the " Local Network " setting is used for that? If yes, how can I change this setting? Right now I can’t change it there and I see the message " Editor disabled because config stored in configuration.yaml. ". But I do not explicitely have any of these settings in configuration.yaml …

I think we are on the right track. But I don’t know why the system thinks it is configured in yaml. Check all included yaml files incl in packeges.

Ok, I configured it now via configuration.yaml and the internal URL now shows the IP address in the settings.

However, the ESPhome still received the external URL…

Precisely what code is trying to play the .mp3?

I am sorry I am new to the media player and do not really understand how it is supposed to work or which “code” you are referring to.

Here is a screenshot of the settings:

It adds a “RaspiAudio Muse Luxe” media player. So I just go to “Media”, select an MP3 and select “RaspiAudio Muse Luxe” as output device and hit play. Looks like this:

In the network settings I see the correct internal URL:

This is a result of this in my configuration.yaml:

homeassistant:                                                                                                                                                                                            
  unit_system: imperial                                                                                                                                                                                   
  packages: !include_dir_named packages                                                                                                                                                                   
  internal_url: "https://10.227.79.10:8123"

Yet when I hit play, the console window of the Muse Luxe still shows the message (same URL) has originally described.