PDA

View Full Version : Amazon Echo / Alexa integration how-to with IFTTT



FredFredrickson
2015-12-26, 13:54
Just got an Amazon Echo, and wanted to post how I got it to control the squeezeboxen. It's a little hairy and requires a bit of a work around to get it to do specific commands (for instance, playing a specific station or genre requires you to program each genre individually), but it's worth while since I only listen to a few pandora stations. You can theoretically get it to do anything you'd like.

As a side note, a great way to intercept commands from logitech media server's web interface is using firebug to see what post/get details are sent when you submit a command. That's how I stole the pandora details.

Step 1. Connect your amazon echo to IFTTT.com

Step 2. Port Foward 9000 to your media server. Make sure it's password protected!

Step 3. Add alexa commands to IFTTT, use alexa as the trigger, and Maker as the THAT channel.

Note: You'll need the mac address of your players if you want to control them individually.

Example:

Alexa trigger squeezebox pause kitchen

Maker url:
http://username:password@youripaddress:9000/status.html?p0=pause&player=macaddress


Example:

Alexa trigger squeezebox ambient

(this will play the ambient station on pandora, the values may differ per account)

http://username:password@youripaddress:9000/anyurl?p0=playlist&p1=play&p2=pandora%3A%2F%2F2416111222297772466.mp3&p3=Ambient%20Radio&player=macaddress&_dc=1451159698107


There's a good list of GET variables you can send to your server here: http://tutoriels.domotique-store.fr/content/54/95/fr/api-logitech-squeezebox-server-_-player-http.html

Hope this helps, if anybody has questions I'll try to answer them.

monkmandolins
2016-01-07, 02:00
Are you able to get the Echo to function as one of your music players, or does this just serve as an additional way to control your server?
Thanks, and great work!

FredFredrickson
2016-01-12, 20:26
Are you able to get the Echo to function as one of your music players, or does this just serve as an additional way to control your server?
Thanks, and great work!

I can only use it to control, not play through alexa's speaker. But that's alright, her speaker is kinda ho-hum.

dbinder101
2016-10-17, 07:50
I can only use it to control, not play through alexa's speaker. But that's alright, her speaker is kinda ho-hum.

Has anyone been able to go to the next step...have the echo actually play songs from your LMS library?

paulsi
2016-10-22, 15:11
Ok, I am not that smart. What is IFTT.com??

With the "Dot" from Amazon I would love to control my players.

Julf
2016-10-23, 00:20
Ok, I am not that smart. What is IFTT.com??

"If This Then That", an online service where you can set simple action rules to connect devices and services (such as twitter etc.).

Bixby
2016-12-21, 19:34
Thanks for this info and thread. I just picked up a Dot and was hoping to use it to do some simple commands.

I'm able to get it to (resume) play, and stop play. But the commands I've made for playing specific playlists seems to make Squeezebox Server stop running, so I'm guessing there's something about the command that's problematic.

Here's the command I was using that causes the problem:

http://myURL:9000/status.html?p0=playlist&p1=play&p2=&news&player=MACaddressOfPlayer

Any ideas or suggestions?

mherger
2016-12-21, 22:22
> I'm able to get it to (resume) play, and stop play. But the commands
> I've made for playing specific playlists seems to make Squeezebox Server
> stop running, so I'm guessing there's something about the command that's
> problematic.

I certainly hope those URLs don't make it crash?!? If so, please provide
the server.log and more information about your installation.

> http://myURL:9000/status.html?p0=playlist&p1=play&p2=&news&player=MACaddressOfPlayer

p2 is expected to be a playable URL. You don't even set it, but have
that invalid "news" parameter in there. You can't play an item by its
menu name or the like.


--

Michael

Bixby
2016-12-22, 20:05
Thanks Michael.

I misunderstood about the P2 parameter.

I just got it working playing a web stream, which is great and the top priority. So I'll keep playing with that info!

Does a playlist have a useable/passable URL, and if so how do I get that? I know how to access Chrome Developer tools etc., but don't have much knowledge past that.

Thanks again!

mherger
2016-12-23, 08:02
> Does a playlist have a useable/passable URL, and if so how do I get
> that? I know how to access Chrome Developer tools etc., but don't have
> much knowledge past that.

Local files (playlists or audio files) would use a url of type
file://path/to/your/playlist.m3u or similar.

--
--

Michael

Bixby
2016-12-23, 19:43
Thanks!

Bixby
2016-12-25, 19:33
Can anyone walk me through how to get URL data for pandora channels? Thanks!

Barnabas
2017-01-20, 20:51
Maker url:
http://username:password@youripaddress:9000/status.html?p0=pause&player=macaddress


Example:

Alexa trigger squeezebox ambient

(this will play the ambient station on pandora, the values may differ per account)

http://username:password@youripaddress:9000/anyurl?p0=playlist&p1=play&p2=pandora%3A%2F%2F2416111222297772466.mp3&p3=Ambient%20Radio&player=macaddress&_dc=1451159698107



Don't send your username/password in clear text http. It is the easiest thing in the word to intercept. Use https. If the logitech server miss that feature, then its safer to put it behind a proxy in an Apache httpd and make that wrap in SSL.