Skip to main content

Sonos

Sonos comprises a set of HiFi audio systems integrated with HSYCO via WiFi or Ethernet connection. A single SONOS I/O Server controls all the devices connected to the local network.

Communication

Just make sure the Sonos devices are connected to the same local network as HSYCO server is.

HSYCO Configuration

Add a SONOS I/O Server in the I/O Servers section of the Settings and set its parameters:

High Availability

  • Shutdown when inactive: defaults to false.

Options

IDDefaultValuesDescription
startupeventsfalsetruegenerate IO events also during the driver’s start-up phase
falsestart generating events only after HSYCO is aligned with the current status of the system
localhost<host_name>host name (or IP address) to be used by the players to reach HSYCO and send status notifications. If not specified the driver will select a random local address among the available ones. It is therefore recommended to specify one

Datapoints

In the following table, replace <player> with the name assigned to a player. Names are transformed to lowercase and spaces are replaced by '-'. For instance, if the name assigned to a player is "Example Name", the <player> part of the corresponding datapoints will be "example-name".

IDValueR/WDescription
connectiononlineRconnection established
offlineRHSYCO can't connect to the device
<player>.stateplayRthe audio is playing
Wstart playing
pauseRthe audio is paused
Wpause the audio
stopRthe audio is stopped
Wstop the audio stream
transitioningRthe device is transitioning between audio streams
unknownRthe current state is unknown
<player>.track.number<n>Rthe current track is the number <n> in the current queue (can be "unknown")
<player>.track.title<title>Rtitle of the current track (can be "unknown")
<player>.track.creator<name>Rname of the author of the current track (can be "unknown")
<player>.track.album<name>Rname of the album of the current track (can be "unknown")
<player>.track.albumarturi<uri>Ruri of the album art of the current track (can be "unknown")
<player>.mute1Rthe audio is muted
Wmute the audio
0Rthe audio is not muted
Wunmute the audio
<player>.volume0 ... 100Rthe volume is set to the reported value
Wset the volume to the specified value
+<n>Wincrease the volume of the specified value
-<n>Wdecrease the volume of the specified value
<player>.play<uri>Wplay the audio file located at the specified URI. After the track ends, the previous state of the player is restored.
<player>.queuenextWgo to the next queued track
prevWgo to the previous queued track
<n>Wgo to the <n>-th queued track
<n>:<uri>Wadd to the current queue, in <n>-th position, the audio file located at the specified URI (set <n> to 0 to add it at the end of the queue)
<player>.reachable1Rthe player is normally connected
0Rthe driver cannot communicate with the player

Public Announcement

This driver supports the function of Audio_and_Public_Announcement. The audio will be played as if the URL of the audio file would be passed to the corresponding <player>.play datapoint.

The general action syntax is:

audio io@<io_server_id>.<player> = <audio>

For instance:

TIME : audio io@sonos.kitchen = file "audio/music.mp3"
TIME : audio io@sonos.kitchen = voice:Alex "Hello world"

User Interface

UISET Actions

IDAttribute
connectionvisibletruewhen datapoint connection = offline
falsewhen datapoint connection = online
<player>.state.playvisibletruewhen datapoint <player>.state = play
falseotherwise
<player>.state.pausevisibletruewhen datapoint <player>.state = pause
falseotherwise
<player>.state.transitioningvisibletruewhen datapoint <player>.state = transitioning
falseotherwise
<player>.state.stopvisibletruewhen datapoint <player>.state = stopped
falseotherwise
<player>.track.numbervaluethe current track number
<player>.track.titlevaluethe current track's title
<player>.track.creatorvaluethe current track's author
<player>.track.albumvaluethe name of the current track's album
<player>.mute.1visibletruewhen datapoint <player>.mute = 1
falsewhen datapoint <player>.mute = 0
<player>.mute.0visibletruewhen datapoint <player>.mute = 0
falsewhen datapoint mute = 1
<player>.volumevaluethe current volume's value (0 ... 100)

USER Commands

NameParamAction
<player>.stateplaystart playing
pausepause the audio
stopstop the audio stream
<player>.play<uri>play the audio file located at the specified URI
<player>.volume0 ... 100set the volume to the specified value
+<n>increase the volume of the specified value
-<n>decrease the volume of the specified value
<player>.mute1mute the audio
0unmute the audio
<player>.queuenextgo to the next queued track
previousgo to the previous queued track
<n>go to the <n>-th queued track
<n>:<uri>add to the current queue, in <n>-th position, the audio file located at the specified URI (set <n> to 0 to add it at the end of the queue)

Release Notes

3.7.0

  • added support for SONOS firmware version 9
  • added datapoint <player>.queue = <n>
  • player state is now restored after a track is played via <player>.play = <uri> or via public announcement

3.5.1

  • fixed bug preventing the driver to initialize correctly when a sonos bridge was in the network

3.5.0

  • initial release

Sonos is a registered trademark of Sonos, Inc.