Giter VIP home page Giter VIP logo

kanzi's Introduction

Kanzi: Alexa Integration With Kodi

Build Status

Documentation

Visit the documentation here to learn how to setup this skill.

About

This is a skill for Amazon Alexa that allows you to control one or more instances of Kodi with your voice.

The process of setting up the skill may seem daunting at first, but the reward -- we feel -- is well worth the effort. If you carefully follow the directions to the tee, you might find it is not as complicated as it seems.

Unfortunately, as of this moment, we cannot simply ship this skill normally as other skills on Amazon's skill marketplace. The main technical hurdle is that some features we would need are currently only supported in the US region. Beyond that, there is the consideration of cost for hosting the skill and the associated database backend. Do try to keep in mind that this is a hobby project for the developers -- we do not get paid in any way.

However, we have made every effort to here to provide clear and concise documentation to allow you to make use of this skill now.

Supported Commands

Most everything you can do with a remote or keyboard is supported in the skill, and more:

  • Basic navigation (Up/Down, Left/Right, Page Up/Down, Select, Back, Menu, Zoom, Rotate, Move)
  • Open library views (Movies, Shows, Music, Artists, Albums, Music Videos, Playlists)
  • Open library views by genre (Movies, Shows, Music, Music Videos)
  • Open recently added playlists (Movies, Episodes, Albums, Music Videos)
  • Playback control (Play/Pause, Skip, Previous, Stop, Step/Jump)
  • Adjust volume
  • Shuffle all music by an artist
  • Play/Shuffle specific album
  • Play/Shuffle the latest album by an artist
  • Play a specific song
  • Play/Shuffle audio and video playlists
  • "Party mode" for music (shuffle all)
  • Play/Shuffle music videos
  • Play/Shuffle music videos from a specific genre
  • Play/Shuffle music videos by a specific artist
  • Shuffle all episodes of a TV show
  • Play random TV show
  • Play random TV show from a specific genre
  • Play random episode of a specific TV show
  • Play specific episode of a TV show ('Play season 4 episode 10 of The Office')
  • Play random movie
  • Play random movie from a specific genre
  • Play specific movie
  • Play trailer for a movie in your library (requires plugin.video.youtube addon)
  • Play random music video
  • Play random music video from a specific genre
  • Continue watching next episode of last show that was watched
  • Play next episode of a show
  • Play newest episode of a show
  • Recommend media to watch/listen to
  • List/Play recently added media
  • List available albums by an artist
  • Clean/Update video and audio sources
  • "What's playing?" functionality for music, movies, and shows
  • Report time remaining on current media and when it will end
  • Cycle through audio and subtitle streams
  • Search for something in your library (requires script.globalsearch addon)
  • Execute addons
  • Shutdown/reboot/sleep/hibernate system
  • Toggle fullscreen
  • Eject media
  • Send text

Instead of providing the exact verbiage here for each command, we strive to make the experience as natural as we can. Simply try asking for what you want in a way that feels right to you. If a particular phrase doesn't work and you think it should, see Getting Help to notify us and we will see what we can do to accommodate the phrase you prefer.

Kanzi in Action

Getting Help

If you need help getting a server going or configuring the Skill, please visit the support thread on the Kodi forum.

If you run into an actual issue with the code, please open an Issue here on Github; however, most issues you might run into will be a result of the complexity of the installation, so we urge you to first search the support thread for your issue. If you cannot find a resolution for your issue with a search, post there and someone will help you determine if your problem lies within the skill code or your particular configuration.

Contributors

I would like to thank and name all the contributors who have donated their precious time and talents to improving this skill:

Donate

Buy Me A Coffee

Developer Discussion

If you're interested in chatting with us about the development of the skill, we are on Slack.

kanzi's People

Contributors

danielmasur avatar digiltd avatar ghlynch avatar jagsta avatar jean-gui avatar jingai avatar kuruoujou avatar m0ngr31 avatar nemik avatar pataquets avatar ruben0909 avatar signal-alesieur avatar succo69 avatar sveni-lee avatar yantcaccia avatar zanix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kanzi's Issues

Do I have {title} (artist/album/movie/show)?

Debating if this should be separate from the DoSearch intent or not. I don't really have a preference one way or the other, so I figured I'd make this an Issue for people to discuss it.

My gut is telling me we should have a generic alexa_search() method that searches all content in some reasonable order (e.g., Artists -> Albums -> Songs -> Movies -> Shows -> Episodes).

It would then be nice if everything just pointed to alexa_search(), but that would obviously slow things down, so we need to think this through.

I suggest that this particular Issue be the fulcrum for that change.

Player.Seek

This should support seeking by time (e.g., +/- 5, 10, 30, 60, 600 seconds, etc) and chapters.

If possible, we could respect the user's configured seek granularity.

SyntaxError: invalid syntax - Error when running deploy-to-lambda.py

Evening guys,

Getting the error shown below when running "python deploy-to-lambda.py"

C:\Users\smcal\Desktop\kodi-alexa-master>python deploy-to-lambda.py
  File "deploy-to-lambda.py", line 34
    print subprocess.Popen("lambda-deploy deploy", shell=True, stdout=subprocess.PIPE).stdout.read()
                   ^
SyntaxError: invalid syntax

EDIT: Resolved my initial error, now getting the above

Can you shed any light on it/Point me in the right direction?

Thanks

Validation fails on AWS Lambda

The validation fails when using the latest master branch.

Verifying application ID...
global name 'verifier' is not defined: NameError
Traceback (most recent call last):
File "/var/task/wsgi.py", line 1289, in lambda_handler
verify_appid(appid)
File "/var/task/wsgi.py", line 1272, in verify_appid
except verifier.VerificationError as e:
NameError: global name 'verifier' is not defined

As a quick fix I replaced:

  # Verify the application ID is what the user expects
  verify_appid(appid)

with

  # Verify the application ID is what the user expects
  if (event['session']['application']['applicationId'] != env('SKILL_APPID') ):
      raise ValueError("Invalid Application ID")

This validates the appid without too much fuss.

An advantage of the app being hosted on AWS Lambda is cert verification is not needed.

From the docs (source) :

You do not need to verify that requests are coming from the Alexa service yourself. Access to execute your function is controlled by permissions within AWS instead.

I know we have discussed this briefly before (#32) about how it adds a lot of extra weight to the package (10mb). It also adds a bit more complication to the setup. Using lambda-deploy deploy to deploy will only install the dependencies listed in requirements.txt. When testing my PIP couldn't find OpenSSL, not sure if this is a platform thing (macOS here) but when I replaced it with pyopenssl it was able to install allllll the packages it required.

error when trying to play random movie

I am guessing it might be to do with the recent Add WhatNewMovies intent. commit?

Let me know if you need more information other than the error message below

 indices must be integers, not str: TypeError
Traceback (most recent call last):
  File "/var/task/wsgi.py", line 1224, in lambda_handler
    return on_intent(event['request'], event['session'])
  File "/var/task/wsgi.py", line 1192, in on_intent
    return one_intent[1](intent_slots)
  File "/var/task/wsgi.py", line 789, in alexa_play_random_movie
    if not 'movies' in movies['result']:
TypeError: list indices must be integers, not str

AWS lambda-deploy error

I set all my variables in my .env file but when I run lambda-deploy deploy I get the following error:

botocore.exceptions.NoRegionError: You must specify a region.

deploy-to-lamda.py invalid syntax

I am completely new to this so forgive me if this is obvious but trying to run the set up for AWS when I run the command "python deploy-to-lambda.py" I get invalid syntax on line 34.

Any idea what I am doing wrong?

python-Levenshtein is C based and doesn't install on AWS

I was getting this warning when I did any searching

warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')

It doesn't appear to affect the fuzzy searching. Testing with are tehre any new episodes of bubs bougers reports back There is one unseen episode of bubs bougers

The problem is python-Levenshtein is a wrapper for a Levenshtein C Lib. Whilst it appears possible though a lot of faffing to install it on AWS I don't think it is worth it.

@jagsta @jingai Curious to know if there is any difference in speed locally with and without the python-Levenshtein dependency?

On AWS the bubs bougers test from start to finish took 668.68 ms with a library of 35 shows. and is there a new episode of the flushe took 714.42 ms

Sending request to 127.0.0.1:8080

have set all variables in .env but each time i test the intent it fails.

looking in the function logs within AWS - it picks up the intent but then forwards it to local host:

Requested intent: CurrentPlayItemInquiry
Currently playing item
Sending request to 127.0.0.1:8080
END RequestId: 7211f463-9b8a-11e6-8032-e7dd52ef232c

Has anybody else seen this?

Have created a new .env file and re-deployed but the issue persists

trakt

sorry to write this here, but is there any way to add trakt to this skill, so trakt works the same as if it was plaing a movie/tv show from the library ?
just in case some one library is messed up ?

[to-do] have a look at the new Built-in Intent Library

I know not technically an issue but might be worth sticking on the todo list.

Not sure if you have seen the new Built-in Intent Library that is in development, but it looks like it could drastically affect things (for the better). Have a look, it might be worth holding off the global search features for a little while.

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/built-in-intent-library#music

It's more than a little annoying they are only available to US developers at the moment so i can't have a play.

On the surface they look very impressive and the days of creating custom slot data could be behind us.

problems

when i run python deploy-to-lambda.py
2017-01-02 23:04:00:INFO:botocore.credentials: Found credentials in shared credentials file: ~/.aws/credentials
2017-01-02 23:04:00:ERROR:lambda_deploy: Missing AWS Role
2017-01-02 23:04:00:ERROR:lambda_deploy: Invalid arguments.

my .env file is:

KODI_ADDRESS = mykodiaddress
KODI_PORT =8080
KODI_USERNAME = myusername
KODI_PASSWORD = mypassword
LAMBDA_ENV_VARS = KODI_SCHEME,KODI_ADDRESS,KODI_PORT,KODI_SUBPATH,KODI_USERNAME,KODI_PASSWORD,SKILL_APPID,SKILL_TZ
[default]region = eu-west-1
AWS_DEFAULT_REGION = eu-west-1
LAMBDA_TIMEOUT = 60
LAMBDA_MEMORY_SIZE = 128
LAMBDA_HANDLER = wsgi.lambda_handler

AWS_ACCESS_KEY_ID = myaccesskey
AWS_SECRET_ACCESS_KEY = mysecretkey
LAMBDA_ROLE = my role

can anyone help?

Tv Shows with a (written) number in title

Hi shows that have a written number in the title aren't found for Example Brooklyn Nine Nine and Hawaii Five-O.

In the log it is searching for Brooklyn 99 and hawaii 5 o

Verbiage request: Add "newest" as a substitute for "latest"

Would like to request that the word "newest" be added to equate to "latest"

IE: "Alexa, tell the media center to play the NEWEST episode of the flash"

Currently that phrase will error, but if repeated with LATEST, will go through fine.

i18n (Internationalisation)

Amazon Echo is going on sale on the 26th of october.
I'm already on translation the utterances files and will open a PR once I have the Echo and got it testing.

But I bet theres a whole lot to do about exporting all of Alexas responses into a seperate file rather than having them hard coded in the main wsgi.py file.
I'm nowhere near capable of doing this change or suggest any way to program this, but I will be able to translate Alexas responses into German.

I'm attaching Amazon provided documentation on this Topic:

REQUEST: Read off recent additions

If possible, would like the ability to have Alexa read off XX number of episodes/movies/music from the recently added.

"Alexa ask kodi what episodes have been recently added"
"...what movies have been recently added"
"...what music has been recently added"

Not sure if it could gather this from the library itself or if it would need some sort of SQL integration.

Error running python deploy-to-lambda.py

Just upgraded to the latest version and trying to run the

python deploy-to-lambda.py

command and getting a crash:

building 'Levenshtein._levenshtein' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/Levenshtein

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-2.7/Levenshtein/_levenshtein.o

Levenshtein/_levenshtein.c:99:20: fatal error: Python.h: No such file or directory

#include <Python.h>

                ^

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;file='/tmp/pip_build_xxxxx/python-Levenshtein/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-MOZqaw-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmpPtk0sw failed with error code 1 in /tmp/pip_build_xxxxxpython-Levenshtein

Multiple Instances of Kodi

Many thanks for your previous help previously, all not up and running on one device.

I have kodi set up in a second room. Is there an easy way to set up two instances? I can set up another skill with a different invocation name but I assume it would have to refer to a different instance of kodi-alexa on lambda with different port/login details etc. The bit I cannot work out is how to change the name of the function in the deploy stage so that is newname-alexa not kodi-alexa.

I suspect this may be simple but as said before I am very new to this!

Thanks in advance.

Kodi Voice integration w/o Alexa

Hey m0ng31,

I really like your program. First of all I have to tell you I'm kinda noobish. I currently have a HT set-top box with openelec (Kodi), a Raspberry Pi running a voice command program (like Alexa) called PiAUISuite by Steven Hickson. I'm using SSH to successfully send commands from the Pi to Kodi, however I would like to use your program to send them. In PiAUISuite I have the command:

Kodi ==curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://192.168.15.141:90/jsonrpc

where the left side is what I say and the right the command.

I would like to know if there's a way to modify your program in order for me to write it in the command line followed by the command I said (play, pause, etc.)

Thanks

Application.Quit

Unable to add a Quit intent to quit Kodi, because Amazon intercepts quit, exit, and close as requests to end the session.

Unless someone can think of an alternate way to invoke this, we'll probably have to settle for just Shutdown (which can be mapped in Kodi to Quit).

AWS Variables confusion

Can you please help me to understand how to accomplish this, "Now, go back to the console and make sure you are in the directory with this code in it. Run the following commands:" (context below)

AWS variables

To get to the options for the AWS variables, log in to the AWS console and browse to Identity and Access Management. Once in there, navigate to the "Users" tab and look for an existing user. If there isn't one, go ahead and create a new one. Once you see a user there, click on it and go to the 'Security Credentials' tab. Then click on 'Create Access Key'. This will only show once, so make sure you copy the Access Key and Secret Access Key before you close the modal. Paste these values into the .env file.

Next, click on the 'Roles' tab on the right. Here, you're going to create a new role that will be just used for running Lambda functions. What name you give it doesn't matter, but when asked for policies, make sure you select "AWSLambdaFullAccess". After that's been created, copy the "Role ARN" value to the .env file under "LAMBDA_ROLE". It'll look something like "arn:aws:iam::11111111111:role/lambda" depending on what you named it.

Now, go back to the console and make sure you are in the directory with this code in it. Run the following commands:

pip install lambda-deploy

python deploy-to-lambda.py

regards,
matt

Changelog/Contributing discussion

I wanted to open this up and get opinions on what the policies for these are. I originally wanted the changelog to discuss new features. I don't see an issue with using something like semver for as many small features that are added. This gets a little tricky when there are 4 or 5 PRs open at once, so maybe there should be an version number increase when a few things have been merged at a time.

I didn't want it to become a alternative for git log. I was just hoping for something simple for people who maybe aren't developers or don't use git on a regular basis to see the current features vs what they have now.

We should probably start using tags on new releases as well so it's easier to help see where someone is at if they have a problem.

Problem running under Apache? or perhaps some bug?

I'm not sure if this is a problem with running your code under Apache mod_wsgi or if it is an actual bug.

Some times it works when I use the skill, but other times I get this;
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] mod_wsgi (pid=22558): Exception occurred processing WSGI script '/var/www/kodi-alexa/wsgi.py'.
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] Traceback (most recent call last):
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/wsgi.py", line 673, in application
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] output = h[1](environ, start_response)
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/wsgi.py", line 643, in do_alexa
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] response = one_intent1
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/wsgi.py", line 213, in alexa_play_pause
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] kodi.PlayPause()
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/kodi.py", line 161, in PlayPause
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] playerid = GetPlayerID()
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/kodi.py", line 65, in GetPlayerID
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] info = SendCommand(RPCString("Player.GetActivePlayers"))
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/var/www/kodi-alexa/kodi.py", line 51, in SendCommand
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] return json.loads(r.text)
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/usr/lib/python2.7/json/init.py", line 338, in loads
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] return _default_decoder.decode(s)
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] obj, end = self.raw_decode(s, idx=_w(s, 0).end())
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] raise ValueError("No JSON object could be decoded")
[wsgi:error] [pid 22558] [client 72.21.217.78:10552] ValueError: No JSON object could be decoded

Funny thing is if I keep trying the request it will eventually work.
What do you think?

Oh, and thanks for what looks like a very nice skill - except for that problem I'm having:)

lambda-deploy fails due to incorrectly named .env file

the lambda-deploy file fails because it is looking for a file called .env - not .env.lambda , I figured it out and renamed the file, and I'm sure there is a good reason for having the two .env files so you can switch between them, but your install guide should recommend renaming one of the files to .env in order for it to work (in windows you have to do this in the command prompt - not explorer.

Application.SetVolume

This is going to require a bit of thought.

We'd want to add volume up/down as well as the ability to set an absolute volume (0-100). For volume up/down, we'll need to determine what is an acceptable granularity (10? 20?).

Additionally, we can support something like "set volume low/medium/high".

@digiltd has some existing code over at bwssytems/ha-bridge#193 that might be of use here.

Note that this issue and the implementation of it are only to support adjusting Kodi's volume, not any connected A/V equipment.

New Shows not recognized

As mentioned with #40, new shows are not being detected correctly prior to adding to the interaction model. Ran across this issue again with a new show that does not have a number in the title.

The show is titled "Letterkenny", which when requesting to play via the skill is continuously playing different shows like "Leverage" or "Luther". When attempting to wikipedia Letterkenny via Alexa there is no issue what so ever with the recognition of the word.

Upon addition of "Letterkenny" to the interaction model of the skill there is no longer any issue recognizing the title of the show.

Shuffle really large playlists

This is more of a Kodi limitation, but documenting it here for possible future fix/workaround.

Kodi's JSON interface doesn't pay attention to the "shuffled" option when opening playlists. So, in the skill, we use the Files.GetDirectory method to retrieve every item from a playlist, shuffle it, and then add it to the appropriate transient playlist (id 0 or 1).

However, it seems Kodi has a limit to the number of items it can receive in a single Playlist.Add call. This means that shuffling really large playlists will just outright fail.

In practice, this isn't a massive problem because for most really large playlists users are going to want to shuffle them by default, which you can do in the playlist settings in Kodi. But, if the user tells Alexa to "shuffle" the playlist instead of "play/listen to/watch," it will fail even if the playlist is auto-randomized by Kodi.

One solution I can think of is to break up the array into chunks that won't cause Kodi to fail on the request; i.e., make multiple Playlist.Add calls.

Ultimately though, with the large playlists I'm referring to, the whole operation takes ages to complete anyway. It'd be best if Kodi would simply allow us to say "shuffle playlist X," but it doesn't currently and it's been years that it's been asked for.

I'm mostly looking for some discussion around the issue here to see what we might be able to do about this in the skill. Even if we can't do anything, I think having this Issue open will at least serve as a reference point when we get complaints about the behavior.

Kodi SLOTS

I want to ask a question, so I see that the SHOWS slot has my tvshow names in it...

If I have added a new show to my kodi, do I need to add the show name to SHOWS slot? or will something update itself at some point?

Thanks

New shows not detected

After adding a new show to my library the skill can not find it. Says no show with that name found in spite of it listing the show in the WhatNewShows check.

Add certificate, URL, and AppID verification

The skill should verify before continuing on:

  • Application ID
  • Incoming request is from Amazon
  • Certificate URL comes from Amazon
  • Timestamp of certificate is valid
  • Certificate signature can be verified

I have code for all of this, but I need to factor it out of my other local changes.

Subtitles can be enabled/disabled but not downloaded

Don't know where to suggest this, so I hope it's okay I'm posting it here:

I am missing the option to download a subtitle. If I'm not mistaken, the code would be:

def SubtitlesGet():
playerid = GetVideoPlayerID()
if playerid:
return SendCommand(RPCString("GUI.ActivateWindow", {"window":"subtitlesearch"}))

with alexa.intents:
{
"intent": "SubtitlesGet",
"slots": []
},

and alexa.utterances:
SubtitlesGet download subtitles
SubtitlesGet get subtitles
SubtitlesGet find subtitles

(Since I have no GitHub experience, I am definitely not trying to implement this myself, haha)

Slot generator can't validate my kodi server info

Hey, sorry if this isn't the right place to post this, but I've been banging my head off a brick wall with https://slot-generator.herokuapp.com/ and also with generate_custom_slots.py. Neither can connect to my kodi server.

Now obviously the assumption would be that I haven't set up my kodi webserver properly, but I'm 99% certain I have. It's on port 8080, it's definitely accessible from the internet (I used an open port checker tool and I've visited the page via a VPN), I've tried with both my ip and with my dynamic DNS address. I can access the /jsonrpc file on the server. The python script generate_custom_slots.py just keeps sending request to that file with no success. It does this even if I define the kodi server address as an internal ip and disable credentials completely.

As for the slot generator site, it says "Please validate your server information and try again" no matter what. This also happens when I disable credentials.

Is there anything I haven't tried?

Destructive commands should require confirmation

Hibernate, Reboot, Shutdown, Suspend.

Since they can be destructive (loss of user's work in other applications), Alexa should probably prompt with "Are you sure you want to do this?". But this requires keeping track of the session, which we don't currently do.

Planned new commands

I'm planning on implementing support for the following. I figured it was worthwhile to make the list public so as to avoid overlapping work if you're already working on any of them and to discuss implementation details.

Power commands

  • System.Hibernate
  • System.Reboot
  • System.Shutdown
  • System.Suspend
  • Application.Quit

Misc commands

  • System.EjectOpticalDrive
  • Application.SetMute
  • GUI.SetFullscreen
  • Application.SetVolume

Addon commands

  • Addons.GetAddons (to fetch list to match against slot)
  • Addons.ExecuteAddon

Player commands

  • Player.SetSubtitle (e.g., "Alexa, tell kodi enable/disable/toggle/turn on/turn off subtitles", "Alexa, tell kodi to use/switch to next/previous subtitle")
  • Player.SetAudioStreem (e.g., "Alexa, tell kodi to use/switch next/previous audio stream/language")
  • Player.Seek

Clean video library broke

Now when requesting to clean the video library it triggers a "home menu" command, then updates the library, rather than just cleaning it. Im sure the updating is normal as that seems to have started before hand, but the cleaning never happens anymore.

Thanks for the updates!!!

Warning: use LAMBDA_ENV_VARS instead ?

First off, thanks for a great solution - i have AWS knowledge from work so this wasn't too much to get my head around but we don't use Lambda...

Everything is working when i don't use a password on my kodi webserver. When i enabled the password that is set in the env file - i get Alexa failing to control and she says - There was a problem with the expected skills response.

When i set things up i got this error - but seeing as it clearly picked up my hostname and port etc i figured it was erroneous. I've now enabled the password again, and re-deployed, but same error and alexa says the same thing.

WARNING:lambda_deploy: Skipping inclusion of of .env file - use LAMBDA_ENV_VARS instead (see documentation for more information)

Im looking for the documentation for LAMBDA_ENV_VARS but failing. Can you point me in the right direction?

CurrentPlayItemTimeRemaining and local time

The CurrentPlayItemTimeRemaining intent will return the time at which the currently playing item will end relative to local time on the server. This works out if the server is located in the same time zone as the Kodi installation, but for cloud deployments of the skill this probably is often not the case.

I couldn't find a way to get at the time zone information of the Echo device from which the request originated, so my initial thought was to make an environment variable in which the user could specify his/her time zone.

Raising this as an issue to see if anyone has any better ideas, though.

It might also be the case that Heroku/Lambda/etc have a built-in mechanism for setting the time zone?

An error occured (InvalidSignatureException) when calling CreateFunction operation: Signature expired: 20161127T140255Z is now earlier than 20161127T141105Z

I've been trying to deploy this to AWS for days now after getting my amazon echo here in the Philippines. But I cant get it to work. I have followed every step but every time I run C:\Python27\Scripts\lambda-deploy.exe deploy. I always get this message. I have little knowledge about this and I badly want this to work. I hope someone can help me fix this problem. Thanks!

ValueError: No JSON object could be decoded.

Hi, great looking project. I've just installed kodi and kodi-alexa clean today on ubuntu. When I try to do kodi.GetMovie() or anything similar I get the error "No JSON object could be detected". As such I haven't been able to generate the slot values for the skill yet. Any ideas?

SetShuffle/SetRepeat commands

We'll need to think about SetShuffle a bit, and by extension, SetRepeat. We already have:

  • shuffle all music
  • shuffle (/music by/artist) {Artist}
  • shuffle playlist {Playlist}

An invocation that isn't either confusing or overlapping the above might be difficult to think of..

So, options would be one of:

  1. don't add SetShuffle/SetRepeat,
  2. alter the invocation of the existing shuffle commands,
  3. think of something that makes sense and coexists in the current schema.

I'm kind of leaning toward 1, since if it ends up even a little bit confusing, it ends up being a command users avoid altogether.

Navigation commands in one session

I was just playing with keeping the session alive for navigating around the different menus. I'm not sure if it's a skill issue or something else, but I couldn't get it to keep alive past like 5 commands. Can anyone give this a shot and see what their's does? @jingai

Deploying to Lambda using a Raspberry Pi

Using a raspberry pi 2, python deploy-to-lambda.py produces a "MemoryError"

pi@raspberrypi ~/kodi-alexa $ sudo python deploy-to-lambda.py 2016-12-16 14:37:03:INFO:botocore.credentials: Found credentials in environment variables. 2016-12-16 14:37:04:INFO:lambda_deploy: Packaging lambda kodi-alexa 2016-12-16 14:37:04:WARNING:lambda_deploy: A .env file exists in your Lambda directory - be careful that it does not contain any secrets you don't want uploaded to AWS! 2016-12-16 14:37:04:WARNING:lambda_deploy: Skipping inclusion of of .env file - use LAMBDA_ENV_VARS instead (see documentation for more information) 2016-12-16 14:38:43:INFO:botocore.vendored.requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): lambda.us-east-1.amazonaws.com 2016-12-16 14:38:44:INFO:lambda_deploy: Adding new kodi-alexa lambda Traceback (most recent call last): File "/usr/local/bin/lambda-deploy", line 9, in <module> load_entry_point('lambda-deploy==0.1.2', 'console_scripts', 'lambda-deploy')() File "/usr/local/lib/python2.7/dist-packages/lambda_deploy/lambda_deploy.py", line 376, in main method() File "/usr/local/lib/python2.7/dist-packages/lambda_deploy/lambda_deploy.py", line 215, in deploy Publish=True File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 251, in _api_call return self._make_api_call(operation_name, kwargs) File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 513, in _make_api_call api_params, operation_model, context=request_context) File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 566, in _convert_to_request_dict api_params, operation_model) File "/usr/local/lib/python2.7/dist-packages/botocore/validate.py", line 272, in serialize_to_request operation_model) File "/usr/local/lib/python2.7/dist-packages/botocore/serialize.py", line 416, in serialize_to_request serialized, shape, shape_members) File "/usr/local/lib/python2.7/dist-packages/botocore/serialize.py", line 461, in _serialize_payload partitioned['body_kwargs'], shape) File "/usr/local/lib/python2.7/dist-packages/botocore/serialize.py", line 527, in _serialize_body_params return json.dumps(serialized_body).encode(self.DEFAULT_ENCODING) MemoryError Downloading/unpacking requests (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 1)) Running setup.py egg_info for package requests warning: no files found matching 'test_requests.py' Downloading/unpacking gunicorn (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 2)) Running setup.py egg_info for package gunicorn warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Downloading/unpacking yaep (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 3)) Downloading yaep-0.0.6.tar.gz Running setup.py egg_info for package yaep warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Downloading/unpacking pycountry (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 4)) Running setup.py egg_info for package pycountry warning: no previously-included files matching 'src/pycountry' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution Downloading/unpacking pytz (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 5)) Running setup.py egg_info for package pytz Downloading/unpacking fuzzywuzzy (from -r /home/pi/kodi-alexa/kodi-alexa/requirements.txt (line 6)) Downloading fuzzywuzzy-0.14.0.tar.gz Running setup.py egg_info for package fuzzywuzzy Installing collected packages: requests, gunicorn, yaep, pycountry, pytz, fuzzywuzzy Found existing installation: requests 0.12.1 Uninstalling requests: Successfully uninstalled requests Running setup.py install for requests warning: no files found matching 'test_requests.py' Running setup.py install for gunicorn warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' SyntaxError: ('invalid syntax', ('/tmp/tmpzRVaV3/lib/python/gunicorn/workers/_gaiohttp.py', 84, 26, ' yield from self.wsgi.close()\n')) Installing gunicorn_paster script to /tmp/tmpzRVaV3/bin Installing gunicorn script to /tmp/tmpzRVaV3/bin Installing gunicorn_django script to /tmp/tmpzRVaV3/bin Found existing installation: yaep 0.0.6 Uninstalling yaep: Successfully uninstalled yaep Running setup.py install for yaep warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Running setup.py install for pycountry warning: no previously-included files matching 'src/pycountry' found anywhere in distribution warning: no previously-included files matching '*.pyc' found anywhere in distribution Running setup.py install for pytz Running setup.py install for fuzzywuzzy Successfully installed requests gunicorn yaep pycountry pytz fuzzywuzzy Cleaning up...

This is related to the python deploy-to-lambda.py trying to pip install the requirements in requirements.txt.
Rpi is limited on memory and Pip is trying to read everything into memory before caching it -
This can be overcome using "pip install <package_name> --no-cache-dir" ?

Reference: http://stackoverflow.com/questions/29466...matplotlib

Reverse order of operations when cleaning library & timeout time

(I'll preface this by saying I am now running a MySQL backend, vs a local library, so this could very well be the reasoning behind this)

So I noticed that whenever you want to clean the library, it will also update it afterwards. Was wondering that if you keep them paired that you could possibly reverse the order?

I only ask because if something has updated the quality of a video and replaced it with one that technically has a different file name, that you lose your "played" status. Basically this is because the file entry is removed, then added on the update. If it triggered the update first, it would catch this and keep the played status, then when cleaning remove the old entry, but keep the status. This happens a lot with me as I have Sonarr and Couchpotato actively updating qualities when they become available. Due to this, everything starts showing up as unwatched.

Also, is there a way to modify it's response time when cleaning? 80% of the time my library is still running through a cleaning when the echo decides to stop waiting and trigger a "skill failed to respond" error, though its actually working.

Intents File - Missing Intents?

Trying to set this up and receiving the following error:

Error: There was a problem with your request: The intent 'DoSearch' was not found in the domain definition. Occurred in sample 'DoSearch search for {Artist}' on line 203.

TV Show Issues

Having a few issues with episode playing on a number of shows:

  1. Saying "Alexa, ask Kodi to play the next episode of Making a Murderer (or Strike Back)" does nothing. However, saying "Alexa, ask Kodi to play the next episode of Big Band Theory (or Rome)" works fine. Seems to be random
  2. Saying "Alexa, ask Kodi to play Season 1 Episode 8 of Rome" comes back with "Sorry, something went wrong". Some shows work, most don't (note the play next episode utterance works find for this show)
  3. Saying "Alexa, ask Kodi to play the latest episode of Making a Murderer (or Strike Back)" starts to play my last played music playlist on the Echo? However, saying "Alexa, ask Kodi to play the latest episode of Big Band Theory (or Rome)" works fine. Seems to be random again...
  4. Strangely, if I say "Alexa, ask Kodi are there any new episodes of Making a Murderer (or Strike Back)" I get an immediate reply with the unwatched episode count. Same with "Alexa, ask Kodi to play an episode of Making a Murderer (or Strike Back)" and it plays a random episode every time. So this doesn't seem to be an issue with the name of the show being recognized

Seems to be an issue with the "PlayEpisode" and "PlayNextEpisode" intents. I've tried to test everything I can using 4-5 shows and utterances. As mentioned, some shows are fine, others fail with a spoken "Something went wrong" or nothing happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.