Project

Control a JustBoom with Alexa

Scroll down

“Alexa – fix me a coffee and a donut. A jam one. With cream.”

Well, we’re not there quite yet. But Amazon’s Alexa is fast becoming the virtual P.A. for more and more of us. That’s why we’re so excited by a neat little bit of wizardry we’ve come across that lets you control your JustBoom player from afar simply by asking you-know-who.

Just follow these easy steps – and you’ll soon be adjusting your JustBoom audio boards using the JustBoom OS REST API and Amazon Alexa. (Oh, and since we use the cloud service IFTTT and the built-in REST APIs from JustBoom OS to make calls, there’s no complex coding to tie you up in knots.)

First things first – here’s the stuff you’ll need:

  • Raspberry Pi & Power supply
  • JustBoom HAT or pHAT
  • JustBoom Player & 8GB micro SD card (minimum requirement)
  • Amazon Alexa device

Ready? Let’s go…

Setup pHAT

If you haven’t already set up your JustBoom board, head on over to https://www.justboom.co/start/ and install your very own player.

 

 

Configure Your Router

OK, to remotely connect, start by opening up your web browser and accessing your router’s home page by using the router’s web URL. (Can’t find your gateway IP address? It’s on the reverse of your router.)

Next, enter your user name and password and click through to ‘Port Forwarding’.

 

Now we need to create a new rule in the ‘Port Forwarding’ menu. Simply replace the IP address with your JustBoom IP address by adding these settings to forward port 80 to your JustBoom player:

  • Local IP: 192.168.X.X
  • Local Port: 80
  • External Port: 80
  • Protocol: Both

Simply click ‘Add Rule’ or ‘Enable’ to add the Port forwarding for the player.

Nearly there…

Next, open your web browser and tap in http://www.whatsmyip.org . You’ll see your external IP address at the top of the page – this will connect to your JustBoom player from any place on earth with the internet.

 

 

Connect To Your Player

Now using your mobile phone (Wi-Fi switched off) or an external computer, open a browser and navigate to http://yourip/ replacing ‘yourip’ with your external IP address. Boom! You’ve just connected remotely to your JustBoom home page…

Setting Up IFTTT

If you’ve never heard of IFTTT, it’s the rather dumb acronym for the rather brilliant ‘If This Then That’ – a web service that lets you connect and control devices across different platforms. Here we’ll see how to use it to link Amazon Alexa to a Webhooks service using nothing but our voice command from Alexa to call up, say, a URL.

To get started, go to http://www.ifttt.com and login or create an account.

 

 

Now click on ‘My Applets’ on the top left hand side of the IFTTT home page.

 

 

Click on ‘New Applet’ then click the ‘this’ in the title ‘if this then that’.

 

 

Search for ‘Amazon Alexa’ and click on the service.

 

 

At this point we need to choose a trigger – something that will activate the call we send to the JustBoom player. It’s best to use a specific phase such as “Alexa trigger music on”. Select the trigger ‘Say a specific phrase’ and type ‘music on’ in the text box.

 

 

Now it’s time to configure ‘that’ – which is what we want to call when the trigger’s activated. In this case we want to call a URL to the JustBoom player.

 

 

Type ‘web’ in the search box and, hey presto, you’ll see the service ‘Webhooks’ which let you call the JustBoom URL.

 

 

Now click on ‘Make a web request’ and, in the URL field, add http://yourip/api/v1/commands/?cmd=play   followed by your external IP address. This is the URL used to play the music. Now simply click ‘Add ingredient’ and then ‘Create action’.

 

 

Finally, review the applet, make a note of your chosen trigger, and click ‘Finish’. Done!

 

Give It A Try

Try out your fab new IFTTT applet by racing over to your Alexa device and uttering that magic phrase “Alexa trigger music on”…

Then grab a coffee and a donut, kick back on your favourite sofa and let your JustBoom player start playing your favourite music.

Of course, now you’ve added the ‘music on’ command you can add as many applets as you want to IFTTT. There’s a whole bunch of playback commands you can call for the JustBoom player – why not check out some of these for starters:

  • Toggle between play and pause – http://yourip/api/v1/commands/?cmd=toggle
  • Stop – http://yourip/api/v1/commands/?cmd=stop
  • Pause – http://yourip/api/v1/commands/?cmd=pause
  • Previous – http://yourip/api/v1/commands/?cmd=prev
  • Next – http://yourip/api/v1/commands/?cmd=next
  • Volume – http://yourip/api/v1/commands/?cmd=volume&volume=80
  • Play playlist – http://yourip/api/v1/commands/?cmd=playplaylist&name=Rock

 

Like what you read? Why not show your appreciation by giving some love.

From a quick tap to smashing that love button and show how much you enjoyed this project.