Control Sonos speakers with music services support such as Spotify, Deezer, etc... from Mycroft AI voice assistant.
Control SONOS speakers with music services support such as Spotify, Deezer, Amazon Music, etc…
This skill is not officially commissioned/supported by SONOS. The trademark “SONOS” is registered by “SONOS, Inc.”
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:
Before using a music service, make sure that you linked your service account to your SONOS devices by using the Sonos application:
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
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.