Release - Control Kodi with your Google Home

  Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #46
My main language is python. I've created a small xmbc addon couple of year ago. I could try creating a service addon, with a small webserver. Then create one or two endpoints, that match the current node implementation. I think I would use something like: https://docs.python.org/2/library/simple...rver.html.

I don't have any experience with the pypi packages available in kodi. So I don't know what's usable.

We'd also need to find something for the fuzzy search.

Beside that, I don't see allot of challenges. I think this would be a nice first step. And later we could look into replacing IFTTT with api.ai.
find quote
jingai Offline
Skilled Skinner
Posts: 2,330
Joined: Mar 2010
Reputation: 41
Post: #47
Just FYI, we over at Kodi-Alexa tried putting all of this into an addon already and there's one big problem: the library query + fuzzy search can be really slow, especially on lighter hardware such as the various Android boxes commonly used.
find quote
Lunatixz Offline
Skilled Python Coder
Posts: 5,198
Joined: May 2011
Reputation: 157
Location: NYC
Post: #48
(2017-08-30 14:28)jingai Wrote:  Just FYI, we over at Kodi-Alexa tried putting all of this into an addon already and there's one big problem: the library query + fuzzy search can be really slow, especially on lighter hardware such as the various Android boxes commonly used.

depends how it's written, large json queries can stall. IMO if this is the case I would probably create my own SQL, populate it when idle and use a thread pool to handle sql queries.

It's a little extra work, and some data won't be fresh... but it beats RPC wait times.
(This post was last modified: 2017-08-30 22:03 by Lunatixz.)
find quote
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #49
(2017-08-30 14:28)jingai Wrote:  Just FYI, we over at Kodi-Alexa tried putting all of this into an addon already and there's one big problem: the library query + fuzzy search can be really slow, especially on lighter hardware such as the various Android boxes commonly used.

Out of curiosity. Amazon offers hosting part of your logic, in the cloud right? Using lambda? Did you try using that. That's the first thing I would look into when writing something like this for alexa. Then at least you could use that to do the fuzzy search and communication with the kodi api.
find quote
jingai Offline
Skilled Skinner
Posts: 2,330
Joined: Mar 2010
Reputation: 41
Post: #50
That is what we do. Well, that's one option we offer -- Heroku and self-hosted being the other two.

I was only pointing out that trying to move that code to an addon was unacceptably slow on hardware such as the Fire TV Stick.

As Lunatixz said, there are other things to try, but honestly it seemed not worth the extra effort for us.
find quote
Usafle Offline
Senior Member
Posts: 102
Joined: Jan 2017
Reputation: 1
Post: #51
Finally got around to getting a google home and ONLY because this looks pretty damn cool. I'm in the process of setting it up currently. Quick question, since I've got a AVR (and it's networked) would there be any way to control the volume? The volume in Kodi doesn't work as it's set to "passthrough" so the only way I control the volume is either with the AVR remote or via YATSE.

Also, if I am using the HDHomeRUN, there is probably no way to change the channels?

Got it to play a movie so far. When I try the "pause" command, it tells me there is nothing currently playing.. .even though something is, indeed, playing.
(This post was last modified: 2017-09-04 02:02 by Usafle.)
find quote
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #52
I havent heard anything yet from the omertu, so i'm continuing my changes in my fork: https://github.com/p0psicles/GoogleHomeK...ee/develop

For now i've made the following changes:
- [x] Cleaned up js code, added .eslintrc
- [x] Separated server.js (routes) and kodi helper methods (into helpers.js). Moved config related code into config.js.
- [x] Used ES6 with promises, instead of passing callback functions. Makes the code cleaner, and some of the helper functions are reusable now.
- [x] Added kodi open "show". This will open the show in the GUI, allowing you to navigate into the seasons from there.
- [x] Added kodi-hosts.config.js.dist (rename to kodi-hosts.config.js) to run the node server locally instead of in Glitch.com. If the file is not renamed, it will look after the Glitch env variables.
- [x] Fix searching PVR (at least tvheadend) by channel number. Removed searching channels per channelgroup, as we can also use the "alltv" group.
- [x] Added shuffling (playing a random episode) for a specified show.
- [ ] Control multiple kodi instalations.
- [x] Search and play youtube video's.
- [x] Update the docs.
(This post was last modified: 2017-09-07 19:53 by konti.)
find quote
Noexicaise Offline
Junior Member
Posts: 24
Joined: Nov 2012
Reputation: 0
Post: #53
Hello.

First it all. Thank you ! Great script

But is there a way for shutdown system ?
find quote
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #54
(2017-09-03 21:41)Usafle Wrote:  Finally got around to getting a google home and ONLY because this looks pretty damn cool. I'm in the process of setting it up currently. Quick question, since I've got a AVR (and it's networked) would there be any way to control the volume? The volume in Kodi doesn't work as it's set to "passthrough" so the only way I control the volume is either with the AVR remote or via YATSE.

Also, if I am using the HDHomeRUN, there is probably no way to change the channels?

Got it to play a movie so far. When I try the "pause" command, it tells me there is nothing currently playing.. .even though something is, indeed, playing.

How can you control the volume through yatse if you can only change it in your amplifier? If there is any app that you can use to change volume of your Amp, it could be automated. Last solution could be is using the logitech harmony hub.

Regarding HD homerun. I also have one. I believe there is a Pvr addon for HD homerun. If there isn't you can always use TV headed. Then you switch channels using kodi and use this application.
find quote
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #55
(2017-09-04 19:38)Noexicaise Wrote:  Hello.

First it all. Thank you ! Great script

But is there a way for shutdown system ?

Shutdown hasn't been added yet. But that should be possible. I can take a look at it if you want?

I've implemented it into my fork.
If you want to add it to you own code. You could do something like this:

Code:
// Parse request to Shutdown the kodi system
// Request format:  http://[THIS_SERVER_IP_ADDRESS]/shutdown
app.get('/shutdown', function(request, response) {
    validateRequest(request, response).then(() => {
        kodi.System.Shutdown();
        response.sendStatus(200);
    });
});
(This post was last modified: 2017-09-05 16:50 by konti.)
find quote
konti Offline
Member
Posts: 58
Joined: May 2005
Reputation: 0
Post: #56
I'm kinda stuck on having the IFTTT actions send an action where it can also differentiate in the kodi instances. As the IFTTT rules can only have one text ingredient, one number ingredient or a combination. But something like "Hey Google, kodi $ play $" is not possible. I was planning on translating it to "Kodi living room play $" and Kodi bed room play $". Any ideas?

Edit: never mind. I've already made some progress using api.ai. I think i'll have something ready not long from now.
api.ai is working really nice. Utilizing conversations. It should also be publishable. Meaning users don't need to add all the conversations.
(This post was last modified: 2017-09-08 10:56 by konti.)
find quote
bukibalama Offline
Junior Member
Posts: 18
Joined: Mar 2013
Reputation: 0
Post: #57
I'm getting the following error when i try to set up glitch and i don't know what to do

SyntaxError: Unexpected token s in JSON at position 4
5:54 PM
at Object.parse (native)
5:54 PM
Jump to
at IncomingMessage.<anonymous> (/app/server.js:43:23)
5:54 PM
at emitNone (events.js:86:13)
5:54 PM
at IncomingMessage.emit (events.js:185:7)
5:54 PM
at endReadableNT (_stream_readable.js:974:12)
5:54 PM
at _combinedTickCallback (internal/process/next_tick.js:80:11)
5:54 PM
at process._tickCallback (internal/process/next_tick.js:104:9)
find quote
Usafle Offline
Senior Member
Posts: 102
Joined: Jan 2017
Reputation: 1
Post: #58
(2017-09-05 10:19)konti Wrote:  How can you control the volume through yatse if you can only change it in your amplifier? If there is any app that you can use to change volume of your Amp, it could be automated. Last solution could be is using the logitech harmony hub.

Regarding HD homerun. I also have one. I believe there is a Pvr addon for HD homerun. If there isn't you can always use TV headed. Then you switch channels using kodi and use this application.

Yatse has a "plug in / addon" that allows you to control a networked based AVR located here. It's not a deal breaker as far as the Google Home integration is concerned, just curious if it could be possible to "expand" the functionality here?

Thanks for the Homerun info. I was informed on a different thread that only the official HDH plug in would work in Kodi, nothing else would.
find quote
dazz87 Offline
Senior Member
Posts: 104
Joined: Nov 2012
Reputation: 0
Post: #59
Comparing this to Amazon echo which i was using to control kodi this has a faster response....Cool Anyone know the command for turn on and off subtitle? I search the thread and there is nothing on subtitle. Thanks
(This post was last modified: Yesterday 05:04 by dazz87.)
find quote
Post Reply