Thanks. LMS working via Alexa but your solution is more elegant. I transform the data into something that Alexa can digest. Looking at DialogFlow this is doing the same thing. Shame that it is not possible to get a dynamic link to the database as everytime more media is added the export to Alexa needs to be performed again - not that I add new media that often.
I would assume you could port the home assistant approach to Alexa fairly easily. The dialogflow project I created for Google home is actually quite small and simple but flexible enough to address most scenarios using simple variables like artists, song, playlist, album, source, mediaplayer name, etcâŚ
Doesnât Alexa have a similar product or approach to dialogflow?
Please note if you upgrade your Home Assistant installation to version 0.83.2 the use of api_password is no longer supported (as pointed out by Squeezebox user kalimeroo) and your webhooks and shell script authentication will need to change to use long-lived tokens.
I will provide an update on the methods in the GitHub https://github.com/ynot123/LMS_Controls over the next week or two. The change is not very complicated but will require an update in several locations including the shell scripts and DialogFlow webhooks.
Good news, the LMS Controls project (see here) has been updated to incorporate the new Home Assistant authentication system. This project now uses Long Lived Access Tokens to authenticate between Google DialogFlow and Home Assistant.
In addition, changes at Google and HA have required a different (proper) implementation of the webhooks method for the two applications.
I have been working on installing this and basics are working. I can control volume, syncing etc⌠for my 3 players.
But I am running into a few things for which I hope you can point me in the right direction (been working through the troubleshooting list on your Github):
In the UI (both lovelace and traditional) the play, pause and next buttons/controls are missing. In the Lovelace UI I see the error: âscripts.lms_cmd_pausâ (line is cut there) and next line âEntity not availableâ
I have checked the scripts.yaml and the lms_cmd_pause_player section is there. I see the same errors for the other 2.
The next step in the troubleshooting where I try to queue a song does not seem to work. It doesnât get added or starts playing. So there my inexperience with shell commands and Hassio starts. I managed to run the shell command and I get no results and the I get 401: Unauthorized. But I am not sure what is giving that 401, is that spotify?
Glad to hear your a good part of the way there. A quick check to ensure you are using the latest version of this project. I uploaded December 8th some significant changes that are important if youâre running the latest version of Home Assistant. If you didnât do this, my advice is to download it and follow the instructions again (sorry about the hassle but the security concepts have changed and needed to be updated).
Make sure your editing your files using either the HA configurator tool or if editing in Windows, use something like Notepad++ which wonât put additional formatting characters in your files which can cause issues compiling in HA.
For the missing UI controls, please review your entities (using HA GUI developer tools / states tool) and ensure the following entities are there:
script.lms_cmd_pause_player
script.lms_cmd_start_player
If they are not (which I suspect) check your scripts.yaml file to see if those scripts are present. (should be near the end). Also did you copy over the customize.yaml file which defines the icons for these entities.
To get a shell in Docker, log in to your host server using putty or some other tool and create a shell in the home Assistant docker container using the following command:
docker exec -it homeassistant bash
And yes it certainly works with Hassio / Docker installation. My setup is Debian server, running Hassio (0.83.3) in Docker, LMS server and Openmediavault (NAS) all on the same box.
Finally if you are still having difficulties making progress reply back to this email [email protected] and I will try to help and take a look at your setup a little closerâŚ
No problem. Be sure to get the latest copy when you decide to give it a shot. Itâs getting tough to keep up with the breaking changes these days in HA. Ynot.
Just worked the through the setup for a couple of hours ⌠and all working. Wow. Canât imagine the effort that went in to get this working. The level of integration is phenomenal.
Only a few minor issues for meâŚ
Didnât catch all the places to update my media server names in configuration.yaml (RTFM)
Didnât catch all the instances of âlms_ipaddressâ in the scripts (maybe change instructions to âReplace all instances ofâŚâ)
Some usual indenting issues merging snippets with existing files.
The other issue is thereâs no real guidance on the order of config. Having been through It now, it seems to me the HA element needs to be done firstâŚrestart to get the Diagflow integrationâŚhit configure to get the webhook for the subsequent Diagflow component - them move on to Diagflow.
Within Diagflow I also clicked âSee how it works in Google Assistantâ which allowed me to set the âDisplay Nameâ (on the âActions on Googleâ âInvocationâ page) to âMusic Serverâ. This allows me to ask google to âTalk to the Music Serverâ which seems more intuitive I think to the family who donât know/care that its LMS etc.
I see that throughout the media player entity names are used - particularly in responses. How practical would it be to change those to âFriendly Namesâ ? some of my entity names are particularly unfriendly.
Thanks for the feedback. Glad itâs working for you. It did take some doing but I was up for a challenge when they said it couldnât be done.
I do plan to try to make this easier to install in the near future. I will use HA package file which will take care of a lot of the merging of files and minor customizations on the HA side. The shell script files will also use an env.sh file to enter credentials, tokens, etc⌠only once for the shell scripts. Other new features will include additional feedback (audio) on query results, player status, etc⌠Also the installation documentation will be updated to suit including your feedback provided here.
As for the friendly name thing, the simplest thing I can think of is modify the DialogFlow Entity section the table for mediaplayer entities to include your desired âfriendly nameâ as a synonym for the unfriendly name player. This way you can say something like âPlay artist Supertramp on friendly name playerâ and it will resolve to the reference value which is unfriendly name. This wonât fix the HA GUI but will fix the voice controlled part. I will consider the use of friendly names for display purposes but likely the DF entities will still need to carry the âunfriendly nameâ as the reference values. Personally I tried to use reasonable naming everywhere in my LMS server players to make it clear to all.
The pic below shows my current entries, familyroom can also be called as the yogastudio.
wauw - great project. thank you for doing all the heavy lifting on this one.
I have been fooling around with this a couple of hours, completely new to home assistant, google home and dialogflow, have an excisting LMS installation and bought me some Google homes for syncing music and the likes.
I think i have the most of it running, i have testet that the bash scripts can interact with spotify, and the play / pause actoions in HA works. But i just cant get my head around whats necessary for getting dialogflow up and running so that i can interact with it from my google homes. i mean do i need to publish my âprojectâ? can anyone help me understand the requirements here? ideally i would like to get the english version up and running and then âportâ it to my native language (danish) i gather that would be possible without to much of a hassle?
I assume you already created a longlived access token as the shell scripts are wokring but if not that would be here: https://yourdomain.duckdns.org/profile
Once the Dialoflow is created you can test it using the try it now window in DF. Finally you can test it in Google Assistant by clicking on the See How it works in Google Assistant link in DF.
Once in Google Assistant you can assign an invocation and it will be available as a action in googleHome.
Thanks ynot
I have gone trough the dialog setup and i can test my âappâ - but i get voice response: This intent is not yet configured within Home Assistant. and i can then see that my homeassistant returns "Unknown intent lms_dailog_intent in the console / log. Intergration with homeassistant is done via Nabu Casa https://www.nabucasa.com.
I also cannot interact with my app with my custom invocation, but need to use the words âtalk to my test appâ so something is amiss with the google dialog flow also. sad when it feels like result is SO near
Intents are linked in the config with this line:
dialogflow:
intent_script: !include intent.yaml
i did enable the long lived accesstoken and both are input into the dialogflow, and the code snipplet i pasted from my config in the eairlier post was from my config, but still no luck, i must miss something, but request are delivered to my homeassistant i think, since i get an unknown intent in the homeassisant log?
I believe the issue is with either the webhook your using or the intent.yaml file is not loaded or the name of the intent is incorrect.
When setting up the integration you need to use the Dialogflow webhook component as shown in the attached pic. As far as I understand, nabucassa is not required. I specifically avoided it because itâs not free. So that being said, you need to invoke your command (once setup in google assistant) by saying something like: âhey google, ask lms controls (or whatever your invocation is) to play artist supertrampâ.
thank you for your feedback, it looks to me like iâve followed your instructions to the letter, i have tried to move the intents from an included file into the configuration.yaml file but still no luck, the intent is called via the webhook, but the homeassistant server does not recognise it, iâm at a loss, but will continue to fiddle around. it must be some where in the basic setup, because this i completey new for me, so i must have set something up wrongly.