Summary
This piston creates dashboard tiles that can display the status of your Sonos speakers and also pause or play the speakers.
Changes
This piston represents a substantial rewrite of a piston originally posted here, which has been deprecated due to recent changes to the Sonos integration with SmartThings. This piston will only work if you are using the LAN Sonos Player WebSocket device handler for all your Sonos speakers. (ST has previously indicated all users will be moved to the new DTH after October 17, 2019)
Features
- The tiles can be displayed in any order that you prefer, displaying aliases or âshort namesâ that you designate.
- The tile colors indicate which speakers are grouped together and, when grouped, display a colored badge to indicate which speaker is primary and which are auxiliaries. The colors are easily configurable by modifying the variables at the top of the piston.
- The tiles are clickable to pause or resume play, although there has to be a station or queue assigned to the group to resume.
Notes
The tiles will not appear on the dashboard until there has been a change in volume, group assignment, or playback status to any one of the speakers. Also, be sure whatever category you have assigned the piston to is set to display tiles.
Because rapid changes to speaker volumes, group assignments and/or playback status can result in numerous triggers firing almost (but not quite) simultaneously, the piston has a built-in pause designed to wait for the last trigger. Generally speaking, a longer wait will result in more accurate tiles, while shorter waits will update the tiles more quickly. The ârightâ amount of delay will depend on personal preference and the number of speakers monitored by the piston.
Occasionally, the tiles may not display the most current information. If it happens too frequently, try increasing the delay {updateWait}. Another option is to have the tiles auto-refresh on a schedule using a timer and âexecute pistonâ command at the bottom of this piston. I use a global variable (@refreshTiles, shown in the example) as a trigger, whichI use to update all my tiles pistons one command with a single click.
Edit: Added the following caveat âŚ
Device Variables
There are certain known limitations within webCoRE with regard to the use of device variables and device handlers that utilize custom commands. For the purposes of this piston, do not use a device variable (i.e., âallSpeakersâ) to define the speakers the piston will manage. Instead, add the speakers individually where needed using webCoREâs dropdown menus and actual physical devices.
Edit: 10/25/19 - Removed Temporary Debug Code