Code Monkey home page Code Monkey logo

alfred-sonoscontroller's Introduction

Add file .alfredworkflow to be easly imported in Alfred

Alfred Sonos Controller

Control playback of your Sonos speakers straight from Alfred!

INSERT YOUR GRAPHIC HERE

Requirements

  • Python 3
  • Alfred Version 3 or above

Installation

Download

  • Download and open the alfredworkflow file to install the workflow

Features

  • Play, Pause, Next, Previous
  • Set/Change Volume
  • View Queue
  • Play Songs from Queue (only tested on Spotify playing through Sonos app)
  • Switch to line-in playback (if supported on device)
  • Control Shuffle/Repeat

Usage

Type soco into Alfred, select or search your device, and then control it on the following screen

INSERT YOUR GRAPHIC HERE

Hotkeys

Hotkeys are added by adding a hotkey trigger on the workflow flowchart (open Alfred Preferences -> Workflows -> Sonos Controller, then right click in the empty space -> Triggers -> Hotkey) and connecting it to the run script block with a text argument that follows the following syntax. You can also edit the preset hotkey triggers by right clicking them and selecting configure object.

(sonosName); (command)

ex:

Bedroom; next

INSERT YOUR GRAPHIC HERE

INSERT YOUR GRAPHIC HERE

Commands:

plpau - Play/Pause Sonos device

play - Play Sonos device

pause - Pause Sonos device

volpcg [value] - Set volume to specified value (ex. Bedroom; volpcg 50)

chvol [value] - Change volume by a specified value

next - Go to the next song

previous - Go to the previous song

linein - Switch playback to line-in

enshuffle - Enable shuffle and disable repeat

disshuffle - Disable shuffle and disable repeat

enrepeat - Enable repeat and disable shuffle

enshuffrep - Enable shuffle and repeat

plque [position in queue] - Play a song in a certain position in queue (only tested on Spotify playing through Sonos app)

Troubleshooting

If you find yourself getting the No Speakers Found error, it may be due to an incorrect interface address. This can be caused by having a VPN active, which unfortunatley Sonos does not support.

If you are still recieving this error, you can try manually setting the interface address to your local IP address on your machine (which can be found under your Network settings) by doing the following:

  1. Open Alfred Preferences -> Workflows -> SonosController and press the [x] button in the top right corner

    This screen should appear:

    INSERT YOUR GRAPHIC HERE

  2. Double click under the value column on interface_address and enter in the address of your local IP

If you have multiple households on your network (or if you have a split S1 / S2 system), got to the Workflows setting (as described above) and set the value for "multi_household" to "true".

Acknowledgements

This workflow was built using deanishe's Alfred-Workflow

Huge shoutout to the team behind SoCo which this workflow uses heavily

Multi Household support added by Clancy Childs


License

This workflow is released under the MIT license

alfred-sonoscontroller's People

Contributors

karimkaylani avatar bigornoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.