• 1
  • 10
  • 11
  • 12(current)
  • 13
  • 14
  • 16
Release Control Kodi with your Google Home
Solved the 'do multiple things in a row' challenge for me. Smile

Yay. Smile

First read this:

Multiple IFTTT Triggers
https://medium.com/glitch/how-to-trigger...77860a76af

and set it up the same as you did the Glitch project for 'control Kodi'. Make it private as well. Enter your Webhooks url (from https://ifttt.com/maker_webhooks/settings ) in the .env file for 'Multiple IFTTT Triggers

In IFTTT create two applets. "This" AND "That" both Webhook.
"This" is simply the applets name. You can choose it freely.

"That" for the first one (I named infoon) is the action you want 'control Kodi' to trigger - so in my case: 
Code:
https://free-xxxxxxxxxxxx.glitch.me/displayinfo
with POST, json, and the token as usual.

"That" for the second one (I named delayedinfoon) is
Code:
http://lab.grapeot.me/ifttt/delay?event=infoon&t=0.01&key=xxxxxxxxxxxxx
with GET and all the other fields left to default state (just hit save).

The xxxxxxxx's after key= you have to replace with the token from https://ifttt.com/maker_webhooks/settings (so the thing after /use/)

Finally - create a last applet with "This" being your Google Assistant action (as usual) and "That" being the new Glitch url for your (private Smile ) "Multiple IFTTT Triggers" project on glitch. (press show > in a new window and then copy that url). Method: POST, Content Type: json. Save it.

Then head back in the .env file 

and simply put
Code:
IFTTT_EVENT_1=infoon
IFTTT_EVENT_2=delayedinfoon
(or your applet names there)

and thats it.
Both commands will be run one after the other. The second one will hit the lab.grapeot.me website, the website will create a 0.01 minute delay (which would be less than a second, but the minimal delay is 5 seconds, so it turns out to be five.. Wink ) and then run the applet you specified in that url.

In the end this means, "Hey, Google - Kodi Info" in my case displays Info for five seconds, and then removes it from the screen again, which was the desired outcome.

Far more complicated than needed (because IFTTT doesnt support delays on its own), but hey. It works. Smile
Reply
(2019-12-06, 04:55)harlekin Wrote: Havent installed all yet. Voice commands are Google dependent - so google has to identify them correctly for them to work. You can always replace keywords in the IFTTT syntax - if the underlying module works in principal.

(You can always test modules using the test page in Glitch (the one where you get your glitch server url from). If that works, you know that the issue should be phrase recognition on googles part. So try out different trigger phrases. Smile )

Google does some weighing. So if you write in anything that sounds like "bank", or "coffeshop" - chances are, that you are getting a wrong weighing on average - so try different keywords. Smile Maybe.

Another question. Is there a possibility to chain commands? On the most simple level - display info, and then trigger it again 5 seconds or so later, so that info gets removed from screen again.

How would you go on doing that? (With IFTTT or built in modules.)

Not sure i follow.  The command Kodi Navhome, Kodi Navback, Kodi Navup used to work.  They are defined in the Glitch project.  When i give the command to google, they appear to be going through to kodi correctly, since kodi will show an error indicating not recognized broker phrase 'kodi navhome'
Reply
(2019-12-06, 15:35)[email protected] Wrote:
(2019-12-06, 04:55)harlekin Wrote: Havent installed all yet. Voice commands are Google dependent - so google has to identify them correctly for them to work. You can always replace keywords in the IFTTT syntax - if the underlying module works in principal.

(You can always test modules using the test page in Glitch (the one where you get your glitch server url from). If that works, you know that the issue should be phrase recognition on googles part. So try out different trigger phrases. Smile )

Google does some weighing. So if you write in anything that sounds like "bank", or "coffeshop" - chances are, that you are getting a wrong weighing on average - so try different keywords. Smile Maybe.

Another question. Is there a possibility to chain commands? On the most simple level - display info, and then trigger it again 5 seconds or so later, so that info gets removed from screen again.

How would you go on doing that? (With IFTTT or built in modules.)

Not sure i follow.  The command Kodi Navhome, Kodi Navback, Kodi Navup used to work.  They are defined in the Glitch project.  When i give the command to google, they appear to be going through to kodi correctly, since kodi will show an error indicating not recognized broker phrase 'kodi navhome' 
I tried a few things.  As suggested in the Glitch test connection page, i put in the commands Navhome, navback, etc.... they all worked and did what was supposed to in Kodi.  However when i tell google "Kodi Navhome"  it says it does not recognize broker PhraseHuh

when i look at my log in IFTTT, i have a failed action 'unable to make web request.  Your server returned a 500'

I'm lost, this worked before, what is technically happening?  I don't understand why the command is not going through correctly?  Does it have something to do with lower/uppercase, languagesHuh
Reply
You have to test more. Smile

I can provide some more info though. Smile So languages do affect the procedure. I personally set up all the commands I use in IFTTT directly - so I can use german trigger words for example - and I can tell you, that using "english" for Google Assistant in IFTTT with an english trigger word, didn't work for me in practice (Google Home set up as "german"). I had to set up my triggerphrases in german.

So different "written text" recognition and handover imho is expected, if f.e. your Google Home is set up in a different language than english.

Upercase/lowercase probably wont make a difference (if I do a google voice search for Kodi Pause on my Android phone, (without assistant activated), it comes back as KODi pause, so - yeah... Wink ).

If you dont use the "single IFTTT action" method (Kodi $) which transports everything you say to the Glitch server and that then disects it further, you are only producing the phrases that - if detected by google, will tell IFTTT to push the commands you could also input on the test site to the server.
(That is if you are not using $ (for a number f.e.), in which case that number would have to be detected, and handed over as a variable.)

So on that base level - getting different results on the test page and on IFTTT doing something is impossible. Smile Set up your own keyphrases in IFTTT and test with them - for the navhome, navback - etc actions. Just make sure that they trigger the corresponding URL and see what the results are.

If you use the "single IFTTT action" method (Kodi $), everything that gets spoken after Kodi will be handed to the glitch server as a variable - and the glitch server then does RegEX (Regular Expressions) parsing on the text. This is VERY 'down by the book' as in text has absolutely be written correctly, minor inconsistancies can throw it off, text incoming has to be exactly as expected, and so on and so forth...
-

In principle. All Webhook does, is first - get triggered by a trigger (f.e. Google Assistant), and then send over a request to the Glitch webserver - the same way the test page would do. It literally calls the same 'modules' (entry points). So if phrase is recognized correctly - there should be no more points of failure from that point forward (if you dont go the single IFTTT action route).

Webhook really only is "if phrase is detected" "visit website" and in some limited cases "hand over variable (think number)".

Also I never get 'error messages' on Kodi itself. So thats also something interesting to look into. (I've integrated the navback command at least, and it works as expected. I used triggerword 'back' which I have to pronounce in my best Arnold Schwarzenegger impression (german pronounciation) for it to trigger the command. (Home and IFTTT action set up in german).
Reply
(2019-12-06, 20:30)harlekin Wrote: You have to test more. Smile

I can provide some more info though. Smile So languages do affect the procedure. I personally set up all the commands I use in IFTTT directly - so I can use german trigger words for example - and I can tell you, that using "english" for Google Assistant in IFTTT with an english trigger word, didn't work for me in practice (Google Home set up as "german"). I had to set up my triggerphrases in german.

So different "written text" recognition and handover imho is expected, if f.e. your Google Home is set up in a different language than english.

Upercase/lowercase probably wont make a difference (if I do a google voice search for Kodi Pause on my Android phone, (without assistant activated), it comes back as KODi pause, so - yeah... Wink ).

If you dont use the "single IFTTT action" method (Kodi $) which transports everything you say to the Glitch server and that then disects it further, you are only producing the phrases that - if detected by google, will tell IFTTT to push the commands you could also input on the test site to the server.
(That is if you are not using $ (for a number f.e.), in which case that number would have to be detected, and handed over as a variable.)

So on that base level - getting different results on the test page and on IFTTT doing something is impossible. Smile Set up your own keyphrases in IFTTT and test with them - for the navhome, navback - etc actions. Just make sure that they trigger the corresponding URL and see what the results are.

If you use the "single IFTTT action" method (Kodi $), everything that gets spoken after Kodi will be handed to the glitch server as a variable - and the glitch server then does RegEX (Regular Expressions) parsing on the text. This is VERY 'down by the book' as in text has absolutely be written correctly, minor inconsistancies can throw it off, text incoming has to be exactly as expected, and so on and so forth...
-

In principle. All Webhook does, is first - get triggered by a trigger (f.e. Google Assistant), and then send over a request to the Glitch webserver - the same way the test page would do. It literally calls the same 'modules' (entry points). So if phrase is recognized correctly - there should be no more points of failure from that point forward (if you dont go the single IFTTT action route).

Webhook really only is "if phrase is detected" "visit website" and in some limited cases "hand over variable (think number)".

Also I never get 'error messages' on Kodi itself. So thats also something interesting to look into. (I've integrated the navback command at least, and it works as expected. I used triggerword 'back' which I have to pronounce in my best Arnold Schwarzenegger impression (german pronounciation) for it to trigger the command. (Home and IFTTT action set up in german).
so are you saying you setup a IFTTT applet for every command you want to send?  Do you have a snapshot of how that would look?
Reply
Also I removed longpress keys using a keyboard.xml mapping (see: https://github.com/xbmc/xbmc/issues/15772 ) so xbev (different program) works with current kodi builds again in my case.

But since the testpage commands work for you - this shouldnt be the issue in your case. (This is for button presses handed over to Kodi being not detected, one of which is backspace which would correspond to navback - but again, since the testpage works for you, this is likely not connected to your issue.)
Reply
(2019-12-06, 20:42)[email protected] Wrote: so are you saying you setup a IFTTT applet for every command you want to send? 

I have done that, yes. Smile

Sure: 

Image

Image


Make sure you dont use "Kodi" as the triggerword for testing, if you've also set up the general (Kodi $) action. (Which is = "send everything after the word Kodi to the glitch server".) Use some other word instead. (That doesnt remind Google Assistant of "bank" or "coffeeshop" too much.. Wink ) Test a few. Smile

That navback action works for me in practice. So I can confirm that its not broken.

Also 'German' was chosen, because my Google Home is set up in German.
Reply
Say a simple phrase     Kodi Power     YOUR_NODE_SERVER/playyoutube?q=bypowergrayskull&max=1
Plays He-Man I have the power from youtube.. Wink

The usecases are endless. Wink

edit:

Say a simple phrase     Kodi Metal     YOUR_NODE_SERVER/playyoutube?q=babymetalkarate&max=1
Plays Baby Metal from youtube.

Say a simple phrase     Kodi Korea     YOUR_NODE_SERVER/playyoutube?q=2ne1&max=5
Plays 2ne1 playlist from youtube.

Say a simple phrase     Kodi Portman     YOUR_NODE_SERVER/playyoutube?q=live%20on%20letterman%20portman&max=1
Plays Natalie Portman from youtube.

Say a simple phrase     Kodi Brody     YOUR_NODE_SERVER/playyoutube?q=brodyquest&max=1
Plays Brodyquest from youtube.

Say a simple phrase     Kodi Alright     YOUR_NODE_SERVER/playyoutube?q=alright%20chronological&max=1
Plays Every Matthew McConaughey "Alright" In Chronological Order from youtube.

Wink
Reply
(2019-12-06, 21:30)harlekin Wrote: Say a simple phrase     Kodi Power     YOUR_NODE_SERVER/playyoutube?q=bypowergrayskull&max=1
Plays He-Man I have the power from youtube.. Wink

The usecases are endless. Wink

edit:

Say a simple phrase     Kodi Metal     YOUR_NODE_SERVER/playyoutube?q=babymetalkarate&max=1
Plays Baby Metal from youtube.

Say a simple phrase     Kodi Korea     YOUR_NODE_SERVER/playyoutube?q=2ne1&max=5
Plays 2ne1 playlist from youtube.

Say a simple phrase     Kodi Portman     YOUR_NODE_SERVER/playyoutube?q=live%20on%20letterman%20portman&max=1
Plays Natalie Portman from youtube.

Say a simple phrase     Kodi Brody     YOUR_NODE_SERVER/playyoutube?q=brodyquest&max=1
Plays Brodyquest from youtube.

Say a simple phrase     Kodi Alright     YOUR_NODE_SERVER/playyoutube?q=alright%20chronological&max=1
Plays Every Matthew McConaughey "Alright" In Chronological Order from youtube.

Wink

Seems to work, but I feel these commands should be working already as do the other commands.  KodiBingewatch, Kodiplaymovie etc....

But thank you very much for the work around.
Reply
I have several devices using kodi, so i would have to create who know how many IFTTT to work on each device.  'On Main go home', 'on living go home',  'on master go home', 'on rec go home'
Reply
"Work around" is specified in the github readme as "normal setup". Wink

Where it breaks is probably your Google Homes language settings. With it set to german it does recognize some english words, but not others. So the text output that gets transfered over to your Glitch webserver probably is different.

And again - this is probably connected to the language settings of the google account you are signed into Google Home with. Not just the dropdown menu in IFTTT.

So words like back, or home simply might not be recognized correctly - and its at that point where the chain fails.

Luckily this project lets you set up your own voice triggers, which means, you even can localize the commands.
(According to the readme, there is even a way to do this on the server level, so you dont have to create 20 IFTTT actions (like I did Wink ).)

Another bonus of the 'workaround' is, that you can have 7 different voice commands for /playpause - which I'm taking advantage of. Makes me think less.. Wink
Reply
Can someone tell me the correct syntax for Kodi commands??
for instance i want to sent a nav right

Action(action[,window])

so what would be the values??
Right(right[,activewindow])  ??

so Kodi.input.Right(right[,activewindow])
Reply
Ok,

I don't understand all the details.  I'm not technical and don't know how to program..
But i got the Navigating up, down, right, left working now

in the en.json file what was there:

"kodiNavRight": "navigate right( (?<q>\\d+))?",

I added

"kodiNavRight" : "nav right( (?<q>\\d+))?",

and in the Helpers.js i added

exports.kodiNavRight = (request, response) => { // eslint-disable-line no-unused-vars
    console.log('Navigation Right request received');
    let Kodi = request.kodi;

    return Kodi.Input.Right(); // eslint-disable-line new-cap
};

I'm not sure what the issue was with the previous and why it did not work, but now does what i want.

I'm thinking the previous commands are trying to allow to receive how many nav right?? like nav right 3 and it will move right 3  ??
Reply
That regex somehow looks wrong. Could be wrong. Wink

(?<q>\\d+))?
maybe should be
(?<q>|\d+))?
or
(?<q>\d+))?

so \d+ means any number with one or multiple digits
(?something) should be fuzzy grouping, not sure.

<q> refers to that combination of letters in the text string handed over? (not sure why).

\\d+ could be correct if pearl (?) 'eats' a single \ for some reason, but usually \\ means ignore the \ in \d+ and treat it as an actual backslash rather than the combination \d+ which stands for a number with  one or multiple digits. Which is odd. | would mean 'or' by the way. So again \\d+ should only be correct if the regex interpreter somehow 'eats' a single backslash - which is still unusual.

And again, could be wrong.
--

That nav instead of navigate fixes your issue speaks to google not sending over the word 'navigate' correctly 'written' in your case - which again, most likely is a language option thing on the Google Home  (Assistant) level. And again, could be wrong. Smile
Reply
*Cough**cough*

If you use Glitch, you might want to use a Cronjob website (https://cron-job.org/) to ping (GET rather) your projects website every four minutes. Glitch auto sleeps its projects every 5 minutes, and waking up causes considerable delay.

*Cough* (because it increases Glitch' CPU cycle usage significantly)
Reply
  • 1
  • 10
  • 11
  • 12(current)
  • 13
  • 14
  • 16

Logout Mark Read Team Forum Stats Members Help
Control Kodi with your Google Home4