All Projects → Iteam1337 → sonos-wejay

Iteam1337 / sonos-wejay

Licence: MIT license
Slack integration for a local Sonos system

Programming Languages

reason
219 projects
C++
36643 projects - #6 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to sonos-wejay

Vinylemulator
Emulate the tactile experience of a vinyl collection through your Sonos system, but with a back end run by Spotify
Stars: ✭ 106 (+457.89%)
Mutual labels:  spotify, sonos
Zenmusic
Slack / Sonos / Spotify / Node.js - Control Sonos through #Slack
Stars: ✭ 113 (+494.74%)
Mutual labels:  spotify, sonos
Sonos Web
Web interface for Sonos audio systems
Stars: ✭ 114 (+500%)
Mutual labels:  spotify, sonos
PugetSound
PugetSound allows you and your group to enjoy music together using Spotify.
Stars: ✭ 52 (+173.68%)
Mutual labels:  spotify
reason-react-lazy-loading
Example project to show how to use components lazy loading in ReasonReact
Stars: ✭ 41 (+115.79%)
Mutual labels:  reasonml
bronos-client
No description or website provided.
Stars: ✭ 40 (+110.53%)
Mutual labels:  sonos
mulukhiya-toot-proxy
各種ActivityPub対応インスタンスへの投稿に対して、内容の更新等を行うプロキシ。通称「モロヘイヤ」。
Stars: ✭ 24 (+26.32%)
Mutual labels:  spotify
Wox.Plugin.Spotify
Spotify plugin for Wox launcher
Stars: ✭ 29 (+52.63%)
Mutual labels:  spotify
now-playing
A macOS application for Spotify notifications and a now playing visual widget!
Stars: ✭ 62 (+226.32%)
Mutual labels:  spotify
ideas-for-project-names-starting-with-re
No description or website provided.
Stars: ✭ 27 (+42.11%)
Mutual labels:  reasonml
rx-reason
Reactive programming library for ReasonML/OCaml
Stars: ✭ 49 (+157.89%)
Mutual labels:  reasonml
bs-dynamic-import
📦🚀 BuckleScript dynamic import interop on JavaScript environment
Stars: ✭ 31 (+63.16%)
Mutual labels:  reasonml
alexa-spotify-connect
Control Spotify Connect devices with Alexa
Stars: ✭ 92 (+384.21%)
Mutual labels:  spotify
react-rules-of-hooks-ppx
This ppx validates the rules of React hooks.
Stars: ✭ 40 (+110.53%)
Mutual labels:  reasonml
Moosync
A simple music player capable of playing local audio or from Youtube or Spotify
Stars: ✭ 185 (+873.68%)
Mutual labels:  spotify
listentogether-hackathon
Grab some friends, connect your Spotify account, and listen to music in sync with each other.
Stars: ✭ 20 (+5.26%)
Mutual labels:  spotify
JFrogfy
a simple clone of spotify built in Emberjs octane the music is played with youtube
Stars: ✭ 27 (+42.11%)
Mutual labels:  spotify
remachine
[WIP] Reason pattern matching viz
Stars: ✭ 44 (+131.58%)
Mutual labels:  reasonml
SonosSharp
Sonos API for .NET
Stars: ✭ 20 (+5.26%)
Mutual labels:  sonos
ogaml
Ocaml multimedia library
Stars: ✭ 28 (+47.37%)
Mutual labels:  reasonml

Sonos Wejay

Wejay is a music collaboration bot for Slack that can be used to add music to a local Sonos system. It needs to be started on the same network as your Sonos system in order to communicate with the speakers.

Demo of Wejay Slack bot

Get started

Prerequisites

Start by creating a .env file in the root directory of the project. This is for the Spotify search feature and to allow the bot to interact with Slack. It should contain

SPOTIFY_ID=spotify-token-here
SPOTIFY_SECRET=spotify-secret-here
SLACK_TOKEN=slack-token-here
WEJAY_IP=ip-of-the-speaker

Spotify token/secret can be generated by creating an app at https://developer.spotify.com/. Slack token can be found after adding the bot to your Slack below. The value for WEJAY_IP can be found in "About My Sonos System" of the Sonos Controller app, choose the IP of the speaker you'd like to send music to.

$ git clone https://github.com/Iteam1337/sonos-wejay.git
$ cd sonos-wejay
$ npm install
$ npm build && npm run dev

This will compile the Reason code and start up the Express app.

Testing it out

  1. The easiest way to start testing is using ngrok. After you've installed ngrok, open another terminal and run ngrok http 3000. This will create a tunnel to you local environment.
  2. Go to https://api.slack.com/apps and create a new app
  3. Inside OAuth & Permissions you'll find "Bot User OAuth Access Token" which is the token that should be added in your .env above.
  4. Go to Interactive Components and enable it. In the request url enter one of the urls provided by ngrok (http or https) and the route /action, i.e. https://127.0.0.1/action
  5. Also on Interactive Components add a action. Give it the name "Queue track" and description and callback id "queue"
  6. Go to Event Subscriptions and enable it. In the request url use the same url as above but use the route /event
  7. Also on Event Subscriptions add a "Bot User Event". The best one is message.im, which means you can send commands to the bot in private messages
  8. You should be able to send some commands to the bot in Slack now, try sending help to see all available commands

Available commands

Command Shorthand Description
blame Who added the track? (requires MySQL database)
clear Reset playlist
currentqueue getqueue, gq, cq Display upcoming tracks
fullqueue fq Display all tracks currently in the queue
help Display the help text
mute Mute
mostplayed List the most played tracks (requires MySQL database)
next skip Skip one track forward
nowplaying np Display what's playing right now
remove <numberOfTracks> <index> rm Remove tracks
pause Pause
play Play
playtrack <trackNumber> Play track number
playlatest pl Play latest track
previous Go back one track
queue <Spotify URI> q <Spotify URI> Queue a track using a Spotify URI
search <your search string> s <your search string> Search Spotify for a track
toplist List top Wejayers (requires MySQL database)
unmute Unmute
volume <0-100> Set volume, if no number is provided displays current volume

Copy and paste from Spotify

You can also select a couple of tracks in Spotify, press cmd+c (Mac) / ctrl+c (Windows), paste the copied information to the Wejay bot and send the message. Wejay will add all of your tracks at the end of the queue! 🎉

Database

Some of the commands, like blame and toplist requires that you have a MySQL database that the service can access. We've included a docker-compose.yml that you can use to spin up a database.

Contributors

Thanks goes to these wonderful people (emoji key):

Rickard Laurin
Rickard Laurin

💻 📖 🤔 👀
Tom Ekander
Tom Ekander

💻 🤔
Jimmy Jardland
Jimmy Jardland

💻 🤔
Nils Nilsson
Nils Nilsson

💻 🤔
faroutchris
faroutchris

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].