Difference between revisions of "Sonos"

From HSYCO
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sonos is an HiFi audio system integrated with HSYCO via WiFi or Ethernet connection.
+
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.
  
 
[[Category:I/O Server]]
 
[[Category:I/O Server]]
  
 
== Communication ==
 
== Communication ==
Just make sure the Sonos device is connected to the same local network as HSYCO server is.
+
Just make sure the Sonos devices are connected to the same local network as HSYCO server is.
  
 
== HSYCO Configuration ==
 
== HSYCO Configuration ==
Line 32: Line 32:
 
|-
 
|-
  
|room
+
|localhost
 
|
 
|
|<room_name>
+
|<host_name>
|If specified, the driver will connect to the device with the corresponding room name. If not specified this driver will look for and connect to any Sonos device on the local network
+
|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 ==
 
== 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".
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 60: Line 61:
 
|-
 
|-
  
|rowspan="5" |state
+
|rowspan="8" |<player>.state
|playing
+
|rowspan="2" |play
 
|R
 
|R
 
|the audio is playing
 
|the audio is playing
 
|-
 
|-
|paused_playback
+
|W
 +
|start playing
 +
|-
 +
|rowspan="2" |pause
 
|R
 
|R
 
|the audio is paused
 
|the audio is paused
 +
|-
 +
|W
 +
|pause the audio
 +
|-
 +
|rowspan="2" |stop
 +
|R
 +
|the audio is stopped
 +
|-
 +
|W
 +
|stop the audio stream
 
|-
 
|-
 
|transitioning
 
|transitioning
 
|R
 
|R
 
|the device is transitioning between audio streams
 
|the device is transitioning between audio streams
|-
 
|stopped
 
|R
 
|the audio is stopped
 
 
|-
 
|-
 
|unknown
 
|unknown
Line 83: Line 93:
 
|-
 
|-
  
|track.number
+
|<player>.track.number
 
|<n>
 
|<n>
 
|R
 
|R
Line 89: Line 99:
 
|-
 
|-
  
|track.title
+
|<player>.track.title
 
|<title>
 
|<title>
 
|R
 
|R
Line 96: Line 106:
 
|-
 
|-
  
|track.creator
+
|<player>.track.creator
 
|<name>
 
|<name>
 
|R
 
|R
Line 103: Line 113:
 
|-
 
|-
  
|track.album
+
|<player>.track.album
 
|<name>
 
|<name>
 
|R
 
|R
Line 110: Line 120:
 
|-
 
|-
  
|track.albumarturi
+
|<player>.track.albumarturi
 
|<uri>
 
|<uri>
 
|R
 
|R
Line 117: Line 127:
 
|-
 
|-
  
|rowspan="4" |mute
+
|rowspan="4" |<player>.mute
 
|rowspan="2" |1
 
|rowspan="2" |1
 
|R
 
|R
Line 134: Line 144:
 
|-
 
|-
  
|rowspan="4" |volume
+
|rowspan="4" |<player>.volume
 
|rowspan="2" |0 ... 100
 
|rowspan="2" |0 ... 100
 
|R
 
|R
Line 152: Line 162:
 
|-
 
|-
  
|rowspan="2" |play
+
|<player>.play
|
 
|W
 
|start playing
 
|-
 
 
|<uri>
 
|<uri>
 
|W
 
|W
|play the audio file located at the specified URI
+
|play the audio file located at the specified URI. After the track ends, the previous state of the player is restored.
  
 
|-
 
|-
  
|pause
+
|rowspan="4" |<player>.queue
|
+
|next
 
|W
 
|W
|pause the audio
+
|go to the next queued track
 
 
 
|-
 
|-
 
+
|prev
|stop
 
|
 
 
|W
 
|W
|stop the current queue
+
|go to the previous queued track
 
 
 
|-
 
|-
 
+
|<n>
|next
 
|
 
 
|W
 
|W
|go to the next queued track
+
|go to the <n>-th queued track
 
 
 
|-
 
|-
 
+
|<n>:<uri>
|previous
 
|
 
 
|W
 
|W
|go to the previous queued track
+
|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)
  
 
|-
 
|-
  
|queue
+
|rowspan="2" |<player>.reachable
|<n>:<uri>
+
|1
|W
+
|R
|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)
+
|the player is normally connected
 +
|-
 +
|0
 +
|R
 +
|the driver cannot communicate with the player
  
 
|}
 
|}
 +
 +
== Public Announcement ==
 +
 +
This driver supports the function of [[Audio_and_Public_Announcement|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:
 +
 +
<pre>
 +
audio io@<io_server_id>.<player> = <audio>
 +
</pre>
 +
 +
For instance:
 +
 +
<pre>
 +
TIME : audio io@sonos.kitchen = file "audio/music.mp3"
 +
TIME : audio io@sonos.kitchen = voice:Alex "Hello world"
 +
</pre>
  
 
== User Interface ==
 
== User Interface ==
Line 219: Line 237:
 
|-
 
|-
  
|rowspan="2"|state.playing
+
|rowspan="2"|<player>.state.play
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint state = playing
+
|when datapoint <player>.state = play
 
|-
 
|-
 
|false
 
|false
Line 229: Line 247:
 
|-
 
|-
  
|rowspan="2"|state.paused_playback
+
|rowspan="2"|<player>.state.pause
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint state = paused_playback
+
|when datapoint <player>.state = pause
 
|-
 
|-
 
|false
 
|false
Line 239: Line 257:
 
|-
 
|-
  
|rowspan="2"|state.transitioning
+
|rowspan="2"|<player>.state.transitioning
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint state = transitioning
+
|when datapoint <player>.state = transitioning
 
|-
 
|-
 
|false
 
|false
Line 249: Line 267:
 
|-
 
|-
  
|rowspan="2"|state.stopped
+
|rowspan="2"|<player>.state.stop
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint state = stopped
+
|when datapoint <player>.state = stopped
 
|-
 
|-
 
|false
 
|false
Line 259: Line 277:
 
|-
 
|-
  
|track.number
+
|<player>.track.number
 
|value
 
|value
 
|colspan="2"|the current track number
 
|colspan="2"|the current track number
Line 265: Line 283:
 
|-
 
|-
  
|track.title
+
|<player>.track.title
 
|value
 
|value
 
|colspan="2"|the current track's title
 
|colspan="2"|the current track's title
Line 271: Line 289:
 
|-
 
|-
  
|track.creator
+
|<player>.track.creator
 
|value
 
|value
 
|colspan="2"|the current track's author
 
|colspan="2"|the current track's author
Line 277: Line 295:
 
|-
 
|-
  
|track.album
+
|<player>.track.album
 
|value
 
|value
 
|colspan="2"|the name of the current track's album
 
|colspan="2"|the name of the current track's album
Line 283: Line 301:
 
|-
 
|-
  
|rowspan="2"|mute.1
+
|rowspan="2"|<player>.mute.1
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint mute = 1
+
|when datapoint <player>.mute = 1
 
|-
 
|-
 
|false
 
|false
|when datapoint mute = 0
+
|when datapoint <player>.mute = 0
  
 
|-
 
|-
  
|rowspan="2"|mute.0
+
|rowspan="2"|<player>.mute.0
 
|rowspan="2"|visible
 
|rowspan="2"|visible
 
|true
 
|true
|when datapoint mute = 0
+
|when datapoint <player>.mute = 0
 
|-
 
|-
 
|false
 
|false
Line 303: Line 321:
 
|-
 
|-
  
|volume
+
|<player>.volume
 
|value
 
|value
 
|colspan="2"|the current volume's value (0 ... 100)
 
|colspan="2"|the current volume's value (0 ... 100)
Line 318: Line 336:
 
|-
 
|-
  
|rowspan="2"|play
+
|rowspan="3"|<player>.state
|
+
|play
 
|start playing
 
|start playing
 
|-
 
|-
|<uri>
 
|play the audio file located at the specified URI
 
 
|-
 
 
 
|pause
 
|pause
|
 
 
|pause the audio
 
|pause the audio
 
 
|-
 
|-
 
 
|stop
 
|stop
|
+
|stop the audio stream
|stop the current queue
 
  
 
|-
 
|-
 
+
|<player>.play
|next
+
|<uri>
|
+
|play the audio file located at the specified URI
|go to the next queued track
 
 
 
|-
 
 
 
|previous
 
|
 
|go to the previous queued track
 
  
 
|-
 
|-
  
|rowspan="3"|volume
+
|rowspan="3"|<player>.volume
 
|0 ... 100
 
|0 ... 100
 
|set the volume to the specified value
 
|set the volume to the specified value
Line 363: Line 365:
 
|-
 
|-
  
|rowspan="2"|mute
+
|rowspan="2"|<player>.mute
 
|1
 
|1
 
|mute the audio
 
|mute the audio
Line 372: Line 374:
 
|-
 
|-
  
|queue
+
|rowspan="4"|<player>.queue
 +
|next
 +
|go to the next queued track
 +
|-
 +
|previous
 +
|go to the previous queued track
 +
|-
 +
|<n>
 +
|go to the <n>-th queued track
 +
|-
 
|<n>:<uri>
 
|<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)
 
|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)
Line 379: Line 390:
  
 
== Release Notes ==
 
== 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 ===
 
=== 3.5.0 ===
Line 386: Line 405:
  
  
''Sonos is a registered trademarks of Sonos, Inc''
+
''Sonos is a registered trademark of Sonos, Inc.''

Latest revision as of 09:57, 23 July 2018

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

ID Default Values Description
startupevents false true generate IO events also during the driver’s start-up phase
false start 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".

ID Value R/W Description
connection online R connection established
offline R HSYCO can't connect to the device
<player>.state play R the audio is playing
W start playing
pause R the audio is paused
W pause the audio
stop R the audio is stopped
W stop the audio stream
transitioning R the device is transitioning between audio streams
unknown R the current state is unknown
<player>.track.number <n> R the current track is the number <n> in the current queue (can be "unknown")
<player>.track.title <title> R title of the current track (can be "unknown")
<player>.track.creator <name> R name of the author of the current track (can be "unknown")
<player>.track.album <name> R name of the album of the current track (can be "unknown")
<player>.track.albumarturi <uri> R uri of the album art of the current track (can be "unknown")
<player>.mute 1 R the audio is muted
W mute the audio
0 R the audio is not muted
W unmute the audio
<player>.volume 0 ... 100 R the volume is set to the reported value
W set the volume to the specified value
+<n> W increase the volume of the specified value
-<n> W decrease the volume of the specified value
<player>.play <uri> W play the audio file located at the specified URI. After the track ends, the previous state of the player is restored.
<player>.queue next W go to the next queued track
prev W go to the previous queued track
<n> W go to the <n>-th queued track
<n>:<uri> W 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)
<player>.reachable 1 R the player is normally connected
0 R the driver cannot communicate with the player

Public Announcement

This driver supports the function of 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

ID Attribute Set to
connection visible true when datapoint connection = offline
false when datapoint connection = online
<player>.state.play visible true when datapoint <player>.state = play
false otherwise
<player>.state.pause visible true when datapoint <player>.state = pause
false otherwise
<player>.state.transitioning visible true when datapoint <player>.state = transitioning
false otherwise
<player>.state.stop visible true when datapoint <player>.state = stopped
false otherwise
<player>.track.number value the current track number
<player>.track.title value the current track's title
<player>.track.creator value the current track's author
<player>.track.album value the name of the current track's album
<player>.mute.1 visible true when datapoint <player>.mute = 1
false when datapoint <player>.mute = 0
<player>.mute.0 visible true when datapoint <player>.mute = 0
false when datapoint mute = 1
<player>.volume value the current volume's value (0 ... 100)

USER Commands

Name Param Action
<player>.state play start playing
pause pause the audio
stop stop the audio stream
<player>.play <uri> play the audio file located at the specified URI
<player>.volume 0 ... 100 set the volume to the specified value
+<n> increase the volume of the specified value
-<n> decrease the volume of the specified value
<player>.mute 1 mute the audio
0 unmute the audio
<player>.queue next go to the next queued track
previous go 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.