Skip to content

Slack app for controlling Sonos speakers using the node-sonos-http-api

License

Notifications You must be signed in to change notification settings

estiens/jukebot

Repository files navigation

jukebot

Slack bot in Ruby that can control your Sonos system through the node-sonos-http-api. [https://github.com/jishi/node-sonos-http-api]. Interacts heavily with Spotify and TuneIn.

Built on the slack-ruby-bot framework. [https://github.com/slack-ruby/slack-ruby-bot]

INSTALLATION

Before You Start

  1. Have a Slack Bot API Token[https://api.slack.com/bot-users]

  2. Have a Spotify app username and passwork.[https://developer.spotify.com]

  3. The computer where you run this app must be able to talk to your node-sonos-http-api. This means if you are running this app externally to your network you must have ports forwarded appropriately.

  4. Have a username and password setup on your node-sonos-http-api.

  5. Fork/Clone this repo.

Setting Environment Variables

  1. Copy .env.sample to .env
  2. Enter values for all the variables.
  • SLACK_API_TOKEN (api token for slack bot)
  • RSPOTIFY_TOKEN (spotify app token)
  • RSPOTIFY_PASSWORD (spotify app password)
  • USERNAME (username for sonos api)
  • PASSWORD (password for sonos api)
  • NODE_SONOS_HTTP_API_URL (url for sonos api)
  • SLACK_RUBY_BOT_ALIASES (any aliases you want jukebot to respond to)

Run It

  1. ruby jukebot.rb

Run It With Docker

  1. Edit docker-compose.yml to set environment variables
  2. docker-compose build --pull
  3. docker-compose up -d

View the logs:

docker-compose logs -f

Stop:

docker-compose down

Upgrade:

  1. docker-compose down
  2. git pull
  3. docker-compose build --pull
  4. docker-compose up -d

JukeBot controls your Sonos rooms

alt text

JukeBot finds music

alt text

JukeBot plays music

alt text

JukeBot likes the radio

alt text

JukeBot makes it louder

alt text

JukeBot pauses it

alt text

JukeBot moves it along

alt text

JukeBot tells you what's playing

alt text

About

Slack app for controlling Sonos speakers using the node-sonos-http-api

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published