stahelp
(Peter)
August 13, 2021, 11:28am
1
I try to play an mp3 file via a Sonos speaker with the following service.
service: media_player.play_media
target:
entity_id: media_player.hobbyraum
data:
media_content_type: music
media_content_id: http://192.168.178.80:8123/local/Martinshorn.mp3
The file is not played and in the Sonos app I see the following error
I do not understand why the Sonos app is disconnected.
I also tried media_content_id : https://xxxx.duckdns.org:8123/local/Martinshorn.mp3 with no success.
Could the problem be related to the internal / external URL set in Configuration → General
(here I have twice https://xxxx.duckdns.org:8123 .
Thank you in advance.
Soccs
(Soccs)
August 14, 2021, 11:23am
2
same issue here… several others of us are having the same issue. i cant figure out why
This problem just started with me. Unable to do TTS because of it. In english the error reads “connection to xxx.duckdns.org was lost” I’ve tried IP address, I’ve tried setting / un-setting internal external adresses.
Soccs
(Soccs)
August 16, 2021, 9:44am
4
Yes, It seems the Duckdns is having a DDOS attack of some sort… so all wekeend they been having issues.
Soccs
(Soccs)
August 19, 2021, 10:02am
5
still the same i have tried everything
bnbn
(Bjorn)
August 23, 2021, 10:34am
6
anyone who has managed to solve this problem?
Same problem here…
I’ve started an issue:
opened 07:01PM - 25 Aug 21 UTC
The problem
When I make a service call with the following data:
service: media_player.play_media
target:
entity_id: media_player.sonos
data:
media_content_type: "music"
media_content_id: "http://hahost.duckdns.org:8123/local/media/sound.mp3"
It does not play...
integration: sonos
Workaround: host the .mp3 public on the internet and edit your service call data.
Peerke777
(Peter)
September 3, 2021, 10:20am
9
I have solved the problem by adding the lines to the http section:
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.32.0/24
You can find the Hassio internal ip-range by looking into the Supervisor - Multicast logging.
example: mdns-repeater (6): dev hassio addr 172.30.32.1 mask 255.255.254.0 net 172.30.32.0
1 Like
stahelp
(Peter)
September 22, 2021, 9:36am
10
Hi
I finally was able to solve the problem.
The problem is Duckdns and the solution is to use a proxy manager.
As I have a Nginx webserver running on a different host than HA I so could not install NPM on HA
as an add-on.
I did the following steps:
Configure config file for Nginx webserver on my host (not HA). I used a duckdns.org DNS
(I can provide more details about the the file if needed.
Stop Duckdns add-on in HA
Addapted configuration.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.178.129
Remove port forewarding 8123 from HA in my router
Now I can access my HA like https://xxx.duckdns.org (no port needed)
TTS via Sonos work again.
2 Likes
I ran into this issue when I switched to a nginx reverse proxy terminating TLS instead of having hass do it. It turns out forcing TLS v1.3 only did not sit well with Sonos, and changing the nginx config to accept TLS 1.2 also did the trick.
2 Likes
bbrendon
(bbrendon)
June 30, 2023, 12:21am
12
With newer hass versions this can be used:
service: media_player.play_media
target:
entity_id: media_player.office
data:
media_content_type: audio/mpeg
media_content_id: media-source://media_source/local/ej_music/Pingfong - Baby Shark.mp3
https://www.home-assistant.io/integrations/media_source/
other help: https://community.home-assistant.io/t/media-player-play-media-how-to-get-the-content-id/415486/2?u=bbrendon
1 Like