Skip to content

A.2 My Sonos Node

H. Klages edited this page Apr 15, 2024 · 4 revisions

Overview

There are two command categories:

  • library: commands are related to the Music Library, usually hosted on a NAS server in you local network. It has to be made accessible within the SONOS app - settings - systems - Music Library.

  • mySonos: commands are related to My Sonos favorites (see the My Sonos tab - a star - in your SONOS-App)

Commands

Music Library Commands

library.export.album, library.export.artist, library.export.playlist, library.export.track - depreciated

Note
Please use instead universal node: group.play.library, group.play.album, group.play.playlist or group.play.track!

Outputs album, playlist, track object - first one matching search string. The data work together with Universal node group.play.export.

In/Out Property Type Description

in

payload

string

search string to identify the albums, artist, playlist or tracks - field title

out

payload

objects

see beneath

out

.uri

string

URI, can be used together with payload.metadata to play that item

out

.metadata

string

metadata, <DIDL-Lite>: provides additional information

out

.queue

boolean

true means SONOS-Queue ist being used

library.get.albums, library.get.artists, library.get.playlists, library.get.tracks

Outputs array of all albums, artists, playlists, tracks. Optionally you can specify a search string. Search is fuzzy - for example: Ö will provide the Album named Ö from Herbert Grönemeyer first but will also provide all albums in your library. You always have the option to use these commands without any search string and use a change node with JSONata $.payload[$contains(title, /^Ö$/)]

In/Out Property Type Description

in

searchTitle

string - optional

search string to identify the albums, artist, playlist or tracks - field title

out

payload

array of objects

see beneath

out

.[].id

string

object id

out

.[].uri

string

URI, can be used together with payload.metadata to play that item

out

.[].metadata

string

metadata, \<DIDL-Lite\>: provides additional information

out

.[].queue

boolean

is true if queue ist use

out

.[].title

string

album, artist, playlist, track title

out

.[].artist

string

artist

out

.[].sid

string

Music Service provider id to identify the service

out

.[].serviceName

string

Music Service provider name

out

.[].artUri

string

art uri

out

.[].processingType

string

either 'stream' or 'queue' - used for further processing of URI

My Sonos Commands

mysonos.export.item - depreciated

Note
Please use instead the Universal node commands.

Outputs a specific item - first one matching search string. The data work together with Universal node group.play.export.

In/Out Property Type Description

in

payload

string

search string to identify the My Sonos item - field title

out

payload

array of object

Each item is object (see above)

out

.uri

string

URI, can be used together with payload.metadata to play that item

out

.metadata

string

metadata, \<DIDL-Lite\>: provides additional information

out

.queue

boolean

true means SONOS-Queue ist being used

mysonos.get.items

Outputs an array of all My Sonos items. Each items is an object.

In/Out

Property

Type

Description

out

payload

array of objects

Each item is object (see above)

out

.[].id

string

object id

out

.[].title

string

item title

out

.[].artist

string

item artist (if available)

out

.[].album

string

item album (if available)

out

.[].uri

string

URI, content

out

.[].artUri

string

URI, album art - cover page, station logo, …​

out

.[].metadata

string

metadata, \<DIDL-Lite\>: provides additional information

out

.[].sid

string

Music Service provider id to identify the service

out

.[].serviceName

string

Music Service provider name

out

.[].upnpClass

string

can be used for further processing of URI

out

.[].processingType

string

either 'stream' or 'queue' - used for further processing of URI

mysonos.stream.item and mysonos.queue.item - depreciated

Note
Please use instead the Universal node commands.

Both are shortcuts and play the selected item.