I have had a Sonos Play:1 in my bathroom for years. I noticed though, that I found it was a lot of work to get my music started on it. I need to take my phone, open Spotify, go to the library, select my “Favorites” playlist, press Shuffle, open up the “Currently playing”, press the “Devices” button, select my Bathroom Sonos, wait for it to connect and then I can put away my phone. Ofcourse, it can also be done from the Sonos app, but I rarely use that.
Too much work and that resulted in me only using it once or twice a week. My girlfriend only used it once or twice a month.
However, I am always thinking of new ways to use Homey to make stuff easier. And this is one perfect example.
I had a KAKU AWST-8802 available, which has 4 buttons (left button ON, left button OFF, right button ON, right button OFF) and costs only around 15 euros (https://www.praxis.nl/gereedschap-installatiemateriaal/elektra/domotica/klikaanklikuit-draadloze-dubbele-wandschakelaar-awst-8802/5205723)
4 buttons is enough for starting my playlist, starting my girlfriends playlists, having a “Next” and a “Stop” function. Which is all I need (okay, perhaps volume + and volume - would be even better).
So I hooked up the KAKU to Homey in about 5 seconds. Left button Off, I wanted to start my Spotify favorites playlist on the Sonos with shuffle on. I had my Spotify and Sonos apps installed, devices and account linked.
I was, however, unable to find my playlist. I found that if you “share” your Spotify playlist from the app on your phone or PC, you can find the ID:
For example:
https://open.spotify.com/user/{username}/playlist/{uniqueID}?si={somecodehere}
You need the uniqueID. If you search for that in Homey, you can find the playlist.
However, this worked once, next I got an error:
I decided to abandon the “spotify playlist” starting from Homey for now, and used an old Raspberry Pi with “Bronos” on it. Find it here: http://www.bronos.net/
I flashed that to the Raspberry Pi and in just a few minutes I had a “cloud” web API available, which I can control with http from Homey.
I found that if I open the URL that is available through Bronos, I can just add the name of my speaker to the URL and then use the node-sonos-http-api functionality (more info at https://github.com/jishi/node-sonos-http-api).
So to find out which playlists are available: {bronos URL}/Badkamer/favorites
and to play: {bronos URL}/Badkamer/favorite/{name of playlist}
I added that to a http GET card in Homey.
Next thing, I looked up a picture of me and one of my girlfriend, simplified it and made it black & white, then had my dad print it on a transparant sticker together with a “next” and a “stop” icon.
I had my girlfriend add her playlist to the Sonos favorites as well, and repeated the playlist http GET routine for her playlist.
I used the Homey stop & next track functions, these seem to function fine, for the “left button ON” and “right button ON” buttons on the KAKU device.
I placed the stickers:
I showed my girlfriend and she loved it. It works flawlessly. I already noticed that she uses it way more, and so do I. It’s a lot less hassle than doing the same through the Sonos or Spotify app. Power of Homey
Now if the Homey Spotify/Sonos playlist function starts working well, I can get rid of the Raspberry Pi and it’ll be even easier & cleaner.