(excuse my English)
Trying to get a siren for my burglar alarm via my IKEA speaker (Sonons).
I can not play a local mp3 file in the Sonos speakers (but works fine on my chromecasts).
I have been trying all possible paths to the file.
both: https://xxxxxxx.duckdns.org:8123
and 192.168.1.205/local/PoliceSiren.mp3
in different variants.
I have also tried:
media-source: //media_source/local/PoliceSiren.mp3
If I run the same path, it works on all my Chromecast
Why does Sonos not want to play?
I can play this on Sonos:
#https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3#
Which is not local.
What's the difference between Sonos and Chromecast?
Where should I start looking for the problem?
# Invändig siren via högtalare
- alias: 'Siren i högtalare'
trigger:
- platform: state
entity_id: switch.rorelsesensor_altan
to: 'on'
action:
- service: media_player.play_media
data:
entity_id: media_player.altan
media_content_id: 'media-source://media_source/local/PoliceSiren.mp3'
media_content_type: 'music'
I only have a old sonos play 1 and only play local MP3’s but what is different between your example and mine is I use a http access with port number specified:
- service: media_player.play_media
data_template:
media_content_id: '{% set b = now().strftime("%H") %} http://192.168.2.242:8123/local/sounds/cuckoo/cuckoo-clock-{{b}}.mp3
'
entity_id: media_player.living_room
media_content_type: music
I have tried with :8123.
When I run this I immediately get an error message in the sonos app in the mobile "lost connection to 192.168.1.205:8123.
Why does it look so simple for everyone?
Could it have something to do with SSL?
Hi, I’m not clear on how you are using the sonos app, not sure it should have any factor. you are just sending an mp3 file directly from your HA server to your Sonos device.
Can you get to the mp3 file from a command prompt? If you cannot download the mp3 file from a machine within your network, then your HA server is not going to be able to get the mp3 file to then forward to Sonos. The command below should download the source mp3 to the machine you run curl on. Then you should be able to play that file, if that does not work, then you have to fix access to the source file:
So grateful for all the help.
Here it looks like I have the problem.
I can not go on to /local/
I can go to /Lovelace.
I can enter via Samba share to /local/
What is the reason for this?
We seem to be running on the same version and I really cannot think of anything other than somewhere there is an authorization issue…
in terms of configuration.yaml I have the following that could in some way or form be related…
#default configuration
default_config:
# Enables configuration UI
config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
# base_url: https://mydomain.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
I do not have any whitelisting or anything similar.
Yes, on my config I use both MP3’s and Nabu Casa’s TTS. I just tried Google TTS and it works as well to Sonos.
I doubt this will make a difference by have you tried just putting the raw internal IP address of your home assistant server address in the call. I gotta say, I really am struggling to see why people call an external service from within their private network to lookup an internal address, but that is just me.
Here is another post, as per this guy, are you 100% sure you have your directory structure correct???
In my setup:
/home/user/homeassistant
maps to
/config
so my physical directory location of:
/home/user/homeassistant/www/sounds
looks like
/config/www/sounds
inside and to Home Assistant
and from a URL standpoint that is:
The more I read the less I understand.
Can not remember how I installed HA.
The path to the mp3 files in explorer looks like this.
\ HASSIO \ config \ WWW
If I click on the mp3 files after www, they play.
Can I enter this path in a good way?
I have tried “www” instead of “Local” without results.