This object is in archive! 

Sonos question

Darkwing shared this question 7 years ago
Need Answer

Hi,


I added a Sonos to my system, but are having issues playing sounds.


I have a drive connected to my router which is shared, and this is where I save the sound files, each in their own folder.


First I added a door chime, set it up so when the doorbell is pressed, this chime plays. This works.


Then I added a rule that when the door opens, it says the door is open. This also worked.


But now all of a sudden when I press the doorbell, it plays both files....?? Why would it do that? At first I had all the sound files in the same folder, so thought it just plays whatever is in there. So I made seperate folders for each, but still it plays both files.......


Any help is appreciated.


Thanks

Replies (12)

photo
1

Hey,

please post some pictures from your rules. This would help

photo
1

see below


f30db8fbb2cb0ddea859ae42cfc0d3b4

photo
1

so when the doorbell is active, it plays the doorbell sound, but also the other sound....... not sure why as that other sound is not mentioned in this rule and neither is the doorbell in the other rule....

photo
1

which sound comes first?

photo
1

the doorbell

photo
1

So it plays doorbell/other sound/wait 3 sec/doorbell/other sound?

photo
1

well, it plays doorbell, other sound waits 3 seconds and then plays doorbell. So only plays the other sound the first time....

photo
1

hmm.............seems it doesn't do anything anymore now.... :(

photo
1

volume is set.


I give up.... tried with Google drive but I can no longer get any sound out of it.....


Anybody has an example rule on how to play a sound that is stored online?


Thanks

photo
1

hi,


Here it is how I play a sound78ec39ff9e2eed49b06a919896448e6e

photo
1

Hi Olivier,


I was on holiday and just came back so could only test now. I tried your suggestion, and this does work, but I run into the same issue as experienced previously. As soon as I play a different sound, it looks like the Sonos app/speaker builds a queue, and then when I press the doorbell it plays both sounds.


So I assume when I play a third sound, then when pressing the doorbell it will play all 3......... is there a way to prevent this?


Thanks for the help.

photo
photo
1

I use sonos together with a small web-server. For an access to a NAS you normaly have to use an user and password. Or give a folder free to anyone. My URI is: IP:port-of-webserver:file.mp3. This works without any username or password. Perhaps you have this access problem.

photo
1

Hi,


try to delete both Rules. Sync - restart - again create the Rules and try again.


regards Helle

photo
1

Do I need to have the Sonos app installed for this to work? I think that app is the problem as I can see this queue growing, and every time I press the doorbell it starts playing this whole queue :-P

photo
1

You could experiment with RemoveAllTracksFromQueue (by HTTP POST)

photo
1

I have had all sorts of trouble getting Sonos to play a series of different sounds. I think I ran into the same problem as you.

My current system works, but it may not be what you need. I usually play from the line-in source, and I want to be able to interrupt that with alerts. Since there are no string variables in the Zipabox, I set up some variables as "constants" to represent each of my sounds. This allows me, more or less, to set up a single Alert rule that then plays whichever sound I specify.

The constants are first set up (RainAlert3.jpg) by a rule that runs every 10 minutes.

To fire the "rain" alert, I call the rule in RainAlert1.jpg that sets up the characteristics of the particular sound. This calls a generic "Alert" rule that I haven't shown here, because it's not really important. It plays the alert in each room of the house, one after the other. I've shown the rule that plays the alert in the bathroom (RainAlert2.jpg) (hey, who knows where I'll be when the sound plays, right?).

Normally, when the speakers are grouped, the URI of each one is set to x-rincon:RINCON_XXXX01400 where XXXX is the MAC address of the Sonos Connect which is the source of the line-in for the speakers. So the first thing I do is set the URI of the bathroom speaker to x-rincon-queue:RINCON_XXXX01400#0, where XXXX is the MAC address of the bathroom speaker - it separates it from the group and gives it its own queue, as it were. Then I set the volume, and then the URI to the MP3 I want with the x-file-cifs:// prefix. I then play the sound, wait for the relevant time, and then restore the URI to either x-rincon:RINCON_XXXX01400 (if I want to revert to grouping the bathroom speaker with the rest and playing line in), or x-rincon-stream:RINCON_XXXX01400, which keeps the speaker independent of the other speakers, but still plays the line-in source. In both cases, XXXX is the MAC address of the Sonos Connect.

By doing this, I find that I can successfully play one sound after another without running into the queuing problem.

photo
1

Hey David, I've been looking to use HTTP to set up my Sonos Bar in Nightmode automatically, can you tell me where I can find sonos API to use as reference please?

photo
1

There isn't really one clear source. I hunted around (keywords: Sonos SOAP request/uPnP) and found bits and pieces scattered around. Companies really don't like to release proper APIs, do they?


https://community.particle.io/t/how-to-do-soap-request/7853/20

http://forum.universal-devices.com/topic/11739-sonos-integration/

http://blog.travelmarx.com/2010/06/exploring-sonos-via-upnp.html

https://www.rilhia.com/tutorials/using-upnp-enabled-devices-talend-control-sonos-speakers


Look at the PHP code:

https://www.symcon.de/forum/threads/20150-UPNP-Device-ansteuern


This one is handy for getting information from your system, esp the MAC addresses:

https://bsteiner.info/articles/hidden-sonos-interface


I can't open this link now so here's my saved PDF

photo
1

The SoCo package may be able to control night mode. If you download it you might be able to pick apart the code and find out what SOAP request they're sending.

http://docs.python-soco.com/en/latest/api/soco.core.html

photo
2

Thanks a lot David will take a look, I knew you would have some sources to look into.

photo
1

Hey David, I have another question for you. I wanted to create rain alerts also, problem I see is that Zipato weather station can only tell you in that matter, mm of precipitation (already raining) but icon (which stores if it's cloudy) is a string which cannot be compared using current puzzles... so, your alerts are only based on mm rain?

photo
1

Hey Alberto.

That's a simple question with a long answer :-)

I have a Google App Script that runs every 10 minutes or so and feeds in lots of weather information from diverse sources into several virtual meters. I have Aeris, Wunderground, DarkSky, Weather2 and others. I then have some rules that look at how recent the updates are, and how reliable the sources are, and calculate a "consensus" for each value, which is stored in another meter. For some cases, like rain, I add the value from each weather source (if recently updated) as a "vote" and weight the vote according to what I judge to be the source's reliability (if you want to use just one, use Wundergound). I then add up the votes and come up with a value for current precipitation in mm, precipitation probability, etc. etc.


I know that I posted an older version of my script somewhere here but I can't find it (is there any way to search topics by phrase, like "Google app script"? It seems that it just returns all the results containing any one of the words).


I can post the latest version if you like, and some of my rules. The script needs cleaning up and breaking up because it's become a bit of a monster :-)

photo
1

:) Incredible how far some people go to get integration done is a reliable way...

photo
1

Hehe

photo
1

Wow, seems quite a bit of work, to be honest I don't know how to create a google script, if you can share I will apreciate however, seems I will need to do some research in order to understand it, I guess one source for weather forecast is OK.


Seems that Zipato needs to do some work into the virtual weather station, what is the purpose of having the device if you cannot use it properly (completely) on rules. I would imagine that after sunrise/sunset, rain should be the most important meter on it....

photo
1

I have several problems with the Zipato weather station. Firstly, mine is updated very infrequently. For example, I'm looking at the weather station now and it says the last synch was at 15:42. It's now 17:55. That's useless. Secondly, a lot of information is unavailable or missing. The big reason why the Zipato weather station won't be a satisfactory solution any time soon is the lack of string variables - all weather sources supply information in the form of strings, and even if you can see those attributes in the virtual weather station, you can't access them. One of the first things I wanted was cloud cover, and that's not even filled in the Zipato weather station.


Yeah it was a fair bit of work, but copying it should be easier.


I'll have to put together a cleaned up copy of the script without my API keys and so forth. I may even try splitting it up.

photo
1

Thanks a lot!!

photo
1

Hi David, I have noticed that for example if I have the web ui long open, the weather station does not seem to update, but it does, just not reflecting in the widget. If I refresh the browser I see newer reading. Also I have a rule (that I dont need now) that does in interval send request for weather station update. the link in the message puzzle is an API call: https://my.zipato.com:443/zipato-web/v2/meteo/attributes/values?update=true

photo
1

Hi Attila. I thought about the refresh problem, so I reloaded the page yesterday before checking the last synch time - same outcome. Today, it's currently 10:01 and the last synch says 7:22, even after reloading the page, and even after executing the API call and reloading again! That's nearly three hours! (Is it possible that the synch time in the widget is being given in GMT? GMT is now 8:01, so that would mean "only" a 40-minute delay... )

photo
1

Ahhh yes, that's it! It's GMT. I've just run the API call again and it's updated to... 8:02! So I'm certain it's showing the time in GMT. I've just confirmed it by running my Google App Script, which connects to the Zipabox weather and extracts the observation date.

That's a bug. I'll open a ticket right now.

photo
1

hmm see :) Thanks for the ticket

photo
1

Done.

I'll definitely run that API call periodically to force updates.

Still, it doesn't solve the problem of not being able to get all the weather information.

photo
1

i tried as well from my NAS but could uold not make it work. So I moved the sounds to my dropbox account and linked it to a dropbox url - which works.

photo
1

Hmm I used to have preset MP3 files working with Sonos through zipabox stored on dropbox public. Since a few weeks they stopped working, first I htought it was a Zipato firmware issue, then Dropbox updated public files policies and I assumed it was a combination of both. Now I updated my rules with the new dropbox URL and I can see the URI changing on dropbox app to the correct one but I get this message everytime;


"Unable to play X.mp3, the song is not encoded properly" I have tried with ACC and MP4 files and they don't work either from dropbox or one drive, does anyone have this same issue?


I read in Sonos customer support site streaming from a few sites is giving this issue also and I think is because of the newer sonos firmware. You guys having issues with this?

photo
2

@Alberto

I've cleaned up my Google App Script by splitting into much more manageable smaller functions.

I'm taking screen shots of my weather meters and I need to gather the screenshots of my weather-related rules.

When I have all of this I'll create a new post and put the link here.

photo
1

Here's the link to my post, in case anyone stumbles onto this.

https://community.zipato.com/topic/as-promised-my-weather-information-gathering-system

photo
Leave a Comment
 
Attach a file