Sonos - Search Music Using a Dashboard Tile

I was able to finally create a dashboard tile to allow searching with my Sonos setup. I am using the node-sonos-http-api running on a Mac mini.

I am also using the variable-connector that Bruce demonstrated in the August 22 Hubitat Live Episode. He starts explaining it around 6:35 into the episode.

19%20PM

The actions for the rule are fairly simple.

  1. The first is to take any spaces and replace them with a "+". This was part of the API requirements.
  2. The second is to pause the current music
  3. This will clear the queue. Depending on your config, you could have 50 or more songs in the current queue.
  4. This sends the request***

*** One gotcha I ran into was not being able to use a multi named room in #4. I wasn't able to find a way to cover the space in the URL. I tried things like /Family Room/ and /Family%20Room/ and both failed. Hopefully someone can come up with the magic answer for that.

There are other services by apple that can be used and that is up to your configuration.

Hope this helps someone.

3 Likes

First off - thank you very much! Owe you a drink.

Second, I don't have Apple Music; however, this URL works perfectly for me to start playing music by Axelle Red ....

~~http://192.168.1.4:5005/Master%20Bedroom/musicsearch/library/song/axelle+red~~

No explanation why the %20 worked for me .....

Scratch that. Cannot get it to work again.

Could you use HTTP Momentary Switch for your #4 command? Set up the command in the switch and then turn on the switch?

Hello, can you be a little more specific with which actions youā€™re running there?

Iā€™ve been working on this for a long time, I want there to be a search tile on my dashboards so I can search Any song using apple music and be able to play it from the dashboard kiosk to my Sonos system.

Iā€™ve set up the http api and the server is working.

Im having issues with the get command. How do you populate the get command with the variable string, after replacing the (space) with (+)
Literally, if you could dumb it down as far as what to click that would be wonderful haha (been working on it for so long!) . But any help is much appreciated. :slight_smile:

To be even more specific, I am having trouble situating the actions and conditional if/then expressionsā€¦ Iā€™m not sure how to take the changed musicsearch value, add the ā€œ+ā€ and then use the new value to input into the GET url.

Thank you!