Zian,
First, thanks for the heads up on the program as it is pretty nice actually. I messed around a bit with the api and found it to be a headache, at least from the point of view of an extremely low skill coder.
Next, I believe those keyboard shortcuts from the now dead link are not for the desktop app you are using. From what I recall google once upon a time either had a beta desktop music app they made, which is now discontinued, or someone else designed such an app and these keys re for that program; either way unhelpful unfortunately.
Now to the meat of it:
What I learned was that you have to establish a kind of "handshake" through websocket. See
HERE
Process breakdown:
1) you send a json message saying which tells the program you want to connect
Code: Select all
{
"namespace": "connect",
"method": "connect",
"arguments": ["EventGhost"]
}
2) you get a response from the program, which you could use to trigger a function to extract the code or prompt a gui input to use in step 3
Code: Select all
{
"channel": "connect",
"payload": "CODE_REQUIRED"
}
3) the program gives you a 4 digit code in its UI which you have to send back to it in json
Code: Select all
{
"namespace": "connect",
"method": "connect",
"arguments": ["Name of Device / App", "0000"] # where 0000 = the code
}
4) this then it gives you a permanent access key. This key must then be used to call the websocket to establish a connection
Code: Select all
{
"namespace": "connect",
"method": "connect",
"arguments": ["EventGhost", "Your_Given_Key"]
}
5) you are the
FINALLY able to then send commands in the form of json
6) these commands might look something like:
(an example I think I understand)
Code: Select all
{
"namespace": "playback",
"method": "setShuffle",
"arguments": [ALL_SHUFFLE]
}
or
(no example given, and no argument value ... so... who knows
Code: Select all
{
"namespace": "playback",
"method": "toggleShuffle",
}
For what its worth
HERE is a working example from home-assistant.io
Caveats with above link:
1) Based around python 3
2) uses modules outside of EG core.