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 Logitech Media Server 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 Spotify (compound queries are supported âPlay album Dog and Butterfly by Heart in the kitchen with shuffle onâ)
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.
LMS Controls Project Updated - January 18, 2019
New features / upgrades include:
Use of a package file which contains the bulk of the code
Audio feedback of query results and player status
Created an env.sh file which contains the bulk of the shell file customization details (much less editing this way :))
Better error checking on query results
Support of contractions (itâs, donât) and
The ability to handle both secured and unsecured LMS installations.
Updated installation and troubleshooting documents
Just a quick heads up to anyone updating their Home Assistant configuration to version 0.86 (released 23 January 2019). Changes to the Automation Trigger means that interval triggers are now separated from the âtimeâ platform and moved to a new âtime_patternâ platform:
This necessitates a very simple change to LMS Controls. Open the file lmscontrols.yaml in the /packages/ subfolder, and in the automation section, change platform: time to platform: time_pattern . This will ensure that the âLMS GUI Update Player Valuesâ trigger passes the configuration check. Thanks, Ynot.
The GitHub distribution has been updated with a few additional features including:
All intents can now be called implicitly âHey google, ask LMS Controls to play artist Pink Floyd in the kitchen with shuffle onâ
When an implicit intent is called, LMS Controls app stays active for an additional 10 seconds allowing the user to issue supplementary direct commands âSet volume to 40â, âSet shuffle onâ, âAdd album Crime of the Century by Supertrampâ, with having to invoke the âHey google, ask LMS Controls toâ
Streamlined the DF dialog requirements (more music less talk)
Syncing of squeezebox players can now be done using the HA GUI
A quick FYI with regards to the Voice Control of LMS players from GoogleHome using Home Automation software as the middle man.
I will be doing a minor update over the next couple of weeks which will include:
Cleaning up / stream lining the DF API upgrades from API V1 to V2, refining of entities to reduce configuration requirements and provide more flexible naming conventions, modifications to allow sync of all defined players
Update the HA GUI to include up to 10 sync players
Update of Spotify shell scripts to improve accuracy of query results
If you have any thoughts or ides on how to improve this tool, please feel free to email me the ideas for consideration. These can include DF functionality, HA GUI / script additions, or any other features you think might be useful for this application. [email protected]
Thanks for sharing this!! I just recently discovered LMS and this seems like the perfect way to integrate it with Google Assistant and Home Assistant. I have most of the integration working at this point, but I canât get LMS playlists to trigger from HA or Google Assistant. I believe the cause of the issue is the HA scripts arenât calling the playlists from the correct location.
On my LMS server, the playlist folder is pointed to /vol1/media/playlists/. From HA Iâm able to play LMS playlists directly on a squeezebox device using the following script:
If the playlist is available from the LMS webGUI (in the playlist section) it should be playable directly using the voice command method using the source LMS. For Spotify, obviously it uses Spotify playlists. Setting it up this way avoids the pitfalls of paths, file naming conventions, etcâŚ
That being said, I suppose you could modify the script call outlined above to include a full path and playlist file extension directly.
might work. You just have to ensure the path and file extension is added to the states value properly. My suggestion however is to use and define your playlists in the GUI so they are easily accessible. That has the added advantage of being able to see what playlists you have using the LMS web GUI and the playlist stored in the LMS DB. Handy when defining the radio stations as playlists as well if you are using that function.
Good stuff. let me know how it works with the translation. If itâs easy enough, perhaps I can incorporate it into the original dialogflow using the language feature.
I have had some problems installing this on my system. I have my Home Assistant installed via Docker on a Synology NAS. Synology does not out of the box support Netcat (NC).The bash scripts uses NC. I had to install Synogear: https://github.com/SynoCommunity/spksrc/wiki/FAQ-synogear to get is workin with ncat. All the NC commands needs to be replaced by ncat in the scripts.
This is indeed a much cleaner solution. Ncat works fine on Synology.
I am trying to find a solution to get Tidal working with LMS Controls. I like to listen to music in lossless quality and therefore prefere Tidal over Spotify. I have tried to find a solution to do the searches on Tidal directly through url commands. I have not been able to do this however some developers have made an unofficial Tidal api wrapper:
To make the symbolic link to nc you need to type the following command via ssh on Synology: ln -s /var/packages/DiagnosisTool/target/usr/bin/ncat /usr/bin/nc
(First you need to install synogear: sudo synogear install)
Sorry, Iâm afraid I donât have an account for that service and likely wonât have the time to look at it in the near future.
As Tidal is supported in Logitech Media Server, you should be able to accomplish this fairly easily. The key is understanding the method to query Tidal to return the results you want using your credentials as required. Simple modifications of the scripts should be able to get you there.
Let me know how it goes or get in touch with me again early Winter when I will have a bit more time for this.