# The Sonos Bathroom project

**URL:** <https://community.homey.app/t/the-sonos-bathroom-project/10215>\
**Category:** Off-Topic\
**Created:** [March 7, 2019, 9:58am UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215 "2019-03-07T09:58:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jorden/32/8856_2.png) [@Jorden](https://community.homey.app/u/Jorden)\
**Post date:** [March 7, 2019, 9:58am UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/1 "2019-03-07T09:58:50Z")

</div>

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](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}](https://open.spotify.com/user/%7Busername%7D/playlist/%7BuniqueID%7D?si=%7Bsomecodehere%7D)  
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:

 ![PNG](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/a/ace71fb253a50d665a482aeeaf3c3d0d67197b87.jpeg)  
 ![IMG_5759](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/c/c94b1d2eb9595c44172d5bd448b3785174c54776.png)

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/](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](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.

![stickers](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/2/25157b2dcd36e43c2f0bb27ea9a29360acda4e5e.jpeg)

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:  
 ![3FCEE30D-DCB5-47C7-9B4F-D5462F8D68DC](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/7/716dc5f45405d25f10dbaa2d1e1f022d4463592b.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![victoroos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victoroos/32/8344_2.png) [@victoroos](https://community.homey.app/u/victoroos)\
**Post date:** [March 7, 2019, 11:16am UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/2 "2019-03-07T11:16:19Z")

</div>

What an awesome way! Shame of the playlist function. Same with the Spotify app. The api sometimes breaks. But still. Cool solution!  
Is the Kaku not 433 hz? :o  
And the pi? You use a wife module for it or how do you keep it connected to the web?

---

<div class="post-metadata">

**Author:** ![Jorden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jorden/32/8856_2.png) [@Jorden](https://community.homey.app/u/Jorden)\
**Post date:** [March 7, 2019, 11:34am UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/3 "2019-03-07T11:34:10Z")

</div>

Thanks!

The KAKU is 433Mhz I think.

I have a Pi without wifi module, placed it in my “hardware closet” where the router is also located, had a free port on it so I could just connect it with a network cable.

---

<div class="post-metadata">

**Author:** ![Ferry\_van\_E](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ferry_van_e/32/10953_2.png) [@Ferry\_van\_E](https://community.homey.app/u/Ferry_van_E)\
**Post date:** [March 7, 2019, 12:42pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/4 "2019-03-07T12:42:35Z")

</div>

I am using IFTTT as a workaround since the option for choosing URL schemes for personal playlists on Spotify in the Homey Sonos app doesn’t work (already informed Support).

No additional devices needed, unless you want to press buttons. In that case you could even create a widget for Siri Opdrachten which can start your ‘Play Sonos badkamer’- flow

Very nice setup though @Jorden !!! 👌🏽👌🏽

---

<div class="post-metadata">

**Author:** ![Jorden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jorden/32/8856_2.png) [@Jorden](https://community.homey.app/u/Jorden)\
**Post date:** [March 7, 2019, 1:09pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/5 "2019-03-07T13:09:17Z")

</div>

Never even thought of going through IFTTT, that would have been a good option as well (although in my experience IFTTT often adds a delay of 3-7 seconds).

Once those personal playlists in Homey work, I can phase out the Raspberry Pi (and use it for other things)

---

<div class="post-metadata">

**Author:** ![Victor\_dB](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/victor_db/32/11332_2.png) [@Victor\_dB](https://community.homey.app/u/Victor_dB)\
**Post date:** [March 9, 2019, 10:22am UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/6 "2019-03-09T10:22:09Z")

</div>

Very nice idea!  
As an alternative to Bronos you can also use Sonos http node which I’m using . This has an almost instant response and stable.

> **[jishi/node-sonos-http-api](https://github.com/jishi/node-sonos-http-api)**
>
> An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar. - jishi/node-sonos-http-api

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [March 14, 2019, 2:20pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/7 "2019-03-14T14:20:06Z")

</div>

Using this one as well. Another cool thing I’ve built is ‘follow me Sonos’. I’ve got motion sensors all around my place. Whenever there’s music playing in the living room and I enter the bathroom, it automatically groups the bathroom sonos to the living room sonos and automatically ungroups when I leave the bathroom. Works really well 🙂

---

<div class="post-metadata">

**Author:** ![Jorden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jorden/32/8856_2.png) [@Jorden](https://community.homey.app/u/Jorden)\
**Post date:** [March 14, 2019, 2:31pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/8 "2019-03-14T14:31:13Z")

</div>

That’s an awesome idea.

---

<div class="post-metadata">

**Author:** ![Martin\_van\_der\_Aart](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/martin_van_der_aart/32/9658_2.png) [@Martin\_van\_der\_Aart](https://community.homey.app/u/Martin_van_der_Aart)\
**Post date:** [March 14, 2019, 3:33pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/9 "2019-03-14T15:33:09Z")

</div>

I use the jishi/node-sonos-http-api also and it’s working great.  
I have it running on a Pi, but i wonder, could it also run on Homey itself? They say it is “hostable on any node.js capable decive” and isn’t Homey just that?  
Maybe someone can make an app for it, i just don’t have the skills for that.

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [March 15, 2019, 12:16pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/10 "2019-03-15T12:16:21Z")

</div>

Theoretically yeah, but it would require a lot of re-work to get it working on Homey. node-sonos-http-api hosts a web server and reacts based on web requests. I don’t think Homey allows you to host another webserver inside a Homey app, which means you’d have to rewrite the entire node-sonos-http-api library to make it compatible with Homey

---

<div class="post-metadata">

**Author:** ![Jorden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jorden/32/8856_2.png) [@Jorden](https://community.homey.app/u/Jorden)\
**Post date:** [March 15, 2019, 12:16pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/11 "2019-03-15T12:16:23Z")

</div>

I believe the Athom app for Sonos uses the node-sonos-http-api from Jishi… just probably an outdated version, wrong use of functionality or perhaps they made an error somewhere combining it with Spotify.

---

<div class="post-metadata">

**Author:** ![Jamie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jamie/32/5274_2.png) [@Jamie](https://community.homey.app/u/Jamie)\
**Post date:** [March 15, 2019, 12:35pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/12 "2019-03-15T12:35:41Z")

</div>

> [@Marvin\_Schenkel](#):
>
> I don’t think Homey allows you to host another webserver inside a Homey app,

You can host a web-server in an app if you want, just needs to use a different port.

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [March 15, 2019, 1:01pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/13 "2019-03-15T13:01:59Z")

</div>

@Jamie  
That’s news to me 🙂 . That would probably make it heaps easier to port this library to a Homey app.

---

<div class="post-metadata">

**Author:** ![Morten\_Skandshus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/morten_skandshus/32/5807_2.png) [@Morten\_Skandshus](https://community.homey.app/u/Morten_Skandshus)\
**Post date:** [March 20, 2019, 11:08pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/14 "2019-03-20T23:08:52Z")

</div>

How the “hell” did you manage to make that work stable… I’m having troubles just having homey fire off flows repeatedly… I can never get it to fire off that had…  
A simple flow as turning lights on and the off after 30 seconds will often fail as the lights in this case are 3 lamps… if I re enter the room after 30 seconds again the 3 lamps till randomly turn on…

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [March 21, 2019, 12:11pm UTC](https://community.homey.app/t/the-sonos-bathroom-project/10215/15 "2019-03-21T12:11:16Z")

</div>

@Morten_Skandshus  
If you describe your setup and show me the flows you have built, I will help you get it to work !
