/sonos-web

Sonos controller for your web browser

Primary LanguageVueGNU General Public License v3.0GPL-3.0

sonos-web

Sonos Web is a browser based controller for your Sonos sound system.

Install Sonos Web on a single computer and access and manage your system from any browser on your network.

Search View

Sonos Web relies upon the node-sonos project for all its Sonos communication.

Sonos Web has been tested on Windows 10, macOS, Linux, and Raspbian Stretch Lite (9.6).

Check out the following Youtube video to see a brief demo of the system in use. (v0.5.2)

Oh Fork it's a Fork!

This is a fork of Villarrealized's excellent project, which appears to be abandoned. Despite only being a couple years old, the project has rotted quite quickly and developed many breaking issues. Several fixes were pulled into a branch by stufisher which this fork uses.

When I attempted to get this project working for myself I found that:

  • Docker images on Dockerhub that use sonos-web are based off the original project, and thus are broken.
  • The installation method sonos-web-cli is of course tied to the original project and is abit infuriating to dissect what its doing
  • It's non-obvious how to actually run the project from sources (at least for a node newbie?)
  • Even when I got it running with fixes, I still needed to fix an error from node-sonos to get things running.

So I have added a Makefile that builds and runs a server right from these sources, no sonos-web-cli necessary. Just do make serve. Right now this project depends on a fork of node-sonos, but I submitted a pull request to get the fixes upstream.

I have also added a Docker image to Dockerhub to make the project very convenient for Linux Docker users.

Build and run from sources

make serve

Docker Support

A minimal pre-built Docker image is available on Dockerhub. Only Linux is currently supported, as you need Docker's host networking feature for Sonos device discovery. The actual web server uses port 5050 by default.

From CLI or script:

docker run -it --net=host -e PORT=5050 kcghst/sonos-web

docker-compose.yml:

  sonos:
    container_name: sonos
    image: kcghst/sonos-web:latest
    network_mode: "host"
	environment:
	  - PORT=5050

nginx.conf proxy:

	server {
		server_name sonos.*;

		location / {
            proxy_pass http://$hostip:5050;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Protocol $scheme;
            proxy_set_header X-Forwarded-Host $http_host;
		}
	}

TODO?

  • It might be possible to avoid host networking by allowing manual pre-configuration of Sonos hosts
  • The Music Library doesn't work for me personally, I think it requires the Windows share?
  • Would be nice if it could browse music from a DLNA server, even nicer if it had access to everything the Sonos app does

Features

  • Music Library
    • Search your entire music library with Top Results *
      • Including Sonos Playlists! *
    • Browse, Queue, & Play your entire music library by category
    • View Artists, Genres & Playlists with Album Art! *
    • All artist & album names are links that take you to that item *
    • Browsing & searching is cached for quicker load times
  • Sonos Playlists & Favorites
  • Spotify
    • Browse & play your saved spotify playlists, albums, & songs
    • Requires Spotify Premium to play songs
  • Group rooms together via drag & drop *
  • Queue management via icon on Now Playing bar
  • Party mode (Group all speakers into one group)
  • Quickly & easily switch between rooms/groups
  • Adjust individual speaker volume/mute or adjust for the whole group
  • Play, pause, skip, and seek tracks
  • Shuffle & repeat controls
  • Room selection from the Now Playing bar.

* Feature exclusive to Sonos Web (not available on official Sonos App)

Planned Features

  • Music Library
    • Create & Manage Sonos Playlists & Favorites
  • Integration with other Music Services
    • Spotify (added in v0.9.0)
      • Allow searching of Spotify
  • Recent Play History

Screenshots

Now Playing

Now Playing

Queue Management

Queue Management

Search View

Search View 2

Album Detail View

Album View

Playlists View

Playlists View

Songs View

Songs View

Genre Detail View

Genre Detail View

Sonos Favorites & Playlists

Sonos Favorites & Playlists

Spotify Playlists

Spotify Playlists

Spotify Playlist Detail

Spotify Playlist Detail

View all rooms and what they're playing

Rooms

Adjust volume as a group or as individual rooms

Grouped Rooms & Individual Volume Adjustment

License

GPL v3.0