# Toggle/next Sonos playlist from a button

**URL:** <https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498>\
**Category:** Questions & Help\
**Created:** [August 6, 2019, 8:09am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498 "2019-08-06T08:09:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonas\_Almquist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonas_almquist/32/12975_2.png) [@Jonas\_Almquist](https://community.homey.app/u/Jonas_Almquist)\
**Post date:** [August 6, 2019, 8:09am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/1 "2019-08-06T08:09:20Z")

</div>

Hi,

I would like to crete a Flow in some how to change to “next” radiostation/favorit when i press a button.  
Now when i press a button i start a Favorit radiostation in Sonos.

I Would like to be able to press the same button again to go to next radiostation. and when it press again it skips to next radio channel.

Have anyone tried this or have a idea how to do it?

Best Regards Jonas

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [August 6, 2019, 8:33am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/2 "2019-08-06T08:33:27Z")

</div>

Use a variable.  
When Button Is pressed  
And variable \< X  
Then Variable+1

When Button is pressed  
And varaible = x  
Then variable = 1

Then some flows  
When variable is changed  
And variable = 1  
Then favorite 1  
And so on

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [August 6, 2019, 9:22am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/3 "2019-08-06T09:22:38Z")

</div>

I made 7 flows, for seven days. Every day another station. That way i don’t change often to another station. When i come out of bed on monday station x, on thuesday station y etc. Also a remotec 8 button switch. When i push button 3 on monday station x, on thuesday station y, etc. Also when I come home on monday, station x, on thuesday station y etc.

For all these actions I only use 7 flows for the different stations and i start those with the THEN part, start a flow. That way I can easaly change the stations.

---

<div class="post-metadata">

**Author:** ![Jonas\_Almquist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jonas_almquist/32/12975_2.png) [@Jonas\_Almquist](https://community.homey.app/u/Jonas_Almquist)\
**Post date:** [August 6, 2019, 10:11am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/4 "2019-08-06T10:11:19Z")

</div>

That looks awsome and is what i am looking for!  
How do you create varaible \< X and then +1

Can you explane a bit more or take some screenshots?

Thanks! best Regards Jonas

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [August 6, 2019, 10:17am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/5 "2019-08-06T10:17:51Z")

</div>

I use the better logic app.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/5/5643a5543f56ae7bb85b595d89836d6eee1807ce.jpeg)

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [August 11, 2019, 10:01am UTC](https://community.homey.app/t/toggle-next-sonos-playlist-from-a-button/16498/6 "2019-08-11T10:01:43Z")

</div>

This is the way I do it, also have a remotec 8 button switch. Pushing button 4 starts a radiostation depending on the day of the week

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/8/8b350929bf26bb0d8527e4b6f1b34c2ff96283c1.jpeg) ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/2X/1/14673551e92a35844a0a004ca92e6f17ef254837.jpeg) .
