25.02.2017, 12:01 (This post was last modified: 25.02.2017, 14:41 by Erwin van der Zwart.)
Hi,
Yes i know, this is almost the same approach as the app uses, should have thought about it sooner..
When virtual objects are implemented you can use one of the both methodes.
You probably need a extra condition on media type (track or radio) as the album is not part of the radio stream data. So if media type is radio you probably want to hide or flip the text labels where data is written to.
I understand I need a javascript code for every Sonos device, Can I use the same label for a additional classes if I have different pages for a Sonos device or is better than I define for example .album_S1, .album_S2, etc
It's possible to add "%" symbol at the end of volume value?
Hi Erwin,
I am currently testing the sonos-app and noticed a problem with the favorites-part.
I am using an applemusic-playlist as a favorite - when selecting/loading it (gui or through http-commands) nothing happens - starts playing whatever is in queue. I thought it had something to do with the apple-play-list but when using a sonos-playlist as a favorite the same thing happened. Using a radio station as a favorite works fine and loading the same sonos-playlist from the playlists works fine also.
My plan is to use a KNX-trigger to switch between multiple favorites (radio-stations and apple-music-playlist). I want to use apple-music playlists since it is very easy to use itunes for updating and syncing across all apple-devices and sonos. Hope you can figure this one out.
Some other question i have: i want to use my sonos as doorbell and text-to-speech device: so when playing radio/playlist i would like to interrupt the music, either play an mp3 (doorbell) or a generated mp3 (tts using voiceRSS - this is free for 350 messages a day), and continue the music at the point where it was before.
With the radio station this is no issue but with the playlist it is a different story: i would need to store the tracknumber and time-position in the song and restore that after playing the doorbell/generated-mp3. Any ideas on how to do this? (might be usefull for other people also).
Thanks again for all the help,
Bart
25.02.2017, 20:08 (This post was last modified: 25.02.2017, 21:36 by Erwin van der Zwart.)
Hi Bart,
I will check your point for favorites, but you can solve it for now by using a playlist. Playlist can be loaded and optional auto started by this command:
Code:
12345
http://127.0.0.1/apps/data/sonos/sonos.lp?action=loadplaylist&ip=192.168.10.31&listname=My_Playlist&autoplay=true-- use _ for spaces in the name-- orhttp://127.0.0.1/apps/data/sonos/sonos.lp?action=loadplaylist&name=Woon_Kamer&listname=My_Playlist&autoplay=true-- use _ for spaces in the name
For doorbell i will check also how to do this and come back to this asap..
With this command it's possible to trigger a audiofile on any player you like (make sure to send it to the master if you have groups), you can set free audio URL, set the volume during interuption and set the total duration of the interuption (depending on your audiofile lenght) and after play the file / interuption it will return to the old state (continue where it was and with old volume)
You can also trigger all players (coordinators and single players) so all groups and players are started at once by using this:
27.02.2017, 16:52 (This post was last modified: 27.02.2017, 17:37 by Erwin van der Zwart.)
Hi Josep,
Yes almost anything is possible, you just have to know how to do it (;
This one is quite tricky as the duration and playing time are strings like 0:00:00 from sonos so you have to split them, multiply them and calculate the percentage between start and end and the current position.
With this 0-100% (var passed) you can scale a element to your bar.
Thank you very much, This function FormattedTimeSeconds is very interesting for use in other places too, I only have an another question, I don't understand very well how CSS works, it is possible to define a bar with this format without modify the rest of the bars format or when I change the CSS in bar element this change in everything?
Erwin, you have to use another class name, because "progress" is used by sliders and this will break any slider in the same plan. You can use several classes if needed, but the one you are targeting via JS must not clash with base class names.
I put this code into Java Script section, I make a 3byte object read only and only value display and with playprogress in additiona class but it's not working, it's correct to put this code in Javascript section?
28.02.2017, 09:07 (This post was last modified: 28.02.2017, 09:20 by josep.)
Hi Erwin,
This code that I put into custom Javascript section I need to recall ciclally? How can I make this? Thank you.
Sorry Erwin,
I put the code into Sonos javascript previous sentence and now I works fine, It's possible to change the bar dessigns, making the ends not rounded or change the size and height?