• 1
  • 69
  • 70
  • 71(current)
  • 72
  • 73
  • 176
Release Kanzi: Amazon Alexa skill for Kodi
(2017-02-14, 17:30)elocm2 Wrote: I try to get all albums from one artist. The Script calls the list of all registered artists. My Kodi answer this request with 12000 artists and the ID end with something about 15000. The answer has 800kByte. Kodi answer in less than a second, but on my pyscript it looks like the answer does not fit in memory or there is something else wrong, anyhow the script timeout and did not move forward. Checked with some additional print inside the wsgi.py that artists = kodi.GetMusicArtists() is the last thing the script is doing

This is a known problem and we're working on it. Basically, Kodi has an internal limit on how large the responses can be, and music frequently can exceed this limit.
Reply
(2017-02-14, 16:54)bill_orange Wrote:
(2017-02-14, 15:18)popy Wrote: Guys, i have setup the skill now and when i am tzesting it on the skill page it recogines my utterance question:

Question "Welche serien gibt es" (english: which seriesdo i have)

Service request is:

Code:
{
  "session": {
    "sessionId": "SessionId.[removed]",
    "application": {
      "applicationId": "amzn1.ask.skill.[id removed ]"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.[ID removed]"
    },
    "new": true
  },
  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.[removed]",
    "locale": "de-DE",
    "timestamp": "2017-02-14T13:14:05Z",
    "intent": {
      "name": "WhatNewShows",
      "slots": {}
    }
  },
  "version": "1.0"
}

The name is "WhatNewShows" which should be correct, isnt it?
Sadly the service resoponse is:

Code:
The remote endpoint could not be called, or the response it returned was invalid.

In the cloud log on this is it:

Code:
Sending request to http://[host]:[port]/jsonrpc

No JSON object could be decoded: ValueError
Traceback (most recent call last):
File "/var/task/wsgi.py", line 1933, in lambda_handler
return on_intent(event['request'], event['session'])
File "/var/task/wsgi.py", line 1900, in on_intent
return one_intent[1](intent_slots)
File "/var/task/wsgi.py", line 1410, in alexa_watch_next_episode
shows = kodi.GetTvShows()
File "/var/task/kodi.py", line 724, in GetTvShows
return SendCommand(RPCString("VideoLibrary.GetTVShows"))
File "/var/task/kodi.py", line 143, in SendCommand
return json.loads(r.text)
File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

The host is online and i can reach it from the internet! Also the slot generator works, so my port forwarding should be fine.
Any hint what i am doing wrong?

thanks
pOpY

There's a cloud log! That would really be helpful. I have made revisions to kodi.py to do a couple of other home automation operations I need. There is a Try / Except structure in a Def that I can not get to work right. A look at the log would be a help.

How to you navigate to the log?

Bill

What home automation stuff are you trying to integrate?

There is an addon for kodi called "kodi callbacks" that lets you trigger stuff at specified states (on pause, on resume, on stop etc). I use that to tell openhab to dim the lights when playing a movie. It's in the official kodi repo.
Reply
(2016-12-20, 11:41)zaraki7 Wrote: @fergalom I found the way to make it work manually zipping and uploading all the necessary files to the lambda server but i'm definitly gonna try your way thnx.Once all done I'm gonna do a tutorial for people like me who got no knowleges in lambda use.

Is it possible to toggle Alexa invocation name? I mean instead of saying all the time "alexa tell kodi to..." say it once and then release it with any word like"goodbye".

@zaraki7 can you explain in steps how did you manually did it? I have the same problem on my Raspbian with MemoryError. I also tried --no-cache-dir but no luck.
Reply
(2017-02-13, 15:53)digiltd Wrote:
(2017-02-12, 17:50)mreedy Wrote: I am using the New Fire Stick w/ Alexa Voice Remote.

And you have the Skill enabled on the Fire Stick? i.e. you can see it when you use the Alexa app > Skills > My Skills?

I don't know much about the Fire Stick but from what I have read it seems it should be compatible with all the Skills from the skill store and the Dev blog mentions that you can test Skills on the Fire Stick.

Are you running Kodi on the stick as well?

Yes I have the skill enabled and yes I can see it in my skills in the Alexa app. Kodi is on the Fire Stick and is working well by itself. I just cannot get the voice commands to work with it.
Reply
(2017-02-14, 23:34)amilino Wrote:
(2016-12-20, 11:41)zaraki7 Wrote: @fergalom I found the way to make it work manually zipping and uploading all the necessary files to the lambda server but i'm definitly gonna try your way thnx.Once all done I'm gonna do a tutorial for people like me who got no knowleges in lambda use.

Is it possible to toggle Alexa invocation name? I mean instead of saying all the time "alexa tell kodi to..." say it once and then release it with any word like"goodbye".

@zaraki7 can you explain in steps how did you manually did it? I have the same problem on my Raspbian with MemoryError. I also tried --no-cache-dir but no luck.

Also had this "Memory Error" issue and tried to resolve it, burt no luck on RPi.
I have downloaded an VDI of ubuntu 16.10 from osboxes.org for virtualbox.
On ubuntu i had no issues with deploying the code to AWS.

pOpY
Reply
(2017-01-09, 23:01)digiltd Wrote: @Gibsarno

Ok, I think all caps for PYTHON --VERSION was causing it to fail. I can see it is installed from the error message for pip.

The short answer is it is a permissions issue. Your Python is installed in /Library which means you need to run the command as an admin user.

It is tricky to know what to recommend, there is a very simple answer which is run the
Code:
pip install lambda-deploy
command as a root user by putting "sudo" in front of it
Code:
sudo pip install lambda-deploy
.

Using sudo is very risky and especially if you do not know what you are doing. So I advise against it as you do not want to be installing anything in the system version of Python, though I think you may have already done so with pip.

You should not have to use sudo for python etc on mac. You do this by running "local" versions that are kept separate from the system version.

The easiest way to do this is by using homebrew http://brew.sh/

Follow the instructions on the homepage, you only have to copy and paste one line, but DO NOT use sudo to run it. Homebrew does a great job at keeping separate at a user level, so you should never use sudo.

After installing you run
Code:
brew install python

After you have done that and followed the instructions, close terminal and open it again. Try
Code:
which python
and
Code:
where python
and
Code:
which pip
Code:
where pip

What this does is ask "which is the version of python/pip ready to use?" and "where are the versions of python/pip on my system?"

You should see something like:

Image

If "which python" and "which pip" are both reporting /usr/local/bin/python then you can install lambda-deploy using

Code:
pip install lambda-deploy

Then fingers crossed, when you cd into your kodi-alexa-master folder, you should be able to run
Code:
python deploy-to-lambda.py
sucesfully.

I followed this after it not working on my OSX

I now get this:

Code:
MacBook-Air:~ mc$ pip install lambda-deploy
Collecting lambda-deploy
  Using cached lambda_deploy-0.1.2-py2-none-any.whl
Collecting boto3>=1.3.0 (from lambda-deploy)
  Using cached boto3-1.4.4-py2.py3-none-any.whl
Collecting yaep>=0.0.4 (from lambda-deploy)
  Using cached yaep-0.0.6-py2-none-any.whl
Collecting requests>=2.9.1 (from lambda-deploy)
  Using cached requests-2.13.0-py2.py3-none-any.whl
Collecting botocore<1.6.0,>=1.5.0 (from boto3>=1.3.0->lambda-deploy)
  Using cached botocore-1.5.11-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from boto3>=1.3.0->lambda-deploy)
  Using cached jmespath-0.9.1-py2.py3-none-any.whl
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3>=1.3.0->lambda-deploy)
  Using cached s3transfer-0.1.10-py2.py3-none-any.whl
Collecting docutils>=0.10 (from botocore<1.6.0,>=1.5.0->boto3>=1.3.0->lambda-deploy)
  Using cached docutils-0.13.1-py2-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1 (from botocore<1.6.0,>=1.5.0->boto3>=1.3.0->lambda-deploy)
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" (from s3transfer<0.2.0,>=0.1.10->boto3>=1.3.0->lambda-deploy)
  Using cached futures-3.0.5-py2-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore<1.6.0,>=1.5.0->boto3>=1.3.0->lambda-deploy)
  Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: jmespath, docutils, six, python-dateutil, botocore, futures, s3transfer, boto3, yaep, requests, lambda-deploy
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 377, in move_wheel_files
    clobber(source, dest, False, fixer=fixer, filter=filter)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/bin/jp.py'

Also when I ask "where python" or "where pip" I get:
Code:
-bash: where: command not found

But using "which python" or "which pip" it comes back as
Code:
/usr/local/bin/python
and
Code:
/usr/local/bin/pip


EDIT:

Used heroku instead and so far so good.
Reply
@T800

Is this the first time you have installed python via brew? Do you use python for anything else? Do you have any experience using the command line?

Do you remember doing something like installing pip before the brew version of python or did you use "sudo" during any part of setting up?

Maybe have a look here: http://docs.python-guide.org/en/latest/s...stall/osx/ but avoid just copy and pasting commands blindly, try to understand what each part is doing first.
Reply
(2017-02-15, 13:00)digiltd Wrote: @T800

Is this the first time you have installed python via brew? Do you use python for anything else? Do you have any experience using the command line?

Do you remember doing something like installing pip before the brew version of python or did you use "sudo" during any part of setting up?

Maybe have a look here: http://docs.python-guide.org/en/latest/s...stall/osx/ but avoid just copy and pasting commands blindly, try to understand what each part is doing first.

I have used command line before, set up some my unRAID towers and some Rpi's for different things, I get by with odd wrist slitting session.
I ended up trying the heroku way just now and seems to have done the trick. Thanks
Reply
I had this all working last week, but all of a sudden all I get now is a reply from Alexa saying "Error parsing results"... I have deleted and reinstalled everything, but still the same, any ideas what the reason for this is?

{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Error parsing results"
},
"card": {
"content": "Error parsing results",
"title": "Playing a random episode of arrow",
"type": "Simple"
},
"reprompt": {
"outputSpeech": {
"type": "PlainText",
"text": " "
}
},
"shouldEndSession": true
},
"sessionAttributes": {}
}
Reply
(2017-02-14, 23:11)digiltd Wrote:
(2017-02-14, 16:54)bill_orange Wrote:
(2017-02-14, 15:18)popy Wrote: Guys, i have setup the skill now and when i am tzesting it on the skill page it recogines my utterance question:

Question "Welche serien gibt es" (english: which seriesdo i have)

Service request is:

Code:
{
  "session": {
    "sessionId": "SessionId.[removed]",
    "application": {
      "applicationId": "amzn1.ask.skill.[id removed ]"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.[ID removed]"
    },
    "new": true
  },
  "request": {
    "type": "IntentRequest",
    "requestId": "EdwRequestId.[removed]",
    "locale": "de-DE",
    "timestamp": "2017-02-14T13:14:05Z",
    "intent": {
      "name": "WhatNewShows",
      "slots": {}
    }
  },
  "version": "1.0"
}

The name is "WhatNewShows" which should be correct, isnt it?
Sadly the service resoponse is:

Code:
The remote endpoint could not be called, or the response it returned was invalid.

In the cloud log on this is it:

Code:
Sending request to http://[host]:[port]/jsonrpc

No JSON object could be decoded: ValueError
Traceback (most recent call last):
File "/var/task/wsgi.py", line 1933, in lambda_handler
return on_intent(event['request'], event['session'])
File "/var/task/wsgi.py", line 1900, in on_intent
return one_intent[1](intent_slots)
File "/var/task/wsgi.py", line 1410, in alexa_watch_next_episode
shows = kodi.GetTvShows()
File "/var/task/kodi.py", line 724, in GetTvShows
return SendCommand(RPCString("VideoLibrary.GetTVShows"))
File "/var/task/kodi.py", line 143, in SendCommand
return json.loads(r.text)
File "/usr/lib64/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

The host is online and i can reach it from the internet! Also the slot generator works, so my port forwarding should be fine.
Any hint what i am doing wrong?

thanks
pOpY

There's a cloud log! That would really be helpful. I have made revisions to kodi.py to do a couple of other home automation operations I need. There is a Try / Except structure in a Def that I can not get to work right. A look at the log would be a help.

How to you navigate to the log?

Bill

What home automation stuff are you trying to integrate?

There is an addon for kodi called "kodi callbacks" that lets you trigger stuff at specified states (on pause, on resume, on stop etc). I use that to tell openhab to dim the lights when playing a movie. It's in the official kodi repo.

I will investigate the "Kodi Callbacks". They could be of some use for the sort of thing you describe. I found the cloud log eventually, Maybe it is just me, but I find the organization of the Amazon developer's resources, Lambda, etc. pretty non-intuitive.
Reply
(2017-02-14, 01:12)jingai Wrote: @popy, we have the skill translated to German already, but you'll need to wait for the 2.5 release. Hopefully soon!

Could you specify how "soon" it will be released (e.g. a week, a month, two months)? Cause I'm really looking forward to this.
Reply
(2017-02-14, 17:35)jingai Wrote:
(2017-02-14, 16:54)bill_orange Wrote: There's a cloud log! That would really be helpful. I have made revisions to kodi.py to do a couple of other home automation operations I need. There is a Try / Except structure in a Def that I can not get to work right. A look at the log would be a help.

I really don't recommend you do this, because we will be unable to provide support for you if you modify the code. Further, when you go to update the code as we release new versions, you will have to merge your own changes back in. Unless you are already familiar with branching and merging in git, this might prove difficult for you.

The best route for you would be to either make your own skill for your HA stuff, or use something like ha-bridge (which probably already has what you need anyway).

I fully agree with your advice. When the next revision comes out, I plan to abandon my personal forks. They are a stop gap while I learn enough to write my own skills. I have not found the python coding especially difficult but the integration of all the pieces of a skill seems really non-intuitive. Amazon's organization of their web sites is not much help. I am setting up skills to control (but not program) my opensprinkler sprinker controller, https://opensprinkler.com . I would also like Alexa to report the weather off of my personal weather station, http://orangecaweather.duckdns.org/weather . This can be done by reading the json string from my Wunderground report since the weather station itself can not send json strings on demand.

Studying your instructions and your code has been a big help. Although a largish chunk of code it is more readable than many of the smaller examples. I installed the Eclipse python / java editor. It is a big help. I am sure this is more perception than reality, but it makes me feel like I have put on my programming 'big boys' pants.

Can you point to any especially good python Alexa skill examples on GitHub?

I do have one other question. Why is the policy "AWSLambdaFullAccess” necessary and how does it differ from the basic policy? I tried to use the existing policy I had set up for the Kodi skill on a much simpler 'test' skill and it would not would test successfully although it would using the basic skill. I would have thought that the basic skill would be a subset of "AWSLambdaFullAccess” . This whole policy 'thing' seems pretty confusing and lacking in documentation.
Reply
(2017-02-15, 17:25)HartzF34R Wrote:
(2017-02-14, 01:12)jingai Wrote: @popy, we have the skill translated to German already, but you'll need to wait for the 2.5 release. Hopefully soon!

Could you specify how "soon" it will be released (e.g. a week, a month, two months)? Cause I'm really looking forward to this.

Take a look here: https://github.com/m0ngr31/kodi-alexa/tree/flask-ask
This is a work in progress branch with german translations Big Grin

I will set it up this evening and report back.

pOpY
Reply
(2017-02-15, 18:35)popy Wrote:
(2017-02-15, 17:25)HartzF34R Wrote:
(2017-02-14, 01:12)jingai Wrote: @popy, we have the skill translated to German already, but you'll need to wait for the 2.5 release. Hopefully soon!

Could you specify how "soon" it will be released (e.g. a week, a month, two months)? Cause I'm really looking forward to this.

Take a look here: https://github.com/m0ngr31/kodi-alexa/tree/flask-ask
This is a work in progress branch with german translations Big Grin

I will set it up this evening and report back.

Please bear in mind that this is still a work-in-progress as you noted. As such, some things may not yet work correctly.
Reply
(2017-02-15, 18:37)jingai Wrote:
(2017-02-15, 18:35)popy Wrote:
(2017-02-15, 17:25)HartzF34R Wrote: Could you specify how "soon" it will be released (e.g. a week, a month, two months)? Cause I'm really looking forward to this.

Take a look here: https://github.com/m0ngr31/kodi-alexa/tree/flask-ask
This is a work in progress branch with german translations Big Grin

I will set it up this evening and report back.

Please bear in mind that this is still a work-in-progress as you noted. As such, some things may not yet work correctly.

sure Big Grin will keep you updated if i'll have issues.
Reply
  • 1
  • 69
  • 70
  • 71(current)
  • 72
  • 73
  • 176

Logout Mark Read Team Forum Stats Members Help
Kanzi: Amazon Alexa skill for Kodi15