PDA

View Full Version : LMS with Google Home, Chromecast and IFTTT (maybe)?



ModelCitizen
2017-12-13, 02:45
Hello all.

I run a large Flac library via Windows based LMS to a number of Squeeze and Chromecast enable devices. Control is mostly by Orange Squeeze on Android devices.

I am getting a Google Home device for Christmas and am trying to figure out if I can use it to voice control my Squeeze devices to play my flac library (preferably via LMS but think that's probably not likely). I've been pointed towards an app called IFTTT (IFTTT.com) but can't see how it can help (not being a developer). Has anyone any experience of Google Home and flac based local libraries? Any suggestions would be very welcome.

Waffle: am quite excited by this device. It seems i will be able to use it to (at least) partially to voice control my Chromecast enabled TVs, and Spotify via my Chromecast enabled audio devices.

castalla
2017-12-13, 04:01
Hello all.

I run a large Flac library via Windows based LMS to a number of Squeeze and Chromecast enable devices. Control is mostly by Orange Squeeze on Android devices.

I am getting a Google Home device for Christmas and am trying to figure out if I can use it to voice control my Squeeze devices to play my flac library (preferably via LMS but think that's probably not likely). I've been pointed towards an app called IFTTT (IFTTT.com) but can't see how it can help (not being a developer). Has anyone any experience of Google Home and flac based local libraries? Any suggestions would be very welcome.

Waffle: am quite excited by this device. It seems i will be able to use it to (at least) partially to voice control my Chromecast enabled TVs, and Spotify via my Chromecast enabled audio devices.

LMS control - not available. Meep has an alexa plugin (alpha) which works (but not to choose from music library).

Accessing local music via GH or Alexa is essentially impossible - you are stuck with what the devices offer (eg. Spotify, Google Play Music). You can upload your files to Google Play Music BUT there are many complaints that accessing them via the Home devices is very buggy. Spotify is good, but again accessing local files is badly implemented.

The UK version of Home has a very restricted set of services compared to the US. Google support is very poor - no feedback on issues you might raise.

meep
2017-12-13, 10:32
Hi there

Check out the hab-tunes videos to get an idea of how LMS voice control works on Alexa. I'm hoping to migrate this to Google Home once released (early new year)

As Castalla says, there's no direct selection of music yet (working on favourites and playlists right now). It will always be for control of LMS and squeezeboxes - I've tried direct streaming music to the Echo device itself but it's hampered by very significant lag so playback of local files through an echo of google home is unlikely - you'll always need to play back via a SB device.

Stay tuned to Alexa developments to get an idea of what might be coming to a Google Home near you.

castalla
2017-12-13, 10:38
Hi there

Check out the hab-tunes videos to get an idea of how LMS voice control works on Alexa. I'm hoping to migrate this to Google Home once released (early new year)

As Castalla says, there's no direct selection of music yet (working on favourites and playlists right now). It will always be for control of LMS and squeezeboxes - I've tried direct streaming music to the Echo device itself but it's hampered by very significant lag so playback of local files through an echo of google home is unlikely - you'll always need to play back via a SB device.

Stay tuned to Alexa developments to get an idea of what might be coming to a Google Home near you.

OOOHHH! a possible Xmas gift?! followed by a New Year gift .... : )

ModelCitizen
2017-12-13, 11:39
Hi there
Check out the hab-tunes videos to get an idea of how LMS voice control works on Alexa. I'm hoping to migrate this to Google Home once released (early new year)
As Castalla says, there's no direct selection of music yet (working on favourites and playlists right now). It will always be for control of LMS and squeezeboxes - I've tried direct streaming music to the Echo device itself but it's hampered by very significant lag so playback of local files through an echo of google home is unlikely - you'll always need to play back via a SB device.
Stay tuned to Alexa developments to get an idea of what might be coming to a Google Home near you.

Hi Meep.

Well that looks great. Using Google Home to control a Squeezbox would be dead useful for me so I'll keep my eye on your work. Do you have a mailing list or something? I'd like to know when you've cracked the ability to choose music or playlist.

One thing... I didn't quite understand your use of the word 'skill'. Is this an Alexa specific word or maybe a programming word?

And.... once you've developed the app to work with Alexa, is it much work to port it to Google Home?

FredFredrickson
2017-12-18, 14:51
There are some limited options for setting up LMS with alexa / google home if you use IFTTT.

I wrote about it before but here's a recap, using MAKER channel on IFTTT, you can trigger URLS upon certain commands. It can be tricky if you have a dynamic IP address at home. I use dynamic dns with a google domain so i can reference only the domain name even if my IP address changes.

Step 1. Connect your amazon echo / Google home 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 / google home 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.

Xyleme
2018-01-24, 02:29
I don't know if I'm missing something but it won't work at home...

I've forwarded the 9090 in my router. (sending command througt telnet works).

But using webhooks in IFTTT doesn't work.
How should I setup it ? GET, POST ? text/html or application/js ?... Any advice ?

I've just try with http://serverip:9090/status.html?p0=play&player=playermacadress (also tried with pause instead of play) but nothing happen.
When I "check" the scritp in ifttt I get no error.

In tasker I got the autosqueeze plugin which works well (guess it's also using CLI to communicate with the server...).

Thanks for any help

Paul Webster
2018-01-24, 04:05
Did you replace serverip and macaddress with the correct details for your system?
Also, the example above is using port 9000 not 9090.

Xyleme
2018-01-24, 08:32
Sure I've replace with my server ip 192.168... and the port is 9090 (when setting up autosqueeze in tasker or using telnet works great with this port).

Paul Webster
2018-01-24, 09:16
IP needs to be the public IP address that reaches your router from the outside - not the internal 192... address because it is IFTTT that is trying to reach your system not your local Google Home box.
Also - I presume that the working example from earlier is using port 9000 because it is using regular HTTP GET and not the telnet/CLI interface.

Xyleme
2018-01-24, 10:31
Ok thanks a lot I get it. I though it was possible to use local ip when connected to home wifi with ifttt. That's why it doesn't work. And I now understand why @FredFredrickson said "make sure to be password protected" ;)
Thnks again

itm
2018-01-29, 12:22
FYI if you want to throw Home Assistant (open source home automation software) into the mix you can also use Google Home to play specific tracks, albums, artists, etc from LMS. I've put information on this on another thread here.

dimmer
2018-02-12, 13:08
I have been successful in getting my goggle home working with IFTTT and my LMS system.
It functions quite well ... to the point where I've order the google home mini as just a remote control for LMS.

I am able to:
-control volume
-play/pause
-skip/previous
-select playlist
-shuffle playlist
- select artist
- add artist to playlist

The general steps were to:
- setup Dynamic DNS to home
- password protect LMS ... you don't want to have this open
- forward port 9000 on router
- create IFTTT account - link google assistant
- create IFTTT applet for each command

The trickiest part was getting the url's correct for the IFTTT actions.
To make this easy for anyone wanting to try, I have created the attached spreadsheet.
You enter your specific info in the setup tab, and the commands that you need for IFTTT will be generated for you.

nervoteso
2018-04-03, 04:25
I have been successful in getting my goggle home working with IFTTT and my LMS system.
It functions quite well ... to the point where I've order the google home mini as just a remote control for LMS.

Ilaylist

Th

The trickiest part was getting the url's correct for the IFTTT actions.
To make this easy for anyone wanting to try, I have created the attached spreadsheet.
You enter your specific info in the setup tab, and the commands that you need for IFTTT will be generated for you.

hello
i'be google home, i've a dns.org account, forwarded my router to 9000, but i can0t seem to make it iftt work, how can i create these actions?

Sp0oNy
2018-04-05, 11:45
To make this easy for anyone wanting to try, I have created the attached spreadsheet.
You enter your specific info in the setup tab, and the commands that you need for IFTTT will be generated for you.

Many thanks !

fullerms
2018-05-12, 07:13
I have been successful in getting my goggle home working with IFTTT and my LMS system.
It functions quite well ... to the point where I've order the google home mini as just a remote control for LMS.

I am able to:
-control volume
-play/pause
-skip/previous
-select playlist
-shuffle playlist
- select artist
- add artist to playlist

The general steps were to:
- setup Dynamic DNS to home
- password protect LMS ... you don't want to have this open
- forward port 9000 on router
- create IFTTT account - link google assistant
- create IFTTT applet for each command

The trickiest part was getting the url's correct for the IFTTT actions.
To make this easy for anyone wanting to try, I have created the attached spreadsheet.
You enter your specific info in the setup tab, and the commands that you need for IFTTT will be generated for you.


Edit: It all works now, I had the wrong mac address in some commands. Is it possible to have the player name as a variable in IFTTT Applet? I have three players, and wondering if I need to create applets for each of them?

fullerms
2018-05-12, 19:56
So a "Play Artist" command fails if Google Assistant applies the wrong capitalization to the First name or Surname of the Artist. Same with Albums, if there is wrong capitalization by Google Assistant, then the player just stops.

Anyway to fix this so the capitalization errors are ignored, or atleast the player does not drop the current play list?

ynot1234567890
2018-06-21, 05:44
Using Google dialog flow and Home assistant, I have managed to make a pretty decent voice command front-end for the LMS system. Currently supported commands include:

play / add album, song or artist t the current playlist
play / add playlist
play radio
select mediaplayer
set shuffle, repeat
set volume
pause, play, next track
Supports all defined players in LMS (using sonos, upnp, cast, squeeze players)
Also Turn on/off lights, plugs, devices and soon dimmer functions
Uses DuckDNS / let's encrypt for secure internet access


Current limitations include:
- no spotty specific commands for search
- using loadtracks command so compound queries are not available (ie: song money by pink floyd)
- voice app needs to be called specifically from google home or assistant (ie: hey google, talk to LMS commander)

Decided to use Home Assistant (HASSIO) as the middle man to handle the webhooks, security, etc as well this approach allows voice access to any other home automation systems I may have in place, regardless of direct compatibility with Google Home.

Access to your system is available anywhere on any device using google assistant (IOS, Android, Windows, google home, mini, etc..)

Gave up on the use of IFTTT as it did not support enough variables or have enough flexibility to allow multiple commands or complex queries or provide feedback for missing values.

If there is interest in this approach, I can provide further details. A work in progress, but a fun toy none the less.

Ynot

itm
2018-06-21, 06:02
Using Google dialog flow and Home assistant, I have managed to make a pretty decent voice command front-end for the LMS system. Currently supported commands include:

play / add album, song or artist t the current playlist
play / add playlist
play radio
select mediaplayer
set shuffle, repeat
set volume
pause, play, next track
Supports all defined players in LMS (using sonos, upnp, cast, squeeze players)
Also Turn on/off lights, plugs, devices and soon dimmer functions
Uses DuckDNS / let's encrypt for secure internet access


Current limitations include:
- no spotty specific commands for search
- using loadtracks command so compound queries are not available (ie: song money by pink floyd)
- voice app needs to be called specifically from google home or assistant (ie: hey google, talk to LMS commander)

Decided to use Home Assistant (HASSIO) as the middle man to handle the webhooks, security, etc as well this approach allows voice access to any other home automation systems I may have in place, regardless of direct compatibility with Google Home.

Access to your system is available anywhere on any device using google assistant (IOS, Android, Windows, google home, mini, etc..)

Gave up on the use of IFTTT as it did not support enough variables or have enough flexibility to allow multiple commands or complex queries or provide feedback for missing values.

If there is interest in this approach, I can provide further details. A work in progress, but a fun toy none the less.

Ynot

I'd be interested to hear more about how you did this. It would be great to get around the compound query limitation at some stage too, as I often get the wrong version of a track when I request it.

ynot1234567890
2018-07-24, 19:10
For those who may be interested, I have opened a github project here: https://github.com/ynot123/LMS_Controls that contains the code required to voice enable much of your LMS installation.

The configuration allows voice control for your Logitech Media Server from Google Home or Google Assistant (on your iPhone / Android device) with Home Assistant (HA) acting as the middle man. The following functions are supported:


Perform queries for songs, albums, artists and playlists from the LMS server or from the music source Spotify (compound queries are supported)
Play queried items
Add to current playlist
Set music source (local LMS database or Spotify (using spotty)
Set volume
Set sleep timer
Set shuffle on / off
Set repeat on / off
Next track
Pause and re-start players


A Home Assistant web GUI front-end for the query tool is also included. Using HA you can further enhance the LMS tools to create home automation scenes (ie: play your favorite radio station when you get home, turn down the lights when listening to music, etc..).

Warning, there is some configuration required to make this work. the prerequisites are:


Logitech Media Server
Home Assistant - open source home automation package
Google Home (or google assistant)
Developer account for Dialogflow for the voice activation part
Spotify account with Client_ID and Client_Secret to allow query processing


If interested give it a go. I've been using it for sometime now and find it "cute" and convenient for simple listening and I especially enjoy the sleep timer feature.

Ynot.

itm
2018-07-25, 02:58
For those who may be interested, I have opened a github project here: https://github.com/ynot123/LMS_Controls that contains the code required to voice enable much of your LMS installation.

The configuration allows voice control for your Logitech Media Server from Google Home or Google Assistant (on your iPhone / Android device) with Home Assistant (HA) acting as the middle man. The following functions are supported:


Perform queries for songs, albums, artists and playlists from the LMS server or from the music source Spotify (compound queries are supported)
Play queried items
Add to current playlist
Set music source (local LMS database or Spotify (using spotty)
Set volume
Set sleep timer
Set shuffle on / off
Set repeat on / off
Next track
Pause and re-start players


A Home Assistant web GUI front-end for the query tool is also included. Using HA you can further enhance the LMS tools to create home automation scenes (ie: play your favorite radio station when you get home, turn down the lights when listening to music, etc..).

Warning, there is some configuration required to make this work. the prerequisites are:


Logitech Media Server
Home Assistant - open source home automation package
Google Home (or google assistant)
Developer account for Dialogflow for the voice activation part
Spotify account with Client_ID and Client_Secret to allow query processing


If interested give it a go. I've been using it for sometime now and find it "cute" and convenient for simple listening and I especially enjoy the sleep timer feature.

Ynot.
This doesn't allow complex queries by any chance, does it? (e.g. "play brown sugar from sticky fingers")

ynot1234567890
2018-07-25, 03:41
This doesn't allow complex queries by any chance, does it? (e.g. "play brown sugar from sticky fingers")

Yes it does. My favorite, Money by Pink Floyd.

In this case the actual verbage would be: "Play Song money by Pink Floyd".

Also works with albums and supports multiple keywords like: "Add album Dog and Butterfly by Heart in the kitchen with shuffle on". That's the difference between using IFTTT and DialogFlow.

Ynot

itm
2018-07-25, 04:29
Yes it does. My favorite, Money by Pink Floyd.

In this case the actual verbage would be: "Play Song money by Pink Floyd".

Also works with albums and supports multiple keywords like: "Add album Dog and Butterfly by Heart in the kitchen with shuffle on". That's the difference between using IFTTT and DialogFlow.

Hmm....now that's very interesting. Is a paid Spotify account required, or will a free account suffice?

ynot1234567890
2018-07-25, 08:06
Hmm....now that's very interesting. Is a paid Spotify account required, or will a free account suffice?

NTS (Not too sure). I listen to a lot of music so it's worth the 10 bucks a month. You do need to have an account of some sort for sure to get the client id and secret keys.

itm
2018-07-29, 04:12
NTS (Not too sure). I listen to a lot of music so it's worth the 10 bucks a month. You do need to have an account of some sort for sure to get the client id and secret keys.

I'm just following the setup instructions and have hit a problem with the shell script updates for Spotify - I have no idea what my Spotify_Client_ID and Spotify_Client_Secret are. How do you get these? (I have a free Spotify account). I don't see anything on my Spotify web dashboard which refers to them.

itm
2018-07-29, 04:16
....also...which folder do I copy the HA shell scripts to? (I'm running HA 0.65.0 in a Docker container on Lubuntu)

castalla
2018-07-30, 05:45
I'd like to try this ... BUT despite reading the docs. I've still no idea where to start, nor what some of the variables actually refer to., eg. what's the duckdns url got to do with things - given it has to be modified with some HA link (unfathomable). At some point the docs state that all the files in the directory tree (which directory is this?) have to be uploaded.

Any chance of a more structured step-by-step set of install instructions?

itm
2018-07-30, 07:25
OK so I think I have this set up, and I see the LMS Music Player control on my HomeAssistant dashboard. Now I'm stumped for how to get my "Play..." commands to be sent to the LMS engine rather than Google Play Music. For example, if I say "Play song brown sugar by rolling stones" Google Assistant plays a live version of Brown Sugar using Google Play Music.

What voice commands do I need to use to connect with the LMS server?

greenkr
2019-01-21, 13:46
I have been successful in getting my goggle home working with IFTTT and my LMS system.
It functions quite well ... to the point where I've order the google home mini as just a remote control for LMS.

I am able to:
-control volume
-play/pause
-skip/previous
-select playlist
-shuffle playlist
- select artist
- add artist to playlist



I am trying to get this working, having recently got a Google Home Mini. Many thanks for the advice and for the spreadsheet. I have some of the commands working, eg play, pause, play album $. However I can't get play next to work, IFTTT returns "Unable to make web request. Your server returned a 401". Any idea why?