Skip to content

Control SONOS® speakers with music services support such as Deezer, Spotify, Amazon Music, etc... from your Open Voice OS assistant.

License

Notifications You must be signed in to change notification settings

smartgic/skill-sonos-controller

Repository files navigation

SONOS Controller

License: MIT contributions welcome Skill: MIT Discord

Control SONOS speakers with music services support such as Spotify, Deezer, Amazon Music, etc...

Disclaimer

This skill is not officially commissioned/supported by SONOS. The trademark "SONOS" is registered by "SONOS, Inc."

About

SONOS is the ultimate wireless home sound system: a whole-house WiFi network that fills your home with brilliant sound, room by room.

This skill interacts with your Sonos devices and allows you to play music from different music sources such as:

  • Local library
  • Amazon Music (account required)
  • Deezer (account required)
  • Plex (account required)
  • Spotify (account required)
  • Tidal (account required)

Before using a music service, make sure that you linked your service account to your SONOS devices by using the Sonos application:

Examples

  • play i got a feeling on living room
  • play i got a feeling by black eyed peas on living room
  • play i got a feeling from spotify on living room
  • play i got a feeling by black eyed peas from spotify on living room
  • play soundtrack playlist on dining room
  • play soundtrack playlist from spotify on dining room
  • play soundtrack album on dining room
  • play back to front album by lionel richie on dining room
  • play back to front album by lionel richie from spotify on dining room
  • play soundtrack album from spotify on dining room
  • play the mysterious universe podcast from plex on office
  • discover sonos devices
  • what is playing
  • which artist is playing
  • what are my music services
  • volume louder
  • volume quieter
  • volume down on living room
  • volume up
  • quieter
  • louder
  • pause music
  • stop music
  • stop the music on office speaker
  • resume music
  • shuffle off
  • shuffle on
  • disable repeat mode
  • enable repeat mode
  • next music
  • previous music
  • give me information on dining room speaker
  • give me detailed information about library speaker

Installation

When using ovos-core, two approaches are available to install this skill.

The first one will be to use pip and install the skill in the same "place" as ovos-core, sharing Python libraries.

pip install git+https://github.com/smartgic/skill-sonos-controller

The second one will be to run the skill as standalone within a container. Run the docker compose command but before edit the .env environment file if required.

cd docker
docker compose up -d

Configuration

This skill utilizes the settings.json file which allows you to configure it. This file is available in different places depending how Open Voice OS has been installed:

  • venv: ~/.config/mycroft/skills/skill-sonos-controller.smartgic/settings.json
  • containers: ~/ovos/config/skills/skill-sonos-controller.smartgic/settings.json
Option Default Description
default_source music library Default source of music to play from
link_code None Link code spoken by the skill (Visit sonos.smartgic.io/ABCD)
duck false Reduce volume level temporarly when speaking (wake word detected)
playing_confirmation false Receive playing confirmation
searching_confirmation true Receive searching confirmation

Available source:

  • amazon music
  • deezer
  • music library
  • plex
  • spotify
  • tidal

To authenticate to Spotify music service:

{
  "__mycroft_skill_firstrun": false,
  "playing_confirmation": true,
  "default_source": "spotify",
  "duck": true
}

When Spotify music service is selected (or any others except music library), OVOS will speak to you with a URL and a code to follow. This URL is https://sonos.smartgic.io/CODE where CODE will be automatically and randomly generated by OVOS and spoken to you (e.g. Visit sonos.smartgic.io/FRK7Y).

https://sonos.smartgic.io is a URL shortener system which will temporary store the music service authentication URL (no password). Once the authentication is done, the URL will be deleted from the URL shortener system.

This link will redirect you to the music service official authentication login page using secured protocol.

Once successfully logged to Spotify, enter the same code as provided before into ~/ovos/config/skills/skill-sonos-controller.smartgic/settings.json using the link_code key.

{
  "__mycroft_skill_firstrun": false,
  "default_source": "spotify",
  "duck": true,
  "link_code": "FRK7Y"
}

OVOS will confirm the success of the authentification and gives you some examples of what you could say to your assistant.

Supported languages

  • English
  • French
  • German
  • Italian

Credits