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.
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
- Created Hass.io / Home Assistant installation document for multiple platforms to help users new to Hass.io / Home Assistant.
LMS Controls Project Updated - January 24, 2019
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.