I’ve searched the forums and haven’t found a solution for this. I’m trying to send Sonos setTrack() and playTrack() commands in a smart app, but I’m having no luck.
The documentation says that playTrack takes a string, which I assume is the name of the track. So for example I have 3 songs in my track list, one of which is named “Kalimba.mp3”
So I tried the following (both for setTrack and playTrack):
@bharms can you try one small thing… Can you play that thing thru Sonos directly and then try in ST? I have heard some tracks not being recognized by ST unless played fully once thru Sonos but I may totally be wrong…
That’s interesting. You mean just using my sonos controller app and listening to the song? If so, I have definitely listened to the song multiple times all the way through. If I look at my live logging I’ll see notifications like:
info: Sonos is playing such and such by so and so
so it’s definitely capable of accessing the track information. It just doesn’t respond to any of the setTrack or playTrack commands I’m giving it. My first guess was just that I wasn’t formatting the string correctly. Now I’m not sure.
I did the same and it worked. I’m not sure why the other file I tried calling didn’t work before. Oh well, working fine now!
I’ve just got to host all the tracks I need to play online. So while it’s not incredibly pressing, my new question is: is there a way to use playTrack() to play local files?