logo
Published on

Controlling Pandora From a Pebble

I have a Raspberry Pi connected to a set of speakers and I wanted to be able to control the audio from my Pebble.

Raspberry Pi

I usually use pianobar as a Pandora client on the Pi and it works really well. While looking for a remote for pianobar, I found Pidora and it seemed to fit the bill. I installed Pidora on the Pi and set it to run on startup.

Pidora conveniently provides a web based api. In order to pause a song, just make a GET request to

http://IPADDRESS:8080/api?json={"method":"Control","id":1,"command":"pause"}

and to skip the current song, make a request to

http://IPADDRESS:8080/api?json={"method":"Control","id":1,"command":"next"}

Android/Pebble

There's an extremely powerful app called Tasker that we'll use to help our phone interact with Pidora. There's also a Pebble app called PebbleTasker that lets Pebble tell Tasker to run a task. We'll put these two together to let Pebble control Pandora on the RPi.

First, create a task in Tasker and name it Pause. Add a HTTP Get action to the task and set the server to RPi_IP:8080 and the path to api?json={"method":"Control","id":1,"command":"pause"}. Do this again for a Next task and change "command":"pause" to "command":"next".

Install PebbleTasker from the Pebble Appstore.

Open the PebbleTasker companion app on your phone and map the buttons on the Pebble to the Pause and Next tasks. Open PebbleTasker on your Pebble and try it out!

The whole flow looks like this:

PebbleTasker -> Tasker -> Pidora -> pianobar

All you need to do to control Pandora is just push a button on your watch! Try it out and let me know what you think!