Mycroft Community Forum

Testing and Feedback - Sonos Music Controller Skill

This is my first attempt of making a skill and I have also basically no experience with python or github at all.

Sonos Music Controller Skill:

A Mycroft Skill to control your Sonos speakers. It supports basic commands (such as “play” “pause” “skip” …) but also playing music via different services such as Apple Music and Spotify.

My skill doesn’t require any user authentication, looks for music through the music service APIs (iTunes Search API and Spotify API), and then takes the found ID and converts it to an URI the Sonos players can understand. I took those URIs from jishis Node Sonos package (GitHub - jishi/node-sonos-http-api: An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.) and even opened an issue discussing this way of controlling music services via the python SoCo package (Able to play music from Apple Music · Issue #812 · SoCo/SoCo · GitHub)

Currently the skill won’t work with Spotify for about the first minute of every hour. That’s because of the authentication token with the Spotify API, that I’m using to get the Spotify IDs.

Recently I stumbled overt this skill: GitHub - smartgic/mycroft-sonos-controller-skill: Control Sonos speakers with music services support such as Spotify, that aims to provide the same functionality. I started my skill development last November, so I thought such a skill hadn’t been tried before and I didn’t look on github or on this forum since then. Maybe we could merge those skills together somehow because two skills for the same purpose seem unneccessary.

Installation:
mycroft-msm install https://github.com/QW3RTZUI0P/sonos-music-controller-skill

Just install this skill via mycroft-msm and choose your preferred service. Until now Apple Music is fully supported and with Spotify you can play songs (at least it works on my end, I didn’t test it on other Sonos systems). Just be sure that the placement value in your device settings on home.mycroft.ai is exactly the name of your Sonos speaker.

Examples:

  • play
  • pause
  • skip / next track
  • previous track
  • louder
  • quieter
  • play let it be by the beatles
  • play the album parachute by coldplay
  • play music by coldplay

Feedback:

Any feedback would be greatly appreciated. Privately I’m using Apple Music and now I started my 30-day free trial for Spotify to develop this skill so I don’t have tons of time to develop this without paying ;).

Any error logs or something similar you get when you try to use this skill would also be a great help.

Feedback can be provided via GitHub issues or this forum.

Documentation:

I’m working on a documentation on how my skill functions in the skill repo, but I don’t want to write much until I’m quite sure that the way the skill handles music now is the way to go.

If you have any problems or questions please don’t hesitate to contact me.

3 Likes

Oh, dang, I completely forgot to introduce myself :confounded: (it must have been very late in the evening).

First of all, hi everyone,

I’m very excited to join this community. I’ve been using Mycroft since half a year now and because I use voice assistants 90% of the time to control music over Sonos I’ve been looking for a Mycroft skill that can do exactly that. And because I didn’t find one and wanted to learn something I decided to create my own skill.

I think Mycroft is a great project and I’m very glad that it exists. Having an open-source alternative to Big Tech giants like Amazon, Google, Microsoft and Apple is sooooo important.

Hope I didn’t mess up my start here by posting just this cold, unfriendly description :+1:.

1 Like

You came in with a BANG !!! Giving the community a brand new skill. I wish all new users introduced themselfs like that :wink:

Welcome!

3 Likes

Absolutely - a very warm welcome!

I don’t have any Sonos speakers to test it with unfortunately, but a very cool Skill indeed :partying_face:

Pinging @goldyfruit as I believe it is their Sonos Controller Skill you mentioned.

2 Likes

Yep it’s mine, as @gustavmustermann mentioned there are a bunch of Sonos skills, mostly not maintained or updated. Some of them require Node.js, some manage only one speaker and some other manage only local library.

Having the ability to choose the one that fits your needs is a plus :slight_smile:

Keep going the good work @gustavmustermann :+1:

1 Like