Sonos - Dashboard Tiles


#1

Summary

This piston creates dashboard tiles that can display the status of your Sonos speakers and also pause or play the speakers.

tiles

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


[Deprecated] Sonos Speakers - Dashboard Tiles
#2

Amazing work!!


#3

I imported this updated piston today, but I am receiving this error in the piston log:

An error occurred while executing the event: java.lang.NullPointerException: Cannot get property ‘v’ on null object


#4

I’d have to see the green snapshot with trace on and a full piston log, but it sounds like you’ve got an undefined or rogue device in one of the device definitions.