Love this? Please consider supporting its creator by starring or sponsoring this project on GitHub!
From the project's README:
Alfred Sonos Controller
Control playback of your Sonos speakers straight from Alfred!
- Download and open the alfredworkflow file to install the workflow
- 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
soco into Alfred, select or search your device, and then control it on the following screen
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.
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)
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:
Open Alfred Preferences -> Workflows -> SonosController and press the [x] button in the top right corner
This screen should appear:
Double click under the value column on interface_address and enter in the address of your local IP
This workflow was built using deanishe's Alfred-Workflow
Huge shoutout to the team behind SoCo which this workflow uses heavily
This workflow is released under the MIT license