Discussion:
[SlimDevices: Plugins] Announce: LMS Controls - Google Home / Google Assistant Voice Control of LMS Players
ynot1234567890
2018-07-26 12:12:41 UTC
Permalink
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 Player services. An audio demo is
also available there.

The project 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 (ie: "Play album Breakfast in
America by Supertramp in the Kitchen with Shuffle on")
- Play queried items on selected player
- Add queried items to select player's playlist
- Set music source (local LMS database or Spotify (using spotty)
- Set selected default player (can be changed on the fly)
- 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
(checkout the REAME.md files).

The prerequisites for this are:

- Logitech Media Server (obviously :))
- Home Assistant (HASSIO) - open source home automation package (can
be run on a PI or even on your LMS server)
- Google Home (or google assistant for android or Iphone devices)
- 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. Been using it for sometime now and find it
"cute" and convenient for simple listening and I especially enjoy the
sleep timer feature.

Ynot


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
jollybully
2018-07-31 12:29:16 UTC
Permalink
This looks brilliant! Can't wait to get some time to sit down and set
this all up

Sent from my Nexus 6 using Tapatalk




------------------------------------------------------------------------
jollybully's Profile: http://forums.slimdevices.com/member.php?userid=64450
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-02 21:05:37 UTC
Permalink
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
- More responsive GUI


Enjoy. Ynot.


ynot1234567890 wrote:
> 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 Player services. An audio demo is
> also available there.
>
> The project 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 (ie: "Play album Breakfast in
> America by Supertramp in the Kitchen with Shuffle on")
- Play queried items on selected player
- Add queried items to select player's playlist
- Set music source (local LMS database or Spotify (using spotty)
- Set selected default player (can be changed on the fly)
- 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
> (checkout the REAME.md files).
>
> The prerequisites for this are:
> > > >
- Logitech Media Server (obviously :))
- Home Assistant (HASSIO) - open source home automation package (can
> be run on a PI or even on your LMS server)
- Google Home (or google assistant for android or Iphone devices)
- 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. Been using it for sometime now and find it
> "cute" and convenient for simple listening and I especially enjoy the
> sleep timer feature.
>
> Ynot


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
rgdawson
2018-08-04 00:18:51 UTC
Permalink
This looks awesome! I can't wait to try it out. Recently received a
Google Home device as a gift and getting something like this for LMS has
been on my list. I have an extra R-Pi, so I should be able to get this
going. Recently ordered a Samsung SmartThings Hub in order to integrate
it with Google Home to turn on/off my equipment, i.e. "Hey Google, turn
on Squeezebox in the Backyard", which would turn on the receiver's
backyard zone. Now with this I should be able to tell LMS what to do.
Thanks!

R Greg Dawson



Squeezelite-X
------------------------------------------------------------------------
rgdawson's Profile: http://forums.slimdevices.com/member.php?userid=65236
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-04 00:40:27 UTC
Permalink
rgdawson wrote:
> This looks awesome! I can't wait to try it out. Recently received a
> Google Home device as a gift and getting something like this for LMS has
> been on my list. I have an extra R-Pi, so I should be able to get this
> going. Recently ordered a Samsung SmartThings Hub in order to integrate
> it with Google Home to turn on/off my equipment, i.e. "Hey Google, turn
> on Squeezebox in the Backyard", which would turn on the receiver's
> backyard zone. Now with this I should be able to tell LMS what to do.
> Thanks!
>
> R Greg Dawson

You're welcome. Give it a try, it's really quite flexible once it's
setup. The Home Assistant component is also very cool, adds a lot of
possibilities for google and home automation side. As an example, I
monitor the PI squeeze player in my garage and when it goes live (starts
playing), my old analog stereo turns on automatically via a wifi plug.
I also use things like dimmers, switches, etc.

Also a quick "Hey Google, Mommy's in the mood", and the lights dim, the
stereo turns on and Barry White starts playing. Hasn't been successful
yet but the automation part works. Haha. Ynot


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-05 15:24:36 UTC
Permalink
ynot1234567890 wrote:
> 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
- More responsive GUI
> > >
>
> Enjoy. Ynot.

Aug 5, 2018 - Updated Dialogflow and scripts to allow sync / unsync of
players via voice command as well. Ynot.


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
Mark Miksis
2018-08-05 16:58:59 UTC
Permalink
I can't wait to try this! Hopefully sometime in the next few days.
Thanks for contributing!


------------------------------------------------------------------------
Mark Miksis's Profile: http://forums.slimdevices.com/member.php?userid=529
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
rgdawson
2018-08-07 02:34:14 UTC
Permalink
So I am working on this...
Step 1: I set up a R-Pi with Home Assistant according to the online
instructions, including installing the Configurator plugin.
Step 2: Modify and merge HomeAssistant config files. I got to the
part that says:

- **_shell_** sub-directory:
- For the files: qry_alb.sh, qry_alb_song.sh the following
modifications are required:
- Replace `localhost 9090` with `your path to LMS CLI interface &
Port#`
- Update
`https://HA_Link.duckdns.org/api/states/sensor.art_ID?api_password=HA_API_Password`
with you're `HA_Link` (accessible from the internet) and you're
`HA_API_Password`


Question 1: By "your path to LMS CLI interface & port#", do you mean the
host name of my LMS server, as in MYSERVER 9090? or do you mean
http://myserver 9000?
Question 2: What is HA_Link and HA_API_Password? I apologize if this
should be obvious, this is my first experience with Home Assistant.

Thanks for the help.


R Greg Dawson



Squeezelite-X
------------------------------------------------------------------------
rgdawson's Profile: http://forums.slimdevices.com/member.php?userid=65236
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-07 11:38:39 UTC
Permalink
rgdawson wrote:
> So I am working on this...
> Step 1: I set up a R-Pi with Home Assistant according to the online
> instructions, including installing the Configurator plugin.
> Step 2: Modify and merge HomeAssistant config files. I got to the
> part that says:
>
> - **_shell_** sub-directory:
> - For the files: qry_alb.sh, qry_alb_song.sh the following
> modifications are required:
> - Replace `localhost 9090` with `your path to LMS CLI interface &
> Port#`
> - Update
> `https://HA_Link.duckdns.org/api/states/sensor.art_ID?api_password=HA_API_Password`
> with you're `HA_Link` (accessible from the internet) and you're
> `HA_API_Password`
>
>
> Question 1: By "your path to LMS CLI interface & port#", do you mean the
> host name of my LMS server, as in MYSERVER 9090? or do you mean
> http://myserver 9000?
> Question 2: What is HA_Link and HA_API_Password? I apologize if this
> should be obvious, this is my first experience with Home Assistant.
>
> Thanks for the help.
>
>
> R Greg Dawson

Hi,

1. Yes the hostname (or the ip address) of your server and the CLI port
number which unless you changed something should be 9090.

2a. For the system to work it needs to be reachable from the internet.
Most HASSIO users use a free service called duckdns.org to keep track of
their ip and route the internet requests to the hassio service. So
first you need to have this service available and installed, I suggest
the using the DUCKDNS form the ADD_ON store in your HASSIO config. Once
you can access HASSIO from the internet, HA_Link is the name of your
server without the domain part. As an example, my server may be reached
by typing *https://helloworld.duckdns.org* my HA_Link value would then
be *helloworld*.

2b. HA_API_Password is the password you created (or should have created)
to access HASSIO. This can usually be found in your configuration.yaml
file under the http: heading.

The key before you go too far is first to ensure HASSIO is working on
its own and is accessible from the internet. Until this works, you're
dead in the water as far as voice commands, etc due to cloud service
requirements. On the Github there is also a troubleshooting document
'*https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md*'
(https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md)
to help during your setup.

I appreciate any feedback on lack of instructions, clarification
requirements, etc.. Most users to date already had working versions of
HASSIO installed so less setup was required. Also, I may be offline for
a few days (fishing) but will get back to any requests / questions upon
my return.

Cheers, Ynot.


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
castalla
2018-08-07 12:39:14 UTC
Permalink
ynot1234567890 wrote:
> Hi,
>
> 1. Yes the hostname (myserver) in your case. The http:// part is not
> required. It could even be the ip address if you prefer. The CLI port
> number which unless you changed something should be 9090. It's a
> different port than the web interface port 9000. The Command Line
> Interface Port (CLI) that responds to requests is set to 9090 by
> default. You can confirm this by choosing settings, advanced and
> selecting command line interface on the LMS web app. It will show you
> the CLI port number for your installation.
>
> 2a. For the system to work it needs to be reachable from the internet.
> Most HASSIO users use a free service called duckdns.org to keep track of
> their ip and route the internet requests to the hassio service. So
> first you need to have this service available and installed, I suggest
> the using the DUCKDNS form the ADD_ON store in your HASSIO config. Once
> you can access HASSIO from the internet, HA_Link is the name of your
> server without the domain part. As an example, my server may be reached
> by typing *https://helloworld.duckdns.org* my HA_Link value would then
> be *helloworld*.
>
> 2b. HA_API_Password is the password you created (or should have created)
> to access HASSIO. This can usually be found in your configuration.yaml
> file under the http: heading.
>
> The key before you go too far is first to ensure HASSIO is working on
> its own and is accessible from the internet. Until this works, you're
> dead in the water as far as voice commands, etc due to cloud service
> requirements. On the Github there is also a troubleshooting document
> '*https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md*'
> (https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md)
> to help during your setup.
>
> I appreciate any feedback on lack of instructions, clarification
> requirements, etc.. Most users to date already had working versions of
> HASSIO installed so less setup was required. Also, I may be offline for
> a few days (fishing) but will get back to any requests / questions upon
> my return.
>
> Cheers, Ynot.

Am I correct in assuming that duckdns requires open ports on the router?



LMS server: Pi Zero

Amp: Denon PMA-50

Players/Speakers: Touch, Logitech Radios, Sonos, Libratone Zipp, GGMM
O2 & O3, Yamaha WXAD-010, Loewe Airspeaker, Google Home Mini, Pioneer
WX-SMA1, O2 Joggler, Cisco Joggler


------------------------------------------------------------------------------------
------------------------------------------------------------------------
castalla's Profile: http://forums.slimdevices.com/member.php?userid=15624
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
rgdawson
2018-08-07 12:47:45 UTC
Permalink
ynot1234567890 wrote:
> Hi,
>
> 1. Yes the hostname (myserver) in your case. The http:// part is not
> required. It could even be the ip address if you prefer. The CLI port
> number which unless you changed something should be 9090. It's a
> different port than the web interface port 9000. The Command Line
> Interface Port (CLI) that responds to requests is set to 9090 by
> default. You can confirm this by choosing settings, advanced and
> selecting command line interface on the LMS web app. It will show you
> the CLI port number for your installation.
>
> 2a. For the system to work it needs to be reachable from the internet.
> Most HASSIO users use a free service called duckdns.org to keep track of
> their ip and route the internet requests to the hassio service. So
> first you need to have this service available and installed, I suggest
> the using the DUCKDNS form the ADD_ON store in your HASSIO config. Once
> you can access HASSIO from the internet, HA_Link is the name of your
> server without the domain part. As an example, my server may be reached
> by typing *https://helloworld.duckdns.org* my HA_Link value would then
> be *helloworld*.
>
> 2b. HA_API_Password is the password you created (or should have created)
> to access HASSIO. This can usually be found in your configuration.yaml
> file under the http: heading.
>
> The key before you go too far is first to ensure HASSIO is working on
> its own and is accessible from the internet. Until this works, you're
> dead in the water as far as voice commands, etc due to cloud service
> requirements. On the Github there is also a troubleshooting document
> '*https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md*'
> (https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md)
> to help during your setup.
>
> I appreciate any feedback on lack of instructions, clarification
> requirements, etc.. Most users to date already had working versions of
> HASSIO installed so less setup was required. Also, I may be offline for
> a few days (fishing) but will get back to any requests / questions upon
> my return.
>
> Cheers, Ynot.

1. I figured you meant hostname/ip but the term "path" confused me.
Probably better to use the term "hostname".

2a. That is sorta what I was expecting you to say. I already have a
dynamic dns service I use to make my home server accessible from the
internet. Since the home server is getting the standard http and https
ports forwarded to it, I guess I'll need to use a non-standard port id
for Home Assistant API. So I'll have something like
https://rgdawson.homeserver.com:9443/api/states/sensor.art_ID?api_password=HA_API_Password.
And I'll set my router up to forward port 9443 to the Home Assistant
R-Pi. I think I need to configure the Home Assistant API to use a
different port somewhere.

R Greg Dawson



Squeezelite-X
------------------------------------------------------------------------
rgdawson's Profile: http://forums.slimdevices.com/member.php?userid=65236
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-10 17:21:41 UTC
Permalink
rgdawson wrote:
> 1. I figured you meant hostname/ip but the term "path" confused me.
> Probably better to use the term "hostname".
>
> 2a. That is sorta what I was expecting you to say. I already have a
> dynamic dns service I use to make my home server accessible from the
> internet. Since the home server is getting the standard http and https
> ports forwarded to it, I guess I'll need to use a non-standard port id
> for Home Assistant API. So I'll have something like
> "https://rgdawson.homeserver.com:9443/api/states/sensor.art_ID?api_password=HA_API_Password".
> And I'll set my router up to forward port 9443 to the Home Assistant
> R-Pi. I think I need to configure the Home Assistant API to use a
> different port somewhere.
>
> R Greg Dawson

1. I will clean up the documentation to reflect hostname.
2. Alternate ports should work as well, the shell scripts and
configuration.yaml files will need to be updated to reflect this fact.
3. I find the easiest way is to ensure the HA instance is working
properly first over the internet using https: links before tackling the
LMS and Dialogflow portions. There is a fair bit of documentation
available in securing HA and the use of SSL and alternate ports.


Ynot


------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-08-16 22:21:06 UTC
Permalink
Hello All,

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. ***@vianet.ca

Thanks in advance, Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
CypherMK
2018-09-20 14:36:49 UTC
Permalink
Cool project. I will try this once I got the time.


------------------------------------------------------------------------
CypherMK's Profile: http://forums.slimdevices.com/member.php?userid=62798
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
courtjestr
2018-10-16 01:51:07 UTC
Permalink
I am so close. I say "ask lms to pause livingroom" and google home
pauses the lms but talks about the "getting the test version of lms".
How do I get rid of the test version prompt?


------------------------------------------------------------------------
courtjestr's Profile: http://forums.slimdevices.com/member.php?userid=68565
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
servies
2018-10-16 13:10:32 UTC
Permalink
I'm a little bit confused regarding the spotify account
The documentation on github mentions this:
> If this is music query function:
> Performs required queries against either LMS DB or Spotify using shell
> scripts
This suggests that I only need a Spotify account if I want to search for
music on Spotify, the query processing is done by DF...
But in the prerequisites in the first post here you write:
> The prerequisites for this are:
> ...
> Spotify account with Client_ID and Client_Secret to allow query
> processing
That would suggest that the query is somehow done by Spotify...

Can I use this without a Spotify account as all the music I have/need is
on my own LMS...



There are 10 kinds of people in the world - those who understand binary
and those who don't.
------------------------------------------------------------------------
servies's Profile: http://forums.slimdevices.com/member.php?userid=9496
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-16 20:49:52 UTC
Permalink
servies wrote:
> I'm a little bit confused regarding the spotify account
> The documentation on github mentions this:
>
> This suggests that I only need a Spotify account if I want to search for
> music on Spotify, the query processing is done by DF...
> But in the prerequisites in the first post here you write:
>
> That would suggest that the query is somehow done by Spotify...
>
> Can I use this without a Spotify account as all the music I have/need is
> on my own LMS...

Yes you can. Your music source will simply be limited to LMS. Set
music source to LMS and your queries will be directed against the LMS
database.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
bitterroots
2018-10-23 02:22:41 UTC
Permalink
I am making headway. But I can't get the "query" feature to work. Here
is where I am stuck. I get this error from my LMS server log.
Slim::Web::JSONRPC::requestMethod (425) Request failed with error: Bad
dispatch!
Slim::Control::Request::execute (1888) Error: While trying to run
function coderef [Slim::Control::Commands::playlistcontrolCommand]:
[Can't call method "title" on an undefined value at
/usr/local/share/logitechmediaserver/Slim/Control/Commands.pm line 2021.
It seems that the command is getting executed, but the "variable"
component is missing. Does port 9090 need to be forwarded?


------------------------------------------------------------------------
bitterroots's Profile: http://forums.slimdevices.com/member.php?userid=67665
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-23 10:10:44 UTC
Permalink
bitterroots wrote:
> I am making headway. But I can't get the "query" feature to work. Here
> is where I am stuck. I get this error from my LMS server log.
> Slim::Web::JSONRPC::requestMethod (425) Request failed with error: Bad
> dispatch!
> Slim::Control::Request::execute (1888) Error: While trying to run
> function coderef [Slim::Control::Commands::playlistcontrolCommand]:
> [Can't call method "title" on an undefined value at
> /usr/local/share/logitechmediaserver/Slim/Control/Commands.pm line 2021.
> It seems that the command is getting executed, but the "variable"
> component is missing. Does port 9090 need to be forwarded?

Not sure off hand, but the easiest way I know to troubleshoot is
outlined in the troubleshooting guide on the Github.
https://github.com/ynot123/LMS_Controls/blob/master/troubleshooting.md
Refer to the section about running the query commands in a shell from
your HASSIO installation.

Yes you definitely need to have access to port 9090 on LMS from your
HASSIO installation to make this work. I assume you have modified the
shell scripts properly to suit your installation?

Running the query functions in a shell as outlined in the
troubleshooting.md file provides simple feedback on what's being
returned from LMS. This should provide some insight into what's
happening. Unless your default LMS install is highly customized, it
should pretty much just work.

If you can't figure it out from there, feel free to send me a copy of
one of your query scripts and I can take a peek. Include what systems
and versions you're running.

Thanks, Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-16 20:47:02 UTC
Permalink
courtjestr wrote:
> I am so close. I say "ask lms to pause livingroom" and google home
> pauses the lms but talks about the "getting the test version of lms".
> How do I get rid of the test version prompt?

Glad to hear its working for you. Doesn't seem to much interest in it
lately.

Getting rid of the test prompt is a bit painful. Check this thread, I
did it, it works but takes a bit of doing. Essentially (if memory
serves), the developer account always get the test message (unless its
been changed recently). First you need to publish your app to alpha,
create a reviewer account and issue the request using the reviewer
account and you should be good.

A link here details it:
https://productforums.google.com/forum/#!msg/dialogflow/_iuwgWyyWd8/gM6h1mLsAwAJ

ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-24 12:03:29 UTC
Permalink
bitterroots wrote:
> Here is my output from qry_alb.sh:
> Artists are:
> artists 0 20 search%3A_supertramp tags%3Aa
>
> Album found so moving on to songs....
> qry_alb_song.sh: line 115: printf: `B': invalid format character
>
> But it hangs and does not finish.
> Where do I enter username/password for CLI interface port 9090? I think
> that is my issue.

You are quite right, didn't realize you were using secure system (mine
is open and only exposed to local network).

So that being said, reviewing the LMS CLI documentation (On your LMS:
http://localhost:9000/html/docs/cli-api.html (replace "localhost" with
your server's address), you need to issue the login request upon
initial connection before submitting any requests. The command is in
the form of "login username correctpassword" to open, proceed with your
queries and you can then close the connection (not sure is you really
need to) using "login username wrongpassword".

Basically modify each shell script that queries the LMS server to
include the login and give it a try. You can always issue the commands
by typing them in manually as well to ensure proper syntax.

If you make this work, I would appreciate a copy of one of the shell
scripts and I will include this as an optional format on the GitHub
project for other users. If you can't make it work, let me know and
I'll see if I can make some time to test on my install over the next
week or two.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-24 23:52:57 UTC
Permalink
bitterroots wrote:
> I was thinking along those lines. Doesn't LMS port 9000 need to be open
> for Home Assistant to access it? Also, any idea on the other errors in
> the script? Or is it anything to be concerned about. I will let you know
> what I find out.

Port 9000 is not used in the scripting. Only the CLI port which by
default is 9090. As ofr the rest of the erros, they may clear up after
you fix the login thing.

Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
bitterroots
2018-10-25 23:47:05 UTC
Permalink
ynot1234567890 wrote:
> Port 9000 is not used in the scripting. Only the CLI port which by
> default is 9090. As for the rest of the errors, they may clear up after
> you fix the login thing.
>
> Ynot

I have not been able to get the query to work without authentication.
Removing the password protection allows it to work. I think that the
main issue with the password is that it only works in a telnet session.
There does not seem to be a log in/log out. I am currently using HTML
webhooks through IFTTT. The usage is
http://USERNAME:***@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id:0.5<lf>&player=XX:XX:XX:XX:XX:XX.
But you have to issue it each time. If I use this: | nc 192.168.1.X |
\login USERNAME password ) I get a password prompt when I run the
script. But it will not take the typed password.


------------------------------------------------------------------------
bitterroots's Profile: http://forums.slimdevices.com/member.php?userid=67665
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-25 23:54:17 UTC
Permalink
bitterroots wrote:
> I have not been able to get the query to work without authentication.
> Removing the password protection allows it to work. I think that the
> main issue with the password is that it only works in a telnet session.
> There does not seem to be a log in/log out. I am currently using HTML
> webhooks through IFTTT. The usage is
> http://USERNAME:***@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id:0.5<lf>&player=XX:XX:XX:XX:XX:XX.
> But you have to issue it each time. If I use this: | nc 192.168.1.X |
> \login USERNAME password ) I get a password prompt when I run the
> script. But it will not take the typed password.

Well, glad to see it worked without authentication. I will take a look
at it when I get a chance to see if I can make it work. Will have to
play with my setup a bit to try it out.

Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-26 00:10:47 UTC
Permalink
bitterroots wrote:
> I have not been able to get the query to work without authentication.
> Removing the password protection allows it to work. I think that the
> main issue with the password is that it only works in a telnet session.
> There does not seem to be a log in/log out. I am currently using HTML
> webhooks through IFTTT. The usage is
> http://USERNAME:***@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id:0.5<lf>&player=XX:XX:XX:XX:XX:XX.
> But you have to issue it each time. If I use this: | nc 192.168.1.X |
> \login USERNAME password ) I get a password prompt when I run the
> script. But it will not take the typed password.

Looking at the way the shell scripts are written, it opens and closes
the connection each time it asks for something from the LMS CLI
interface. In order to make the login thing work, I believe you would
need to issue two lines at each call, the first for login, the second
being the request.

As an example:

query=$(printf "artists 0 20 search:$1 tags:a \nexit\n" | nc localhost
9090 )

becomes

query=$(printf "login username password\nartists 0 20 search:$1 tags:a
\nexit\n" | nc localhost 9090 )

Give something like that a shot and let me know. Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-26 22:08:38 UTC
Permalink
bitterroots wrote:
> I have not been able to get the query to work without authentication.
> Removing the password protection allows it to work. I think that the
> main issue with the password is that it only works in a telnet session.
> There does not seem to be a log in/log out. I am currently using HTML
> webhooks through IFTTT. The usage is
> http://USERNAME:***@HA_Link.duckdns.org:9000/anyurl?p0=radiotime&p1=playlist&p2=play&p3=item_id:0.5<lf>&player=XX:XX:XX:XX:XX:XX.
> But you have to issue it each time. If I use this: | nc 192.168.1.X |
> \login USERNAME password ) I get a password prompt when I run the
> script. But it will not take the typed password.

I have updated the shell LMS query scripts on the GITHUB to allow for
username and password on LMS installations.

- The script *qry_alb_sec.sh* should be renamed to replace the
existing script *qry_alb.sh*. Remember to update the username,
password, ip address, HA_link and HA_API_Password.
- The script *qry_alb_song_sec.sh* should be renamed to replace the
existing script *qry_alb_song.sh*. Remember to update the username,
password, ip address, HA_link and HA_API_Password.

Give that a go, seems to work for me here. Ynot.

The change log for those interested is:

- Added an extra line "login username password" to the CLI query to
authenticate before executing the query
- Replaced *nc* command with *socat* for additional flexibility and to
allow the connection to stay open to process multiple commands.

Typical query statement would be:
Code:
--------------------
query=$(printf "login username password\nartists 0 20 search:$1 tags:a \n" | socat stdio tcp:192.168.0.XX:9090,shut-none )
--------------------



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-10-28 23:16:42 UTC
Permalink
bitterroots wrote:
> Success!! Thank you. On another note, any chance that you could add
> playing Favorites and Random Mixes (song, album, artist)?
>

Glad it worked out. As for the Favorite and Random mix, I've never
really made use of those features in LMS, I use a similar feature with
Spotify via LMS.

I will consider the implementation of these LMS features in my Winter
upgrade (should have some free time). There are a few other items on
the to do list as well.

Stay Tuned. Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
holst1966
2018-11-11 06:31:30 UTC
Permalink
Hi
Wow, just found your application and realize that this would be a great
function to get implemented on my LMS setup that consists of 4 players,
however im new to HASSIO and not sure how this should be done.
The lack of interest from the community lately might be due to the level
of implementation, at least in my eyes this is a bit complicated.
Also, its actually just now that this can be an option for us in Sweden
as we now finally got the google assistant available in stores and also
working with Swedish language, dont know if we must change anything in
your configuration to get this to work with other languages.

I have installed HASSIO on a PI and i can run it from outside over
Duckdns and I understand what to do in the "configuration.yaml"-file but
i dont understand where to put the shell files, if this is explained in
your instructions then i have missed it completely.

Thanks for your effort, I would love to make this work.


------------------------------------------------------------------------
holst1966's Profile: http://forums.slimdevices.com/member.php?userid=62553
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-13 00:09:25 UTC
Permalink
holst1966 wrote:
> Hi
> Wow, just found your application and realize that this would be a great
> function to get implemented on my LMS setup that consists of 4 players,
> however im new to HASSIO and not sure how this should be done.
> The lack of interest from the community lately might be due to the level
> of implementation, at least in my eyes this is a bit complicated.
> Also, its actually just now that this can be an option for us in Sweden
> as we now finally got the google assistant available in stores and also
> working with Swedish language, dont know if we must change anything in
> your configuration to get this to work with other languages.
>
> I have installed HASSIO on a PI and i can run it from outside over
> Duckdns and I understand what to do in the "configuration.yaml"-file but
> i don't understand where to put the shell files, if this is explained in
> your instructions then i have missed it completely.
>
> Thanks for your effort, I would love to make this work.

Hi, I will try to address your items one at a time here. So here goes:


- Yes it's a bit complicated to setup, but is quite flexible in what
it can do. I still use it all the time for simple music requests. An
alternate method would be to use IFTT with Google HOME but I believe
LMS installation would then have to be exposed to the internet (not
very secure). IFTT approach is not as flexible as the DialogFlow
approach.
- Didn't know Google Home wasn't available in Sweden until just
recently. Not sure how well it functions in Swedish but in English,
the AI speech interpreter is excellent and easily picks up the request
including (usually) proper spelling of artists names, etc..
- Not sure if Google DialogFlow language change is easily done, one
fellow here used Italian but was having some trouble making it work I
believe. You can certainly re-create the intent in Swedish and
proceed that way, automatic language conversion, not so sure.
- As for how to install the files, in the GITHUB project under the
https://github.com/ynot123/LMS_Controls/tree/master/HomeAssistant/config,
all these files need to be modified to suit your application
environment. There is a README.md file in that directory that goes
through the required changes. You create a sub directory under config
directory called shell and this is where the shell files reside.
- If you carefully follow the instructions, you should be able to
make it work, several others have with little assistance. Bear in
mind, the following things need to be completed and functioning to
make the full install work: LMS server, Home Assistant (HASSIO),
Google Home (or assistant), DialogFlow.


If I might add a bit, while the solution is a bit convoluted, the
addition of Home Assistant allows you to create a fully operational home
automation system controlling lights, heat, cameras, alarm systems,
sprinklers, weather forecasting, who's home. With it you can create all
kinds of automation scripts to trigger based on time of day, location of
people, mood, weather, activity, etc.. There is significant power and
flexibility there. This is why I chose it to control and automate the
LMS Server. Home Assistant also functions very well on a phone and the
interface to LMS server works pretty well even without Google Home or
Assistant.

Just my 2 cents, there is more than one way to "skin the cat", but this
method seems to work pretty well for me at least and was a great
learning experience.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
didjean
2018-11-14 18:20:05 UTC
Permalink
Wow, discovering this thread. Thanks for your great work. I really need
to test this as soon as I find some time.

To be honest, voice control via Google Home or Alexa is definitely
something missing from my Squeezebox experience. This, the LMS web
interface and integration with some of the online services show that our
beloved Squeezebox setup is getting a tiny bit behind other proposals.
But I am still in love with it.

Do you think that your approach could be integrated as a plugin to the
Max2Play experience so it would be easy to make it work ?



Transporter + Cambridge Audio 651R + Q Acoustics Concept 40 --- Touch +
Onkyo TX-SR309 + Morel Applause MKII --- SB2, SB3, Duet, 2 Boom, 7
Radios --- Ipeng --- LMS 7.9.2 - 1537430919 / Max2Play --- Qobuz
------------------------------------------------------------------------
didjean's Profile: http://forums.slimdevices.com/member.php?userid=2900
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-15 00:02:42 UTC
Permalink
didjean wrote:
> Wow, discovering this thread. Thanks for your great work. I really need
> to test this as soon as I find some time.
>
> To be honest, voice control via Google Home or Alexa is definitely
> something missing from my Squeezebox experience. This, the LMS web
> interface and integration with some of the online services show that our
> beloved Squeezebox setup is getting a tiny bit behind other proposals.
> But I am still in love with it.
>
> Do you think that your approach could be integrated as a plugin to the
> Max2Play experience so it would be easy to make it work ?

Haven't used Max2Play environment so I hesitate to comment on that one.
Not sure that a PI can handle all the tasks of LMS server, Home
Assistant and LMS player in one go. That being said, you could
certainly have an image created to do just that. As for the dialogflow
part, that would still be required to be done as it is a cloud based
app.

Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-11-21 15:12:18 UTC
Permalink
Great job you did ynot !

I was looking for such a solution as I own a google home mini and an rpi
based audio system. I will thus try and proceed with the setup
described...which can take a bit of time as I am completely new to
homass.io and Dialogflow.

Thanks


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-11-21 16:14:59 UTC
Permalink
Really great job you did !

Also I am a complete beginner with Hass.io and DialgFlow I will try and
reproduce your setup with all the informations/files you kindly
provided.

I have one rpi, a google home mini and a squeezebox touch. I would thus
need a second rpi in order ro run LMS server or maybe there is a way to
define the mysqueezebox.com account in place of the local server in
DialogFlow webhook ?

Thanks for your work and sharing it.

Kali


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-21 22:31:04 UTC
Permalink
kalimeroo wrote:
> Really great job you did !
>
> Also I am a complete beginner with Hass.io and DialgFlow I will try and
> reproduce your setup with all the informations/files you kindly
> provided.
>
> I have one rpi, a google home mini and a squeezebox touch. I would thus
> need a second rpi in order ro run LMS server or maybe there is a way to
> define the mysqueezebox.com account in place of the local server in
> DialogFlow webhook ?
>
> Thanks for your work and sharing it.
>
> Kali

That would be best, you could run LMS and HASSIO on the same pi I
suppose but you may find performance lacking.

Otherwise an old desktop PC is what I use running:

- Debian server (no X-windows)
- LMS Server
- HASSIO using docker (or not)
- My particular setup also uses Openmediavault as a NAS and bit torrent
client

In my opinion, this is usually a better performing setup and access to
old PC desktop is usually simple (cheap) enough. In addition, this
setup allows you to add other linux functionality and add ons to the
mix.

Just my 2 cents. Good luck, Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-11-22 10:16:48 UTC
Permalink
Thanks for your suggestion. I currently have a rpi with Digiamp hat
running picoreplayer and LMS server.
In the future (when I move home) I will go for a NAS running both LMS
and Hassio in containers (or an old PC running this).
I will go for two rpi at the moment (one for Homass and the other for
LMS/squeezeplayer).

I will try and document all the processes in details and then make it
public (if I succeed ;)) and if you agree of course.

Thx


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-22 11:55:21 UTC
Permalink
kalimeroo wrote:
> Thanks for your suggestion. I currently have a rpi with Digiamp hat
> running picoreplayer and LMS server.
> In the future (when I move home) I will go for a NAS running both LMS
> and Hassio in containers (or an old PC running this).
> I will go for two rpi at the moment (one for Homass and the other for
> LMS/squeezeplayer).
>
> I will try and document all the processes in details and then make it
> public (if I succeed ;)) and if you agree of course.
>
> Thx

That config should work easily enough. Feel free to add to any
documentation as you see fit. The basic instructions on the GIT hub
should do it, many have tried and most (that I am aware of) have
succeeded. Let me know if you need some help. While somewhat
convoluted the concepts are easy enough.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-11-26 11:08:50 UTC
Permalink
I am struggling to work out how to specify an API password. I installed
Home Assistant using a Pi image and have a password to enter on the web
page when I go to http://hassio.local:8123
This isn't the same password as the API password is it? Also, isn't the
API password feature is now deprecated?

Do I need to modify the following lines in configuration.yaml and add a
line 'api_password: !secret http_password'?

# Uncomment this if you are using SSL/TLS, running in Docker container,
etc.
# http:
# base_url: example.duckdns.org:8123

Do I also need to add the following?

auth_providers:
- type: legacy_api_password

Colin


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-11-26 13:01:56 UTC
Permalink
Hi,

When you first login to Home assistant, it will prompt you with a login
ans password. This is not an authentification step. Indeed here you can
create a new home assistant user ans its password. You will then use
this login/password to effectively login.


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-11-26 16:41:51 UTC
Permalink
kalimeroo wrote:
> Hi,
>
> When you first login to Home assistant, it will prompt you with a login
> ans password. This is not an authentification step. Indeed here you can
> create a new home assistant user ans its password. You will then use
> this login/password to effectively login.

Maybe I didn't phrase my question clearly. I created the initial user
and password OK and can login, but I believe that that password is not
the same one as used for an *API password* is it? I was asking how to
create the API password, and whether I even should, as it appears to be
deprecated.


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-27 02:50:57 UTC
Permalink
hopeful wrote:
> I am struggling to work out how to specify an API password. I installed
> Home Assistant using a Pi image and have a password to enter on the web
> page when I go to http://hassio.local:8123
> This isn't the same password as the API password is it? Also, isn't the
> API password feature is now deprecated?
>
> Do I need to modify the following lines in configuration.yaml and add a
> line 'api_password: !secret http_password'?
>
> # Uncomment this if you are using SSL/TLS, running in Docker container,
> etc.
> # http:
> # base_url: example.duckdns.org:8123
>
> Do I also need to add the following?
>
> auth_providers:
> - type: legacy_api_password
>
> Colin

In the configuration.yaml file the following entry is required in the
http section to set the API password:

-http:
# Secrets are defined in the file secrets.yaml
api_password: !secret http_password
# Uncomment this if you are using SSL/TLS, running in Docker
container, etc.
base_url: !secret base_url
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem-

In my secrets.yaml file the following entries:

-http_password: HA_API_Password
base_url: https://HA_Link.duckdns.org
-

Hope that helps. Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-11-27 17:04:13 UTC
Permalink
@Hopeful Sorry, I misunderstood your issue.

Setting a Legacy PI password works fine but will indeed be dropped
(https://www.home-assistant.io/docs/authentication/providers/).

@ynot

I think I have set up the Home Assistant (Hassbian) and LMS fine on my
Rpi. You state that you created a playlist for the radio station. Could
you please let me know where to store this playlist and its name.

Thanks


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-28 02:36:35 UTC
Permalink
kalimeroo wrote:
> @Hopeful Sorry, I misunderstood your issue.
>
> Setting a Legacy PI password works fine but will indeed be dropped
> (https://www.home-assistant.io/docs/authentication/providers/).
>
> @ynot
>
> I think I have set up the Home Assistant (Hassbian) and LMS fine on my
> Rpi. You state that you created a playlist for the radio station. Could
> you please let me know where to store this playlist and its name.
>
> Thanks

To create a radio station playlist I simply use the LMS web frontend
and:


- Add a radio station to a player
- Save it as a playlist using the following naming convention
Radio_StationName


Some of my examples are: Radio_Cbc, Radio_Q92, Radio_Country_Classics.

These radio stations can be invoked by saying "Hey Google, ask LMS
Controls to play radio station cbc". It will queue up the playlist
"Radio_Cbc" on the default player.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-11-28 10:41:21 UTC
Permalink
Following the guide troubleshooting.md I can successfully fill out the
source and artist fields and select the play artist function and the
player starts playing. However, the same doesn't work for play album or
play playlist.

I notice that some of the shell script files include the 'login username
password' in the command and some don't. As I don't need a username and
password for LMS (I think), do I need to edit some of these files?

Colin


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-11-29 01:31:16 UTC
Permalink
hopeful wrote:
> Following the guide troubleshooting.md I can successfully fill out the
> source and artist fields and select the play artist function and the
> player starts playing. However, the same doesn't work for play album or
> play playlist?
>
> Colin

For the album issue, I assume you are using source LMS. Ensure the
shell script is working properly and returning the proper sensor.alb_id
and sensor.art_id properly. Note there are 2 types of shell scripts,
those using "secure" versions of LMS, these require the login and the
script names end in _sec. For those using the normal version of LMS (no
login) the regular scripts should work.

As for the play playlist, I may have neglected to mention the playlist
naming format should not contain spaces, use _ instead. (ie:
country_classics).

Personally I use spotify source most of the time so don't use the LMS
source too often.

Hope that helps. Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-01 14:48:59 UTC
Permalink
The result of running the qry_alb.sh script directly:

bash-4.4# bash qry_alb.sh _supertramp _crisis_what_crisis?

Artists are:

Artist check zero is:

qry_alb.sh: line 14: [: ==: unary operator expected

Artist found so moving on to albums....

Album check zero is: 0


Albums are:
albums 0 20 artist_id%3A search%3A_crisis_what_crisis%3F tags%3Aal
count%3A0

no album match setting ID to 0

Artist ID is:
Album ID is: 0
now Posting results

{"attributes": {}, "context": {"id": "e2b25b8b1eb1469e9948916ad73d9d49",
"user_id": null}, "entity_id": "sensor.art_id", "last_changed":
"2018-12-01T14:06:38.145783+00:00", "last_updated":
"2018-12-01T14:06:38.145783+00:00", "state": ""}
{"attributes": {}, "context": {"id": "1820e0c4fa374c0ca6d47f5e7525c013",
"user_id": null}, "entity_id": "sensor.alb_id", "last_changed":
"2018-12-01T14:06:38.548493+00:00", "last_updated":
"2018-12-01T14:06:38.548493+00:00", "state": "0"}


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-01 15:11:46 UTC
Permalink
hopeful wrote:
> The result of running the qry_alb.sh script directly:
>
> bash-4.4# bash qry_alb.sh _supertramp _crisis_what_crisis?
>
>
> Artist ID is:
> Album ID is: 0
> now Posting results
>
> {"attributes": {}, "context": {"id": "e2b25b8b1eb1469e9948916ad73d9d49",
> "user_id": null}, "entity_id": "sensor.art_id", "last_changed":
> "2018-12-01T14:06:38.145783+00:00", "last_updated":
> "2018-12-01T14:06:38.145783+00:00", "state": ""}
> {"attributes": {}, "context": {"id": "1820e0c4fa374c0ca6d47f5e7525c013",
> "user_id": null}, "entity_id": "sensor.alb_id", "last_changed":
> "2018-12-01T14:06:38.548493+00:00", "last_updated":
> "2018-12-01T14:06:38.548493+00:00", "state": "0"}

Looks like your script isn't working and may have a typo or something in
it. If you want, you can forward me a copy of the script and also let
me know if you're using the secure (login) or unsecure version of LMS.
This is the reason you're not getting an album. I ran the command on my
system and it returned supertramp and crisis what crisis as the album.
Also for future use, lose the ? as this would not normally come through
in a voice command

My email is ***@vianet.ca

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-01 16:41:19 UTC
Permalink
Doh! As I was preparing to send you my script and replacing the IP
address and DuckDNS ID with asterisks, I noticed that I'd missed
replacing a 'localhost' entry in the original file. It works now - sorry
about that.

One thing that may help others is the problem I had before this. If
using Windows to create and edit the shell script files before copying
them across to a Pi, make sure that the editor, e.g. Notepad++, is
configured to just use LF for end-of-line characters, rather than the
Windows default of CR LF.


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-01 18:57:49 UTC
Permalink
hopeful wrote:
> Doh! As I was preparing to send you my script and replacing the IP
> address and DuckDNS ID with asterisks, I noticed that I'd missed
> replacing a 'localhost' entry in the original file. It works now - sorry
> about that.
>
> One thing that may help others is the problem I had before this. If
> using Windows to create and edit the shell script files before copying
> them across to a Pi, make sure that the editor, e.g. Notepad++, is
> configured to just use LF for end-of-line characters, rather than the
> Windows default of CR LF.

Good stuff glad to hear it worked out. Usually the issues are something
simple like that. Hopefully this winter I can take the time to write a
small config script that would make the changes automatically based on
answered options to avoid some of the grunt work. Might need a bit more
time and talent to pull it off though. I don't do a whole lot of coding
these days.
:)


Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-02 15:00:29 UTC
Permalink
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
@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.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-02 17:05:33 UTC
Permalink
Concerning the end of line character if using windows to edit the files,
it can also be fixed whith the dos2unix tool.

I added the following lines in order to force API password usage:

homeassistant:
auth_providers:
- type: legacy_api_password

http:
api_password: !secret http_password

The search scripts work fine but I fails to issue the curl command to
homeassistant.
If I put the following in the script I get a 405 error:
curl -X POST -d '{"state":"'"${art_id}"'"}'
http://myserver.duckdns.org:8123/api/states/sensor.art_ID?api_password=API_password

If I change to curl -X POST -d '{"state":"'"${art_id}"'"}'
http://myserver.duckdns.org/api/states/sensor.art_ID?api_password=API_password,
I end up with a 401 error.


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-03 14:06:56 UTC
Permalink
kalimeroo wrote:
> Concerning the end of line character if using windows to edit the files,
> it can also be fixed whith the dos2unix tool.
>
> I added the following lines in order to force API password usage:
>
> homeassistant:
> auth_providers:
> - type: legacy_api_password
>
> http:
> api_password: !secret http_password
>
> The search scripts work fine but I fails to issue the curl command to
> homeassistant.
> If I put the following in the script I get a 405 error:
> curl -X POST -d '{"state":"'"${art_id}"'"}'
> http://myserver.duckdns.org:8123/api/states/sensor.art_ID?api_password=API_password
>
> If I change to curl -X POST -d '{"state":"'"${art_id}"'"}'
> http://myserver.duckdns.org/api/states/sensor.art_ID?api_password=API_password,
> I end up with a 401 error.

The scripts can be modified for the new long lived token if needed. But
first:

- what version of HA are you using and
- is your LMS flavour secure (you need to login) or unsecure (it just
works).

If you want a copy of a working shell script, let me know as this is
still a work in progress. I am having issues getting dialogflow to work
with HA and long lived tokens. I am getting error 206 (Malformed
response) from Google actions (dialogflow). Voice commands work, but
dialogflow isn't happy with the response from HA and as a result stops
responding.

Ynot.
(So many changes, sol little time)



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-03 16:50:32 UTC
Permalink
Hi,

I am running Hassbian with Home Assistant v0.83.2.

When running the qry_alb.sh script it returns successfully the ID number
of the artist and album (LMS server is not secured as far as I know).

The issue is on the curl POST request which returns the error 401.

I tested :

$ curl -X POST -H "Authorization: Bearer ABCDEFGH" \
-H "Content-Type: application/json" \
-d '{"state": "25", "attributes": {"unit_of_measurement": "°C"}}'
\
http://localhost:8123/api/states/sensor.kitchen_temperature

and this worked out fine so I tryed modifying yout curl request but this
resulted in "curl illegal port number" and error 405


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-04 01:39:29 UTC
Permalink
kalimeroo wrote:
> Hi,
>
> I am running Hassbian with Home Assistant v0.83.2.
>
> When running the qry_alb.sh script it returns successfully the ID number
> of the artist and album (LMS server is not secured as far as I know).
>
> The issue is on the curl POST request which returns the error 401.
>
> I tested :
>
> $ curl -X POST -H "Authorization: Bearer ABCDEFGH" \
> -H "Content-Type: application/json" \
> -d '{"state": "25", "attributes": {"unit_of_measurement": "°C"}}'
> \
> http://localhost:8123/api/states/sensor.kitchen_temperature
>
> and this worked out fine so I tryed modifying yout curl request but this
> resulted in "curl illegal port number" and error 405

Below is the proposed shell script mods to accommodate the long lived
token:

Code:
--------------------
HA_token=ThisIsMyLongLivedToken
curl -X POST -d '{"state":"'"${art_id}"'"}' https://HA_Link.duckdns.org/api/states/sensor.art_ID? -H "Authorization: Bearer $HA_token"
echo
curl -X POST -d '{"state":"'"${alb_id}"'"}' https://HA_Link.duckdns.org/api/states/sensor.alb_ID? -H "Authorization: Bearer $HA_token"
echo
curl -X POST -d '{"state":"'"${name}"'"}' https://HA_Link.duckdns.org/api/states/sensor.lms_name? -H "Authorization: Bearer $HA_token"
echo
--------------------

Give that a shot.
Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-04 08:55:38 UTC
Permalink
Thanks a lot for your time and efforts. The authentification with the
long lasting token (generetad in
https://your_server.duckdns.org/profile) works like a charm. I just had
to specify the 8123 port as my router does not handle port forwarding
correctly.

I can now move on with the Google part.


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-04 13:22:57 UTC
Permalink
kalimeroo wrote:
> Thanks a lot for your time and efforts. The authentification with the
> long lasting token (generetad in
> https://your_server.duckdns.org/profile) works like a charm. I just had
> to specify the 8123 port as my router does not handle port forwarding
> correctly.
>
> I can now move on with the Google part.
Glad to hear that. So now you have a basic LMS front-end that works
anywhere in a secure fashion. ;)

As for the Google DialogFlow part, something has changed in the last
week or so, either with DialogFlow / Google Actions and / or Home
Assistant resulting in a webhook error 206 (at least on my system)
causing the Dialogflow (Google) part to work for only the first command
and then the app returns the message "LMS control is available right
now, please try again later". The command actually gets processed (so
volume goes up, song gets queued, etc..) but the feedback no longer
works (ie: "Setting the volume to 20"). So it is functional (sort of)
with one command at a time and no feedback

I will try to solve it fairly soon, but integrating 3 pieces of software
I have little control over is proving a bigger task than I hoped for.
If you have time, give it a shot and let me know how you make out. I
will post if I make significant progress in this issue.

*By the way:* If you are using long lived tokens with Dialogflow the
fullfilment URL should look something like:
https://HA_Link.duckdns.org/api/services/script/lms_control with the
Header field: -Key=-Authorization -Value=-Bearer insertyourtokenhere

Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-05 12:13:48 UTC
Permalink
ynot1234567890 wrote:
>
> I will try to solve it fairly soon, but integrating 3 pieces of software
> I have little control over is proving a bigger task than I hoped for.
> If you have time, give it a shot and let me know how you make out. I
> will post if I make significant progress in this issue.
>
> Ynot

Took another look at it. Made some progress, the Webhook function in
DialogFlow no longer works properly using the brute force method I used
previously :mad:.

I did manage however to make HA and DialogFlow work using proper intent
structures and long-lived tokens (rather than the deprecated
API_Password) which in the end will be a lot more flexible allowing
additional new features like "What's playing in the kitchen?". It will
however require some re-structuring of code on the HA side of things.
Should have a working prototype back online in the near future.

The only drawback I see so far is HA support only V1 of the DialogFlow
API. Another change will be required when V2 becomes supported.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-05 16:59:05 UTC
Permalink
I probably experience the same issue.
I went on and created an action on google console and then created a new
project and then an action in Dialogflow.
When testing the app in Dialogflow in works fine but if I then integrate
it to google assistant and run the test I get the error "LMS control
isn't responding right now. Try again soon."

During the integration step if I change the Explicit invocation from
"Default Welcome intent" to any other intent it will respond once and
then fallback to the error message (If I set the intent to "play_album"
it responds "Alright. Getting the test version of LMS control.Which
radio station ") .

The home-assistant.log file contains a line of ^@^@^@^@^@^@^@^@^@^@^@ so
I guess there is some kind of communication.


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-05 20:08:02 UTC
Permalink
@kalimeroo, That is exactly the issue. As mentioned above, in order to
make this work now, the dialogflow method has to be implemented properly
using HA intents, returning a valid JSON to Google Assistant. I will
likely create a short term patch to make it work as it was, then do a
better job of re-structuring the HA code to suit this method and add a
few new features like feedback of query results and allow a more
feedback from HA like:

- "What's playing in the kitchen", which would return name of artist,
album and song
- "Who's at home"
"
- What's the temperature in the house"
- And whatever else HA happens to know

I should have something workable fairly soon. Will keep you posted. If
you send me an email address, perhaps I can share the first rough draft
as you already have the backend working with Long-lived tokens.
***@vianet.ca

ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-07 15:20:50 UTC
Permalink
I'm curious to know how the Google Assistant recognises the intent 'LMS
Controls' in order to start the app. If I wanted to change the name,
could I do that and, if so, where? So, for example, I could say 'Hey
google ask Vortexbox to play album Dog and Butterfly by Heart in the
kitchen with shuffle on'

And thanks for an exciting project!

Colin


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-07 15:43:45 UTC
Permalink
When you create a google application you create an action (in this case
it will be Dialogflow). You can decide the way your action is triggered.
It requires two words (Vortexbox won't work but Vortex box will) so you
can use "Ok google, tell Vortex Box to play nirvana in the kitchen".


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-07 15:55:19 UTC
Permalink
kalimeroo wrote:
> You can decide the way your action is triggered. It requires two words .
So where is that string and can it be edited after the application has
been created?


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
kalimeroo
2018-12-07 16:28:49 UTC
Permalink
You log on to your https://console.actions.google.com/ and you select
your action. On the left panel you'll get the "Invocation" menu where
you can change your trigger phrase.


------------------------------------------------------------------------
kalimeroo's Profile: http://forums.slimdevices.com/member.php?userid=68671
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-07 16:39:58 UTC
Permalink
kalimeroo wrote:
> You log on to your https://console.actions.google.com/ and you select
> your action. On the left panel you'll get the "Invocation" menu where
> you can change your trigger phrase.

But I haven't created the LMS Controls action, ynot has, hasn't he? If I
log on to that URL, there is no action to select.

Sorry if I'm being dumb.


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-07 19:05:20 UTC
Permalink
hopeful wrote:
> But I haven't created the LMS Controls action, ynot has, hasn't he? If I
> log on to that URL, there is no action to select.
>
> Sorry if I'm being dumb.

You will need to create your own action, calling your own url, with your
webhook, etc.. You can name it whatever you want as outlined
previously, set the invocation to whatever you would like. I won't
publish the action as an available app to all users because I do not
want to be responsible for everyone's stuff, passwords, links,
authentication, etc... Don't have the infrastructure for it and of
course I am doing this for free with no implied warranty. :)

If you hang tough for a week or so (hopefully) I will publish another
revision using the new long lived tokens and security model for Home
Assistant as well as proper webhook syntax that is now required with the
upgrades at HA, Google and DialogFlow.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-08 14:01:00 UTC
Permalink
If you haven't published an action to be available to all and I haven't
created an action from the console, how does Google Assistant recognise
the phrase 'LMS Control'?


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-08 15:03:57 UTC
Permalink
hopeful wrote:
> If you haven't published an action to be available to all and I haven't
> created an action from the console, how does Google Assistant recognize
> the phrase 'LMS Control'?

Hum, not sure. I did indeed publish it as an alpha action only which
should only appear to those I invite. Did a quick check using another
google account and the action did not show up on the web for that
account, but the action name (LMS Controls) is reserved for me.

So did you build the DialogFlow part of the project and test it on
google actions? If yes that is likely how the action came to be
available.

Otherwise, not quite sure where you got the action from. Sorry.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-08 15:41:13 UTC
Permalink
Bearing in mind that this is all new to me, are my following assumptions
correct ...
1. Following your complete set of instructions, provided that I'm happy
to use the phrase 'LMS Controls', I wouldn't need to create an Action
from https://console.actions.google.com/ , because the DialogFlow part
somehow sees the Alpha action that you published?
2. If I wanted to use a different phrase to connect to the LMS Controls
app, I would need to create a new Action from
https://console.actions.google.com/ . I would need to associate this
with the existing DialogFlow project somehow.


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-08 20:30:48 UTC
Permalink
Good news, the LMS Controls project (see 'here'
(https://github.com/ynot123/LMS_Controls)) 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.

For those who have already installed this project and simply want a
short cheat sheet on how to update your current installation, please see
here: https://github.com/ynot123/LMS_Controls/blob/master/cheatsheet.md

For those starting fresh, please go to the project's GitHub (see 'here'
(https://github.com/ynot123/LMS_Controls)) and follow the instructions.

Thanks and enjoy.

Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
ynot1234567890
2018-12-08 20:43:14 UTC
Permalink
hopeful wrote:
> Bearing in mind that this is all new to me, are my following assumptions
> correct ...
> 1. Following your complete set of instructions, provided that I'm happy
> to use the phrase 'LMS Controls', I wouldn't need to create an Action
> from https://console.actions.google.com/ , because the DialogFlow part
> somehow sees the Alpha action that you published?
> 2. If I wanted to use a different phrase to connect to the LMS Controls
> app, I would need to create a new Action from
> https://console.actions.google.com/ . I would need to associate this
> with the existing DialogFlow project somehow.

Hi Hopeful,

Not sure how far along you are with the config for the project. I have
just released an update that deals with a security issue for HA version
0.83 and up that causes problems with the shell scripts and dialogflow
programs. Please take a quick look at that and start the installation
as outlined in the refreshed readme.md files. In there you should find
all the details you need to make this work. As for the DialogFlow part,
everyone needs to login into Dialogflow and build the Agent (from my zip
file), fill in the url and token details, then test it in Google
Assistant (which creates the Google action).

If you are still having difficulty after that, send me an email at
***@vianet.ca and I can try to help sort it out with you. In the
email, please include, HA version and how far you have gotten in the
process which is:

First step - Build the HA part and test interface to LMS using HA GUI
interface. This will tell you if the shell scripts are working, if HA
is talking to LMS, etc..
Second step is - Build and test Dialogflow part which is the interface
between GoogleHome and HA

Hope that helps clear it up a bit. Ynot.



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms,
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge,
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
hopeful
2018-12-08 14:32:23 UTC
Permalink
If you haven't published the action as an available app to all users and
I haven't created an action, how does Google Assistant recognise the
phrase 'LMS Controls' at the moment?


------------------------------------------------------------------------
hopeful's Profile: http://forums.slimdevices.com/member.php?userid=65059
View this thread: http://forums.slimdevices.com/showthread.php?t=109273
Loading...