Not a big fan of IFTTT but for Things that do not fully integrate with SmartThings(ST), there is not a lot of choice. Case in point my SONOS speaker. I was looking for a way to play and control multiple stations I have saved in SONOS and so far I have not found a way to play a SONOS STATION/FAVORITE directly from a piston…a track yes but Station/Favorite no.
I created a Virtual switch in ST for each of my stations, created an IFTTT trigger to play each Station when the Switch was turned on and then added them all to my ActionTiles dashboard…all good.
But then I realized that when I “Changed” the station by tapping another tile, the new Station started to play but the old Tile stayed “ON”. And I did not want to have to write IFTTT triggers to turn off the stations and then be forced to turn one OFF before turning another ON
So I originally wrote a pile of IF statements to turn off all the other Switches (Stations) when a new one was turned on. It worked fine but was a maintenance nightmare as I had to change every IF statement every time someone asked me to add another of their favorites. So after a few hours of digging (I am not a coder and am new to ST/webCoRe/AT…2 weeks) and finding some inspiration from a Design Help Thread called [Remove Devices from a List Device] I was able to come up with this Piston that now works reliably. You simply need to make sure the StationList variable contains your entire list of Virtual Switches that point to your Stations and create the new IFTTT trigger if you add a station and that is the only maintenance you will need to do.
And here is what the ActionTiles dashboard looks like
To Pause everything simply tap the Station that is playing and the SONOS will pause since all the Switches/Stations are off.
I hope this is of some value.