Skip to main content

iRidi for Sonos

A toolkit for creating control interfaces using the Sonos speaker system driver.

Documentation updated 01.01.2024

iRidi for Sonos is a driver for creating a Hi-Fi system control interface without scripts. A native driver is more familiar to integrators and makes settings easier to change.

The Sonos driver lets you:

  • Work with devices in a group or individually,
  • Create playlists and play radio,
  • Control the player,
  • Display all available artist, soundtrack, or radio station information in any convenient format.
Tip

Example: Sonos

Connection​

To work with Sonos equipment in a project, you need to find the speaker system's IP address and enter it in the driver settings. Follow these steps:

  1. Connect the Sonos equipment. Its IP address is assigned automatically using DHCP.
  2. Download and run Sonos Controller for Sonos. It automatically scans the network, and the equipment appears under "Rooms".

Sonos_app.PNG

  1. There are several ways to find the Sonos equipment's network settings:

3.1. On a PC.

Driver_sonos_pc.png

3.2. In the mobile application.

Driver_sonos_app.png

3.3. By scanning the local network with dedicated software, such as Advanced Port Scanner.

The scan produces a device list. Select the required device. Sonos systems are identified as Sonos,inc. in the "Manufacturer" column.

Sonos_scan.png

Once you have identified the IP address, you can configure the equipment in iRidi Studio.

Important

The router must not block UDP or multicast traffic for a connection to Sonos equipment.

Connecting streaming services​

To play media from music streaming services:

  1. Open the official Sonos application;
  2. Add a music streaming service to the device using Manage > Service Settings > Add (sign-in to the music service is required). Added services appear in the Sonos account's service list, and all of the service's media becomes available in the official Sonos application;
  3. Select the required media and right-click it;
  4. In the context menu, select Add to Sonos Playlist or select Add to Sonos Favorites;
  5. Open i3 pro. The added media now appears in the project.

Working in iRidi​

  1. Create a project and select "Add driver". Select "Sonos" in the list that appears and add it.
Note

By default, the Sonos driver works with one device. To synchronize all Sonos devices, combine them into a group using the additional Sonos group.

For more information about working with native drivers, see here.

  1. Fill in the fields in the driver properties required for operation.

Driver properties​

Image_2020_05_20T09_14_55_546Z.png

  • Name is the driver name; do not change it in a finished interface;
  • Driver Type provides information about the driver type;
  • Protocol is the TCP data transmission protocol;
  • Log Level is the logging level;
  • Host is the equipment IP address;
  • Port is the connection port (1443 by default).

Configuring commands and feedbacks​

SendRecieve.png

To control equipment, configure Commands and Feedbacks. To send a command, drag it onto a graphical item and specify the Value to send. To display feedback, drag the Feedback onto a graphical item and specify how to display its Value.

For more information about graphical items, see Graphical item types.

Commands​

Driver_sonos_commands.png

  • Name - command name;
  • Type - command type:
    • Control - commands for equipment control;
    • Selection - navigation commands:
Control​
ParameterValueDescription
Play/PausePlay or pause a track—
VolumeAdjust the volume0-100
MuteMute the sound1 - mute the sound
0 - unmute the sound
Relative volumeAdjust the volume relative to the current "Volume" feedback value0-100
NextPlay the next trackValue
Previous songPlay the previous trackValue
SeekSeek within a trackValue
used on a Level item with Duration feedback
Seek relativeSeek relative to the current timeline positionValue
A negative value in ms (e.g., -5000) seeks backward
A positive value in ms (e.g., 25000) seeks forward
Group volumeCommand for adjusting volume within a group (for multiple devices)0-100
Group relative volumeAdjust group volume relative to the current "Volume" feedback value0-100
Group muteMutes the group1 - unmute the group
0 - mute the group
Update stateRefresh feedback statesValue
RepeatRepeat the playlist1 - enable playlist repeat
0 - disable playlist repeat
Repeat oneRepeat the current track1 - enable current track repeat
0 - disable current track repeat
CrossfadeFade out the end of a track and gradually increase the volume at the start of the next oneTrue/False
ShufflePlays a random song1 - enable Shuffle
0 - disable Shuffle
Reset errorCommand to reset the "Error status" feedback valueValue
Selection​
ParameterValueDescription
ExplorerNavigation command (implemented using Advanced List)Value
Explorer backCommand to return to the previous folder/page (Advanced List)Value
Explorer rootCommand to return to the root pageValue
QueueCommand to select a track from the queueValue
Clear queueCommand to remove the track list from the queueValue

Feedbacks​

Driver_sonos_feedbacks.png

  • Name - feedback name;
  • Type - feedback type
    • Control - equipment control feedback;
    • List - playlist feedback.

For convenience, driver feedback channels are divided into categories by purpose.

Control​

Control - control feedback.

ParameterValueDescription
PlayCurrent playback state (play/pause)1 - Play state
0 - Pause state
Player namePlayer nameValue
VolumeCurrent volume0-100
MuteMute parameter state1 - Mute is active
0 - Mute is inactive
Group nameGroup nameValue
Group VolumeCurrent group volume0-100
Group muteGroup mute parameter state1 - active
0 - inactive
ErrorErrorValue
PlaybackstateCurrent player statePlay, Pause, Idle
Position millisCurrent timeline position (ms)Value
Is coordinatorIndicates the main device in the group1 - master device
0 - slave device
Error statusDisplays the current error status1 - error detected
0 - no error detected
The status is retained until the Reset error command

Stream, Radio - stream feedback.

ParameterValueDescription
Container imageDisplay an imageValue
Container nameRadio station nameValue
Current show nameShow nameValue
Container typeContent type (usually Track)Value
Container serviceService nameValue
Current stream infoArtist + track nameValue

Indicators - command availability indicators.

ParameterValueDescription
Can skipPlay the next track1 - available
0 - unavailable
Can skip backPlay the previous track1 - available
0 - unavailable
Can seekSeek within a track1 - available
0 - unavailable
Can pausePause1 - available
0 - unavailable
Can stopStop playback1 - available
0 - unavailable
Can repeatPlaylist repeat1 - available
0 - unavailable
Can repeat oneTrack repeat1 - available
0 - unavailable
Can crossfadeFade effect1 - available
0 - unavailable
Can shuffleShuffle1 - available
0 - unavailable

Modes - playback modes.

ParameterValueDescription
Mode repeatPlaylist repeat1 - active
0 - inactive
Mode repeat oneTrack repeat1 - active
0 - inactive
Mode crossfadeFade mode1 - active
0 - inactive
Mode shuffleShuffle mode1 - active
0 - inactive

Current track info - current track information.

ParameterValueDescription
ServicePlayback serviceValue
AlbumAlbum nameValue
TypeContent typeValue
ImageTrack artworkValue
ArtistArtistValue
NameTrack nameValue
Duration (ms)Duration (ms)Value
TimeDurationFormat 00:00:00
Time passedElapsed timeFormat 00:00:00
Time remainingRemaining timeFormat 00:00:00
Name/Artist/StreamCombined valueValue
Album/ShowAlbum or showValue

Next track info - next track information.

ParameterValueDescription
Next track ServiceServiceValue
Next track AlbumAlbumValue
Next track TypeContent typeValue
Next track ImageArtworkValue
Next track ArtistArtistValue
Next track NameTrack nameValue
Next track Duration (ms)Duration (ms)Value
Next track TimeDurationFormat 00:00:00
List​
ParameterValueDescription
ExplorerFolders/playlists/services/radio stations/tracksValue
QueuePlayback queueValue

Position millis. Displaying track duration on a Level item.​

Dynamic track duration changes apply to a Level item.

To display artwork, bind the driver's Position millis feedback to the Max token of the Level item. Follow these steps:

  1. Drag the Position millis feedback onto the required item.

  2. Select "More...", then the parameter Max .

Sonos_duration.png

Image (Current). Displaying track artwork on an item.​

To display the artwork of the current track, bind the driver's Image (Current) feedback to the Image token of the item (use the same method for radio station artwork). Follow these steps:

  1. Drag the Image (Current) feedback onto the required item.

  2. Select "More...", then State 1 , Image .

Sonos_image.png

Note

Some radio station/service images are not displayed due to an error in the Sonos protocol.

Is Coordinator. Devices working in a group.​

The device role is indicated by the Is Coordinator feedback. A value of 0 means the device is in Slave mode; 1 means it is in Master mode.

Devices working in a group have two roles:

  • Master - the main device that duplicates commands for the other devices in the group;
  • Slave - a subordinate device that receives settings from the Master.

A value of 0 means the device is in Slave mode; 1 means it is in Master mode.

Update State. Refreshing feedback values​

The Update State command clears feedback values and polls the Sonos device again to display current information. The driver and Sonos devices can occasionally become unsynchronized; use this command to restore synchronization.

Refreshes these feedback values: Service, Album, Type, Image, Artist, Name, Duration, Time passed, Time remaining, Duration (ms), Time.

Configuring Explorer​

The "Explorer" popup displays folders/playlists/tracks. It also provides navigation and selection of playlists created using the native Sonos application.

  1. To create the Explorer popup, draw an Advanced List item.

  2. Create 3 "Templates" popups. Name them TplFavorite (to display the "Playlists" and "Favorites" folders), TplRoot (to display the contents of the "Playlists" folder), and TplPlayList (to display the contents of the "Favorite" folder). Create Label items on each popup as templates for displaying folders, playlist information, artwork, and track names.

Sonos_Explorer1.png Sonos_Explorer2.png

Example of Label items drawn for the TplFavorite popup.

Sonos_Explorer3.png

  1. After creating the items, return to the Advanced List item.

  2. Open the template settings by clicking "Template setting".

Sonos_Explorer4.png

  1. Add the template popups. In the Code field, enter type, as shown in the figure.

Sonos_Explorer5.png

  1. Double-click a template to configure it, then add labels. For the "TplFavorite" template, enter favorite in the Type field, then add the following labels with the required tokens: lbl.Name.Text; lbl.Type.Text; lbl.NextImage 1.State 1.Image.

After adding the labels, specify a Value for each. To enter a value in a Value row, click the row 3 times. Label Values:

  • lbl.Name.Text - name
  • lbl.Type.Text - description
  • lbl.NextImage - imageUrl

Sonos_Explorer6.png

  1. Configure the labels for the remaining "TplRoot" and "TplPlayList" templates in the same way.

For TplRoot, enter Directory in Type. Create the lbl.Name.Text label and enter name in Value.

Sonos_Explorer7.png

TplPlayList, enter playlist in Type. Create the labels:

  • lbl.Name.Text: enter name in Value.
  • lblTrackCount: enter trackCount in Value.

Sonos_Explorer8.png

  1. After configuring the labels and templates, bind the "Explorer" command and feedback to the Advanced List item.

To bind the command, select the Advanced List item, then click + next to the Press event in the Programming window.

Sonos_Explorer9.png

In the window that opens, select Send tag and bind SelectItem -> Commands -> Explorer.

Sonos_Explorer10.png

To bind the feedback, select the Advanced List item, then open Data source (next to Template setting). Select Driver -> Feedbacks -> Explorer. This completes the Explorer popup setup!

Sonos8.png

Configuring Queue​

The "Queue" popup displays information about tracks in the current playback queue and lets you select a track from that queue.

  1. Create an Advanced List item. Create the TplQueue template to display information about tracks in the playback queue. It has the following labels:
  • lblName
  • lblType
  • lblNextImage1
  1. Configure the template and labels.

Tpl.Queue , enter playlisttrack in the Type field. Create these labels:

  • lbl.Name - enter name in the Value field;
  • lblType - enter description in the Value field;
  • lblNextImage 1 - enter imageUrl in the Value field.

Sonos_Queue2.png

  1. Drag the Queue command and feedback onto Advanced List.

Command binding:

Sonos_Queue.png

Feedback binding:

Sonos_Queue1.png

Sonos group​

The "Sonos groups" driver controls Sonos devices in a group.

Note
  • This driver supplements the Sonos speaker system driver and is not intended for standalone use in a project.

Driver properties​

Sonos_group1.png

  • Name - the driver name; do not change it in a completed interface;
  • Driver Type provides information about the driver type;
  • Protocol is the TCP data transmission protocol;
  • Log Level - logging detail level.

Configuring commands and feedbacks​

SendRecieve.png

To control equipment, configure Commands and Feedbacks. To send a command, drag it onto a graphical item and specify the Value to send. To display feedback, drag the Feedback onto a graphical item and specify how to display its Value.

For more information about graphical items, see Graphical item types.

Commands​

Sonos_group2.png

  • Name is the command name;
  • Type is the command type:
    • Group - command to group devices;
    • Ungroup - command to ungroup devices;
    • Select - command to select devices for grouping.

Feedbacks​

Sonos_group3.png

  • Name - the status feedback name;
  • Type - feedback type:
    • Players - a list of the current device states (grouped or ungrouped).

Configuring Popup groups​

The "Popup groups" popup lets you select devices from a list and group / ungroup them.

  1. Create a popup (Popup groups) and add Advanced List to it.

  2. Create 2 "Templates" popups. Name them TplPlayer (an item representing one device) and TplGroup (an item representing a group of devices). Create Label items on each popup as templates for group information (name, device count, and coordinator).

Sonos_group4.png

Example Label items drawn for the TplGroup popup: Sonos_group5.png

Example Label items drawn for the TplPlayer popup: Sonos_group6.png

  1. After creating the items, return to the Advanced List item.

  2. Open the template settings by clicking "Template setting".

Sonos_group7.png

  1. Add the template popups. In the Code field, enter type, as shown in the figure.

Sonos_group8.png

  1. Double-click a template to configure it, then add labels. For the "TplGroup" template, enter group in the Type field (for TplPlayer, Type = player ), then add the following labels with the required tokens: lbl.Name.Text, Selection.Value, lbl.Name 1.Value.

After adding the labels, set their Value fields. To edit a Value field, double-click the label row. Label values:

  • lbl.Name.Text - name,
  • Selection.Value - selected,
  • lbl.Name 1.Value - coordinator.

Sonos_group9.png Sonos_group10.png

  1. After configuring the labels and templates, bind the "Select" command to the Advanced List item.

To bind the command, select the Advanced List item, then click + next to the Release event in the Programming window.

Sonos_group11.png

In the window that opens, select Send tag and bind SelectItem -> Commands -> Select.

Sonos_group12.png

  1. Bind the Players feedback to the item. Select the Advanced List item, then open Data source (next to Template setting). Select Driver -> Feedbacks -> Players.

Sonos_group13.png

  1. Add 2 buttons to the popup for grouping and ungrouping devices. Drag the respective commands onto them: Group and Ungroup , sending any value to the channel.

Sonos_group14.png