Kodi Community Forum
Release Kanzi: Amazon Alexa skill for Kodi - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Release Kanzi: Amazon Alexa skill for Kodi (/showthread.php?tid=254502)



RE: Amazon Echo skill for Kodi - Coolzero - 2017-03-02

Hi,
i want to test the Kodi skill, and every think looks fine to the Point i deploy the skill with:
Code:
C:\Python27\Scripts\lambda-deploy.exe deploy

at this time i became this error message:

Code:
F:\ServerFolders\Anwendungen\Kodi_Alexa>C:\Python27\Scripts\lambda-deploy.exe deploy
2017-02-26 13:58:41:INFO:botocore.vendored.requests.packages.urllib3.connectionpool: Starting new HTTP connection (1): 143.254.143.232
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\lambda-deploy.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 360, in main
    name=options.name
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 75, in __init__
    self.client = boto3.client('lambda')
  File "c:\python27\lib\site-packages\boto3\__init__.py", line 83, in client
    return _get_default_session().client(*args, **kwargs)
  File "c:\python27\lib\site-packages\boto3\session.py", line 263, in client
    aws_session_token=aws_session_token, config=config)
  File "c:\python27\lib\site-packages\botocore\session.py", line 836, in create_client
    client_config=config, api_version=api_version)
  File "c:\python27\lib\site-packages\botocore\client.py", line 70, in create_client
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python27\lib\site-packages\botocore\client.py", line 224, in _get_client_args
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "c:\python27\lib\site-packages\botocore\args.py", line 45, in get_client_args
    endpoint_url, is_secure, scoped_config)
  File "c:\python27\lib\site-packages\botocore\args.py", line 103, in compute_client_args
    service_name, region_name, endpoint_url, is_secure)
  File "c:\python27\lib\site-packages\botocore\client.py", line 297, in resolve
    service_name, region_name)
  File "c:\python27\lib\site-packages\botocore\regions.py", line 122, in construct_endpoint
    partition, service_name, region_name)
  File "c:\python27\lib\site-packages\botocore\regions.py", line 135, in _endpoint_for_partition
    raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

I don't know what i make wrong, at the lambda.env i have this configuration:

Code:
# The Kodi webserver only supports HTTP.
# Uncomment KODI_SCHEME to tell the skill to use https between AWS and your local network
# (only use if you have already set this up with your own certificates)
#
# KODI_SCHEME = https

# If using a reverse proxy you might need to add an extra bit to the url before "jsonrpc"
# You can do this with KODI_SUBPATH (don't use slashes before or after)
#
# KODI_SUBPATH =

KODI_ADDRESS =fggfgfeu.sefgst.eu
KODI_PORT = 8689
KODI_USERNAME = Fhem
KODI_PASSWORD = xxx

SKILL_APPID =

# Your local time zone for responses that include absolute times.
# See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
#
# For example, if you are in the Eastern US time zone, you would use:
# SKILL_TZ = US/Eastern
#
# Leave empty or undefined (commented out) if you don't need or want absolute
# time responses.  An example is asking when the currently playing item will
# end.  If you have SKILL_TZ defined, it will also tell you the wall-clock
# time when the item will conclude.
SKILL_TZ =

LAMBDA_ENV_VARS = KODI_PASSWORD,KODI_USERNAME,KODI_PORT,KODI_ADDRESS

AWS_DEFAULT_REGION = eu-west-1
LAMBDA_TIMEOUT = 60
LAMBDA_MEMORY_SIZE = 128
LAMBDA_HANDLER = wsgi.lambda_handler

AWS_ACCESS_KEY_ID = AKIAI3LHGRDFDSX5DDHJB
AWS_SECRET_ACCESS_KEY = U75x9StlZNsW3Td15OO4wQCeO3id8uyiZo7ql7h1
LAMBDA_ROLE = arn:aws:iam::250054881122:role/Kodi

I use eu-west-1 because i'm from german

Thank you for your help


Amazon Echo skill for Kodi - digiltd - 2017-03-02

You are using lambda.env you need to rename the file to .env


RE: Amazon Echo skill for Kodi - Coolzero - 2017-03-03

(2017-03-02, 08:55)digiltd Wrote: You are using lambda.env you need to rename the file to .env

Hi, thank you, thats it.
But now i have a new Problem, i get this error
Code:
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\lambda-deploy.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 376, in main
    method()
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 215, in deploy
    Publish=True
  File "c:\python27\lib\site-packages\botocore\client.py", line 253, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "c:\python27\lib\site-packages\botocore\client.py", line 543, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the CreateFunction operation: Signature expired: 20170303T200457Z is now earlier than 20170303T200640Z (20170303T201140Z - 5 min.)



Amazon Echo skill for Kodi - digiltd - 2017-03-04

(2017-03-03, 22:17)Coolzero Wrote:
(2017-03-02, 08:55)digiltd Wrote: You are using lambda.env you need to rename the file to .env

Hi, thank you, thats it.
But now i have a new Problem, i get this error
Code:
Signature expired: 20170303T200457Z is now earlier than 20170303T200640Z (20170303T201140Z - 5 min.)

That has cropped up a few times, it's to do with the time on your local machine being incorrect... or something along those lines.

Doing a search on this thread for "signature expired" should sort you out.

Your previous question with the .env issue has also been asked and answered multiple times. I know the thread is a bit hefty, but it's gonna be quicker for you to search than it is to write the question and wait for a response Smile


RE: Amazon Echo skill for Kodi - sanjonny - 2017-03-04

Sorry guys, I searched for hours and the search does not work very well on this thread. I put in an error code and it spits out pages that do not have that quoted text on them making my searches about worthless so I read read and tried tried. Flippant responses like well you have to run 2 servers really offer no help when you cannot figure out how to do that.

I got everything up and running on one device. I had about an hour of problems because the website format doesn't do any kind of error check to see http so I had http://http://whatevermysite was and was only able to find it thru about an hour of trying to find amazon logs. Seriously, why is amazons panel so darn complex. Why not link everything together, wastes so much time with the back and forth.

Anyway, I tried adding a new user and copying that info into the env file and loading that, but that seems to just wipe out my kodi-alexa-master so I got the other device working, but its one of the other. I cannot figure out if I need to change kodi-alexa master to a different name, run a different script, throw my computer out and move to an area with no tv, etc etc etc,. I can get it to work on one device or the other, what am i doing wrong and how do i correct it.

Also some helpful hints that should be on the front page (since search is terribe on this thread for some reason) in bigbold letters it should say do not use python 3.5. I tried for an hour and then saw the 2.7.Two websites I saw said you need to duplicate to run on a second device, but offer no instructions on how to do that and have them both work. I will gladly write up a better guide for how to do this on win 10 with firetvs and raspberry pis, but I need help to figure out how to do it. Again I spent hours and I searched. I had lne failures and such that normally youcan search on and find what they are, for some reason, this thread brought up none of them. It is like google was puporsefully trying to screw me.

It makes no sense to me that if I have three pis running the same instruction set, to have to input all the sources and intents and triggers and all that and not be able to call the same code and apply it out at whatever machine it should go to. That's how I would have wrote this 20 years ago so you don't have so many places to make a mistake or 4 redundant calls of the same action. Is that only an amazon thing or is the world moving that way. I tried doing the same thing with my tivo and it was similarly crazy. If you have 2 tivos, you need 2 servers? What not decide for tivo one goto this address for tivo 2 goto that address. I have 5 kodi boxes. So to do this I have to duplicate the same information 5 times on 5 different servers (thought they are small)
I have a remote control for the tivo that can control 4 tivos, its written in py and works excellent. I understand a bit more complexity because you have to have tthe longer utterances file to try and anticpate, but I am baffled why the response cannot just be piped to the right kodi box saving everyone lots of cut and past and hassle.

Any help is greatly appreciated, I know its something minor but I don't get it. As an aside, why can't we just have an appliance that does everything, and call those same protocols from that applicance to shoot the info to whichever boxwe are tryign to accesss. Especially if you have a shared database, it seems so muchbetter an easier way to code, but it seems amazon style, the process is way complex to do anything Extremely frustrating there is not on portal that you can do it all on with error checking. Their workflow and webdesigners need a boot to the head. Its like 5 pages of websites or more to do things that a simple python program can do in dos easy. Makes no sense, but I am not a programmer.

Any help greatly apprecieated. I was so excited when I finally got the first one to work, I stayed up late to get the second one online. Of course, that resulted in me tellling the bedroom one to pause and the living room pauses while the bedroom pretends I dont exist. Change the env fire and the bedroom perks up but the living room doesn't work. Nutso Please don't take this negatively, I have great respect and am exicted about how well this seems to work, but is not easy at all to set up.


RE: Amazon Echo skill for Kodi - JGrana01 - 2017-03-04

Quick question. If I wanted to simply change my KODI_ADDRESS from one hostname to another, do I simply edit the .env file and re-run deploy-to-lambda again?

I presently have my dynamic DNS with noip. No complaints other than having to remember to sign in every 30 days. I have an ASUS router that provides the same service - but no need to remember to login in monthly.

Everything is working well at the moment and I don't want to upset the old apple cart ;-)


RE: Amazon Echo skill for Kodi - digiltd - 2017-03-05

(2017-03-04, 16:41)JGrana01 Wrote: Quick question. If I wanted to simply change my KODI_ADDRESS from one hostname to another, do I simply edit the .env file and re-run deploy-to-lambda again?


Yep, should be all you need to do Smile


RE: Amazon Echo skill for Kodi - digiltd - 2017-03-05

Quote:I had about an hour of problems because the website format doesn't do any kind of error check to see http so I had http://http://whatevermysite was

There is mention of it the lambda.env, but it's true better examples could be given (though there are few mentions of it in this massive thread)

Quote:Seriously, why is amazons panel so darn complex

You get used to it, AWS is complex because it has to be (remember it is not really meant for muggles)

The logs are linked from the Lambda function screen (monitoring)

Quote:Anyway, I tried adding a new user and copying that info into the env file and loading that, but that seems to just wipe out my kodi-alexa-master so I got the other device working, but its one of the other. I cannot figure out if I need to change kodi-alexa master to a different name, run a different script, throw my computer out and move to an area with no tv, etc etc etc,. I can get it to work on one device or the other, what am i doing wrong and how do i correct it.

How are you deploying to AWS?

I think you might be deploying using:

Code:
lambda-deploy deploy

.. which would upload the entire contents of the folder it is run in.

It shouldn't be uploading the kodi-alexa-master folder if you are using the method as documented in the readme:

Code:
python deploy-to-lambda.py
.

The ability to control multiple kodi installs with a single skill has not been addressed yet. Until there is a way, you are right, the workaround is to have a separate Skill and Lambda function for each box. Not ideal, but not the end of the world either.

It is very easy to say to yourself "it can't be that hard to do..." and if you want to come up with a way, feel free. Some thoughts off the top of my head: A way of storing the 5 (or however many) sets of kodi details. Then would you have Alexa ask and remember what room you are in so it knows what kodi box to control? How would that work as a voice interface and how would you change the stored room? If so what if there are two kodi boxes being used at the same time in different rooms? Or do you implement a way to include and validate the room name every time you issue a command, requiring you to say "Alexa, ask kodi to pause in the living room". What if someone only has one kodi box? would they need to say the room name as well or would the Skill know that "not hearing a room" means there is only one box? You might then need to know what "hearing a room" sounded like in order to know when it was missing... etc etc. Well, you get my point Smile

The Python 2.7 requirement is mentioned in the readme https://github.com/m0ngr31/kodi-alexa#aws-lambda not sure why you would have installed 3.5.

Quote:Extremely frustrating there is not on portal that you can do it all on with error checking. Their workflow and webdesigners need a boot to the head. Its like 5 pages of websites or more to do things that a simple python program can do in dos easy.

Computers are hard. AWS is not just for creating an Alexa Skill.

Quote:Makes no sense, but I am not a programmer.

quite Wink


It is true it not easy to set up, but that's because it is not very easy to set up Smile but it is the only way at the moment. And without implementing some sort of central registration system with an account that you can "link" the Skill to (like Hue, openHAB, Plex, Harmony etc) it isn't ever going to be that easy.

But input on the documentation is welcomed if you think there are areas to improve, but please do it via GitHub and not on a personal blog or third party site. The howtogeek tutorial is what many people use, but it has been out of date for a long time.

Plex have a Skill and they worked hard on it and they rightfully charge money for it. If you want easy, you have to pay for it.

But I think your rant was more to do with frustration, and you have it working now, setting up the other 4 will be a doddle. Good luck.


RE: Amazon Echo skill for Kodi - Coolzero - 2017-03-05

(2017-03-04, 06:45)digiltd Wrote:
(2017-03-03, 22:17)Coolzero Wrote:
(2017-03-02, 08:55)digiltd Wrote: You are using lambda.env you need to rename the file to .env

Hi, thank you, thats it.
But now i have a new Problem, i get this error
Code:
Signature expired: 20170303T200457Z is now earlier than 20170303T200640Z (20170303T201140Z - 5 min.)

That has cropped up a few times, it's to do with the time on your local machine being incorrect... or something along those lines.

Doing a search on this thread for "signature expired" should sort you out.

Your previous question with the .env issue has also been asked and answered multiple times. I know the thread is a bit hefty, but it's gonna be quicker for you to search than it is to write the question and wait for a response Smile

Hi, i found that the Problem comes because a Timeout, and thats right, i use my Mobile Phone for the upload and now its fine, but i have a new error, and find at the Thrat no answer.

Code:
Running setup.py install for pycountry ... done
Successfully installed fuzzywuzzy-0.15.0 gunicorn-19.7.0 pycountry-17.1.8 pytz-2
016.10 requests-2.13.0 yaep-0.0.6
Starting new HTTPS connection (1): lambda.eu-west-1.amazonaws.com
Adding new Kodi_Alexa lambda
Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\lambda-deploy.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 376,
in main
    method()
  File "c:\python27\lib\site-packages\lambda_deploy\lambda_deploy.py", line 215,
in deploy
    Publish=True
  File "c:\python27\lib\site-packages\botocore\client.py", line 253, in _api_cal
l
    return self._make_api_call(operation_name, kwargs)
  File "c:\python27\lib\site-packages\botocore\client.py", line 543, in _make_ap
i_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when ca
lling the CreateFunction operation: 1 validation error detected: Value 'arn:aws:
iam::750051881692:user/Kodi' at 'role' failed to satisfy constraint: Member must
satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\
-_/]+



RE: Amazon Echo skill for Kodi - digiltd - 2017-03-05

@Coolzero

This part of the error shows the problem

Quote:
Code:
botocore.exceptions.ClientError: An error occurred (ValidationException) when ca
lling the CreateFunction operation: 1 validation error detected: Value 'arn:aws:
iam::123123123123:user/Kodi' at 'role' failed to satisfy constraint: Member must
satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\
-_/]+

For LAMBDA_ROLE you have put the details for a "user" when it should be a "role".

Go through this section again https://github.com/m0ngr31/kodi-alexa#aws-variables and make sure what you are pasting in looks something like:

Code:
arn:aws:iam::123123123123:role/role_name_you_used

Good luck


RE: Amazon Echo skill for Kodi - sanjonny - 2017-03-06

(2017-03-04, 16:36)sanjonny Wrote: Sorry guys, I searched for hours and the search does not work very well on this thread. I put in an error code and it spits out pages that do not have that quoted text on them making my searches about worthless so I read read and tried tried. Flippant responses like well you have to run 2 servers really offer no help when you cannot figure out how to do that.

I got everything up and running on one device. I had about an hour of problems because the website format doesn't do any kind of error check to see http so I had http://http://whatevermysite was and was only able to find it thru about an hour of trying to find amazon logs. Seriously, why is amazons panel so darn complex. Why not link everything together, wastes so much time with the back and forth.

Anyway, I tried adding a new user and copying that info into the env file and loading that, but that seems to just wipe out my kodi-alexa-master so I got the other device working, but its one of the other. I cannot figure out if I need to change kodi-alexa master to a different name, run a different script, throw my computer out and move to an area with no tv, etc etc etc,. I can get it to work on one device or the other, what am i doing wrong and how do i correct it.

Also some helpful hints that should be on the front page (since search is terrible on this thread for some reason) in bigbold letters it should say do not use python 3.5. I tried for an hour and then saw the 2.7.Two websites I saw said you need to duplicate to run on a second device, but offer no instructions on how to do that and have them both work. I will gladly write up a better guide for how to do this on win 10 with firetvs and raspberry pis, but I need help to figure out how to do it. Again I spent hours and I searched. I had lne failures and such that normally youcan search on and find what they are, for some reason, this thread brought up none of them. It is like google was puporsefully trying to screw me.

It makes no sense to me that if I have three pis running the same instruction set, to have to input all the sources and intents and triggers and all that and not be able to call the same code and apply it out at whatever machine it should go to. That's how I would have wrote this 20 years ago so you don't have so many places to make a mistake or 4 redundant calls of the same action. Is that only an amazon thing or is the world moving that way. I tried doing the same thing with my tivo and it was similarly crazy. If you have 2 tivos, you need 2 servers? What not decide for tivo one goto this address for tivo 2 goto that address. I have 5 kodi boxes. So to do this I have to duplicate the same information 5 times on 5 different servers (thought they are small)
I have a remote control for the tivo that can control 4 tivos, its written in py and works excellent. I understand a bit more complexity because you have to have tthe longer utterances file to try and anticipate, but I am baffled why the response cannot just be piped to the right kodi box saving everyone lots of cut and paste and hassle.

Any help is greatly appreciated, I know its something minor but I don't get it. As an aside, why can't we just have an appliance that does everything, and call those same protocols from that applicance to shoot the info to whichever boxwe are tryign to accesss. Especially if you have a shared database, it seems so muchbetter an easier way to code, but it seems amazon style, the process is way complex to do anything Extremely frustrating there is not on portal that you can do it all on with error checking. Their workflow and webdesigners need a boot to the head. Its like 5 pages of websites or more to do things that a simple python program can do in dos easy. Makes no sense, but I am not a programmer.

Any help greatly appreciated. I was so excited when I finally got the first one to work, I stayed up late to get the second one online. Of course, that resulted in me telling the bedroom one to pause and the living room pauses while the bedroom pretends I dont exist. Change the env fire and the bedroom perks up but the living room doesn't work. So Please don't take this negatively, I have great respect and am excited about how well this seems to work, but is not easy at all to set up.

So I figured most of it out myself and have some suggestions to add to the readme to save lots of regular users (I am a Real Estate Broker) from trouble.

Suggestions

I suggest putting an inline note in the env file to make sure not to put in the http://for the web address. Seems like that gets lots of people who cut and paste like i did. Or put in an error check for it so if people do it, the error tells them what to fix.

In big red letters, tell users that the env file needs to be copied from lambda or whatever and named just .env, and also note how to do it on windows because otherwise it takes a lot of browsing to find the information. Window GUI will not let you....Alternatively, chose to change the needed filename to something like updated.env or execute.env or something so windows users don't have to hassle with it, or even lambda.env would work fine too. or have it check for both....like if no .env file, use lambda.env or whatever

As mentioned above, note that you must use python 2.7. Maybe put in a check that if you run this under anything but, it tells you that you have to use 2.7

Second put better instructions for multi-device and update. Basically it worked to install on a second device for me to copy the original folder, rename it to whatever the new function/device is to be called and then rerun the process. It worked for me without changing the app_info line but I did see reference to doing that. So I copied the kodi-alexa-master directory to say kitchen kodi, changed the information in the .env file and then lamba-deploy deploy within that folder and then did the rest of the setup on Amazon.

Also, when you make changes, it took a long time for me to find that the way to update the function is just to download the new directory and copy in the .env file and run lamba-deploy.exe deploy to update it.

Although I did not run into it, I suggest putting the solution to the signature verification problem into the read me. There is tons of people having issue with that so it warrants being addressed in the read me.

Realizations
The Alexa development way of doing things is really screwy. I am not a programmer, but not being able to save certain thing in process is dumb, you should be able to save intents and utterances and all that without the sources being complete and other things, I think they are really screwy with not helping develops develop in an easy way. I am sure it drives you guys nuts. I now see the reason you have to have multiple versions of the functions for different boxes, though I think that for mysql users, you might be able to change the code to only have one function (since they all share the same database) to run the function, and then have like the custom sources to output the final command to a certain box. I think I understand the process enough that it should work, but for not shared databases, I can see how everything needs to go to the individual box to search the DB on that device, which is why you need the multiple functions for each box, but just like how Yatse (the great android remote app), you could set a master box to run the shared mySQL database search on and then have the json command routed to whichever box at the end of it. That would require only one env (i think) with the master DB and either Slots or just env notes to output the command too. Again, talking out of my butt.....

Bugs
When using the web app to get the info for the slots, I paste in my shows into the Shows custom slot. When I originally did it, it would not work, gave me errors that there was specifically
Code:
Error: "Sons of Scotland" contains invalid characters. Values for a custom slot type cannot contain double quotation marks.

I think this is a combination of Sons of Anarchy and another show that is Great Estates of Scotland. Strangely, after you get that error, you cannot ever get it to paste in anything correctly. You have to delete the slot and redo it. Neither of those shows have quotation marks so I have no idea why it throws that error, but obviously there is an amazon bug that screws up after doing that.

Afterwards (after you save) You cannot even delete the slot or edit it because it will continue to throw that error so you have to do a complete new skill in order to get it to function. I don't know why it throws that error, but I worked around it by only putting about 20 shows in the list and saving. I then tried to add shows and later and got the same error. I do not know if the original error is do to how the format comes out from the web app after a certain number, or a bug in amazon after a certain number of shows or what. I am going to play more with it and will report back. I only cut from the website and pasted in the Shows box on firefox, but something weird that happens. And its a pain, because if that screws up, you have to redo everything so I started with shows first but will try a few other things.

It seems amazon should let you copy skills and functions, because for my 5 devices, everything is exactly the same except for the addresses in the places required. I know most of these bugs are not the creators, but mentioning them for anyone who runs into them. My only suggestion is maybe to strip any quotation marks from the webapp if that is actually causing the problem with pasting shows, but again, haven't tested enough to know if that will fix it. Also note I was pasting in about 1400 shows if that matters.

Thanks Love So much for developing this and your upkeep on it. I am good at breaking things which is why I am posting all the stuff forr the updates to the readme so the next person doesn't run into what I did. Great job! Still figuring out the best way to say things so that they work, but it works very well overall!


RE: Amazon Echo skill for Kodi - sanjonny - 2017-03-06

(2017-03-05, 01:27)digiltd Wrote:
Quote:I had about an hour of problems because the website format doesn't do any kind of error check to see http so I had http://http://whatevermysite was

There is mention of it the lambda.env, but it's true better examples could be given (though there are few mentions of it in this massive thread)

Quote:Seriously, why is amazons panel so darn complex

You get used to it, AWS is complex because it has to be (remember it is not really meant for muggles)

The logs are linked from the Lambda function screen (monitoring)

Quote:Anyway, I tried adding a new user and copying that info into the env file and loading that, but that seems to just wipe out my kodi-alexa-master so I got the other device working, but its one of the other. I cannot figure out if I need to change kodi-alexa master to a different name, run a different script, throw my computer out and move to an area with no tv, etc etc etc,. I can get it to work on one device or the other, what am i doing wrong and how do i correct it.

How are you deploying to AWS?

I think you might be deploying using:

Code:
lambda-deploy deploy

.. which would upload the entire contents of the folder it is run in.

It shouldn't be uploading the kodi-alexa-master folder if you are using the method as documented in the readme:

Code:
python deploy-to-lambda.py
.

The ability to control multiple kodi installs with a single skill has not been addressed yet. Until there is a way, you are right, the workaround is to have a separate Skill and Lambda function for each box. Not ideal, but not the end of the world either.

It is very easy to say to yourself "it can't be that hard to do..." and if you want to come up with a way, feel free. Some thoughts off the top of my head: A way of storing the 5 (or however many) sets of kodi details. Then would you have Alexa ask and remember what room you are in so it knows what kodi box to control? How would that work as a voice interface and how would you change the stored room? If so what if there are two kodi boxes being used at the same time in different rooms? Or do you implement a way to include and validate the room name every time you issue a command, requiring you to say "Alexa, ask kodi to pause in the living room". What if someone only has one kodi box? would they need to say the room name as well or would the Skill know that "not hearing a room" means there is only one box? You might then need to know what "hearing a room" sounded like in order to know when it was missing... etc etc. Well, you get my point Smile

The Python 2.7 requirement is mentioned in the readme https://github.com/m0ngr31/kodi-alexa#aws-lambda not sure why you would have installed 3.5.

Quote:Extremely frustrating there is not on portal that you can do it all on with error checking. Their workflow and webdesigners need a boot to the head. Its like 5 pages of websites or more to do things that a simple python program can do in dos easy.

Computers are hard. AWS is not just for creating an Alexa Skill.

Quote:Makes no sense, but I am not a programmer.

quite Wink


It is true it not easy to set up, but that's because it is not very easy to set up Smile but it is the only way at the moment. And without implementing some sort of central registration system with an account that you can "link" the Skill to (like Hue, openHAB, Plex, Harmony etc) it isn't ever going to be that easy.

But input on the documentation is welcomed if you think there are areas to improve, but please do it via GitHub and not on a personal blog or third party site. The howtogeek tutorial is what many people use, but it has been out of date for a long time.

Plex have a Skill and they worked hard on it and they rightfully charge money for it. If you want easy, you have to pay for it.

But I think your rant was more to do with frustration, and you have it working now, setting up the other 4 will be a doddle. Good luck.

Of course I saw your response after I finished installing everything, I'm obviously behind on my email. For an update after you read my big posting with my learning and feedback, also add to it that I used both the read me and the thread on how to geek. When I tried the deploy to lambda and changed the on or whatever it is ( doing this from my tablet) it didn't work but they way I did it while not the directed way did end up working. I used 3.4 because that was installed to run a similar program to direct my TiVo and it had pip installed while 2.7 which was also installed on my system did not have pip in it for some reason and I not being a programmer figured that if 2.7 is good, 3.4 is better..

In doing stuff on my tivo, many of those threads are years old like 2008...did python exist then? And most odd those work on the latest version of whatever so unless something tells me it won't work, I think many people figure it will, and since I didn't see anywhere it wouldn't, I did what many non programmer, half understanding person would do and figured it would work. To me, that's really pythons fault for not giving an error saying we changed this when trying to execute and it telling you hey, perhaps this is crashing because you need to be using the old instruction set. But the error was instead something stupid like error in line 9 and in line 9 there was nothing.

Can you tell I both love and hate this stuff? I was in qa for years and actually could program in fortran, basic, original vbs, etc etc, but now stuff drives me crazy because of how modern programming works. Now you have statements that are three paragraphs long to define a variable and commands like do.something.java.how.is.The.weather to do some thing simple that 25 years ago by writing it would define the variable itself. Don't get me wrong, I have great respect for the programming work and all that, but we were taught to simplify code and run on the minimum so the coding software was much different. That of course was in the age of floppy drives and I spent more for a 40 megabyte hard drive then my car at the time.

Having that qa history you can see why I try and document and suggest stuff. And from my statements you can see I'm an old codger who still likes kodi and the programmers that help things run.

Truly thanks for all your help and hopefully my feedback helps you. Also, I get the s3 is complex but the Alexa stuff is overly complex for something that does not need to be. More power to you for figuring it all out and dealing with it. I just think it's crazy that you have to do so much thru a web interface (maybe you don't) to program simple stuff into Alexa and there are so many horrible bugs (I spent awhile on the Alexa forums also and noted my bugs with their service while doing this) that they have facing developers. I mean not being able to copy a skill, edit it and change it easily is nuts!


RE: Amazon Echo skill for Kodi - digiltd - 2017-03-06

(2017-03-06, 05:20)sanjonny Wrote: I am good at breaking things which is why I am posting all the stuff forr the updates to the readme so the next person doesn't run into what I did. Great job! Still figuring out the best way to say things so that they work, but it works very well overall!

Thanks for pointing out where improvements can be made. However it really would be much more helpful if you could write the instructions as you would want to read them, you can use GitHub to make changes to a version of the readme and then request that it be merged.

Quote:In big red letters, tell users that the env file needs to be copied from lambda or whatever and named just .env, and also note how to do it on windows because otherwise it takes a lot of browsing to find the information. Window GUI will not let you....Alternatively, chose to change the needed filename to something like updated.env or execute.env or something so windows users don't have to hassle with it, or even lambda.env would work fine too. or have it check for both....like if no .env file, use lambda.env or whatever

The readme does say The environment variables are stored in an .env file which you need to create yourself from a copy of .env.lambda

The .env file is a standard thing and needs to be called .env because that is what other scripts and services will be looking for. So the filename won't be changing.

No "big red letters" can be added because GitHub won't allow it, and you should always read the entire readme file anyway Smile

This would be an ideal section for you add to the readme, sharing what you know about the Windows .env and how you solved it.

Quote:Second put better instructions for multi-device and update. Basically it worked to install on a second device for me to copy the original folder, rename it to whatever the new function/device is to be called and then rerun the process. It worked for me without changing the app_info line but I did see reference to doing that. So I copied the kodi-alexa-master directory to say kitchen kodi, changed the information in the .env file and then lamba-deploy deploy within that folder and then did the rest of the setup on Amazon.

I avoided mentioning the following in my last post because I wanted to be sure of the way you were deploying to AWS.

Based on what you previously told us, you have either not fully read the readme or have chosen to ignore parts of it. There is no mention of the command lamba-deploy deploy in the readme, if you had followed it correctly you would be using python deploy-to-lambda.py. And I really do think that a lot of you problems (not all, I am aware it isn't perfect) but a lot would have been avoided if you had been using the readme. I don't mention it to tell you off, everyone starts somewhere and there is no such thing as a stupid question, we're all friends here Big Grin

But it does get a teeny little bit frustrating when people ask the same questions about things that they would have known if they had read the information provided Rolleyes

The howtogeek tutorial was published in April 2016 and as comprehensive as it once was, it is now pretty outdated, but it is the second result in Google when you search for "kodi alexa" so it is understandable that people are still using it.

Quote:Afterwards (after you save) You cannot even delete the slot or edit it because it will continue to throw that error so you have to do a complete new skill in order to get it to function. I don't know why it throws that error, but I worked around it by only putting about 20 shows in the list and saving. I then tried to add shows and later and got the same error. I do not know if the original error is do to how the format comes out from the web app after a certain number, or a bug in amazon after a certain number of shows or what. I am going to play more with it and will report back. I only cut from the website and pasted in the Shows box on firefox, but something weird that happens. And its a pain, because if that screws up, you have to redo everything so I started with shows first but will try a few other things.

The saving slots issue is admittedly very screwy, but can be avoided with this single bit of advice in the readme: Generate and save your Slots first before pasting the Intents and Utterances to avoid errors when attempting to save.

Quote:The Alexa development way of doing things is really screwy. I am not a programmer, but not being able to save certain thing in process is dumb, you should be able to save intents and utterances and all that without the sources being complete and other things,

That made me chuckle, as you mention several times that you would like some type of error checking added, yet seem to disapprove being told to fix them before you can save Angel

Quote:It seems amazon should let you copy skills and functions, because for my 5 devices, everything is exactly the same except for the addresses in the places required.

I agree that it is annoying you can't duplicate a Skill, but once you know the "single line of advice" above you will find it much easier to create the additional Skills.

I do think your 1200 shows is quite a lot (seriously you have 1200 shows? that is (according to Time) more shows than are available on Netflix) and you could probably strip that down considerably. Custom Slots samples are an example of the type of "thing" that the Slot contains, it doesn't need to match your library but it does help, though there is a some debate about how many is enough, but 1200 is too much Smile start at 400 and see if it still recognises shows that are not in the list. There are developments on the Amazon side that hopefully should remove the need for manual Slot generation, but that won't be for a while (months)

If you use the correct deploy method as documented in the readme then it is easy to setup multiple functions. For me I would create a separate folder and in it create a .env file for each box and save it as something like bedroom.env, lounge.env, kids.env etc. Then when ready to deploy replace the main .env file with one of the new files e.g. bedroom.env (either rename it to .env or copy and paste the contents into the .env). Do not deploy yet because it would just overwrite the previous Lambda function. To create a new Lambda function you need to change the app_name in the deploy-to-lambda.py file, the app_name will be the function name that gets deployed/updated.

Quote:app_name = "kodi-alexa"

to

Quote:app_name = "kodi-alexa-bedroom"

save and run deploy-to-lambda.py and this will deploy to a new function. Repeat the process (swap out the .env file, change the app_name, deploy) for each box, it's a bit old school but it does the job and is really not that difficult. If you understand what deploy-to-lambda.py is doing then it wouldn't be too hard to automate the entire process.

The multiple box issue is very complicated and not something that is going to be addressed anytime soon (if ever), sorry. It would be an enormous task for very little gain, when it would probably take less than an hour to set up a Skill and Lambda for each of your five boxes using the current workaround today Wink


RE: Amazon Echo skill for Kodi - JGrana01 - 2017-03-06

(2017-03-05, 00:19)digiltd Wrote:
(2017-03-04, 16:41)JGrana01 Wrote: Quick question. If I wanted to simply change my KODI_ADDRESS from one hostname to another, do I simply edit the .env file and re-run deploy-to-lambda again?


Yep, should be all you need to do Smile

Thanks, worked like a charm!


RE: Amazon Echo skill for Kodi - sanjonny - 2017-03-07

(2017-03-06, 11:01)digiltd Wrote:
(2017-03-06, 05:20)sanjonny Wrote: I am good at breaking things which is why I am posting all the stuff forr the updates to the readme so the next person doesn't run into what I did. Great job! Still figuring out the best way to say things so that they work, but it works very well overall!

Thanks for pointing out where improvements can be made. However it really would be much more helpful if you could write the instructions as you would want to read them, you can use GitHub to make changes to a version of the readme and then request that it be merged.

more text more text more text etc....

save and run deploy-to-lambda.py and this will deploy to a new function. Repeat the process (swap out the .env file, change the app_name, deploy) for each box, it's a bit old school but it does the job and is really not that difficult. If you understand what deploy-to-lambda.py is doing then it wouldn't be too hard to automate the entire process.

The multiple box issue is very complicated and not something that is going to be addressed anytime soon (if ever), sorry. It would be an enormous task for very little gain, when it would probably take less than an hour to set up a Skill and Lambda for each of your five boxes using the current workaround today Wink


I can't even get multiquote to work the way I usually get it to, so obviously certain works easier than other stuff.

I am definitely not offended, I want everything to be easier for everyone.

I think this will adequately sum up my sentiments and give a better understanding.

Quote:Thanks for pointing out where improvements can be made. However it really would be much more helpful if you could write the instructions as you would want to read them, you can use GitHub to make changes to a version of the readme and then request that it be merged.

No problem, I ask only that you describe in Russian the principle of quantum entanglement and how it allows the possibility of transportation of mass/information.

You see, I speak (or spoke 20 years ago) Russian fluently and also studied physics engineering, so the above statement makes perfect sense and is easily accomplished.

To you assuming you are normal, it probably sounds ridiculous. You spent years studying programming and your sentence makes great sense to you, but to me, it sounds as crazy as my sentence sounds to you.Rofl

I get on GitHub and have no idea how to do most of what happens on github. Half the time someone says go to github and I go there and there is no exe or zip and I am screwed. I don't used those tools for anything in general so it's learning a whole new language. I understand a bunch of how this works, yet only can go so far. That being said, I will take a look and see what I can accomplish.

You keep pushing the readme. I had the readme open the whole time along with the how to geek article. I always start with the readme as I figure it is usually the most updated. But very quickly stuff did not work and i ran into every error I did, and frankly at that time, had I just stuck to the readme, because of the errors I was getting, I would have given up, again, because following it meant I got errors that I could not figure out what they were and things did not work. But using some searching and combining the how to geek article and yours, I did eventually get it to work. And I even figured out a different way to get it to do the multiple boxes. That is not because you did a bad job on the readme or anything, its because I made several of the most common and one or two uncommon errors that were not covered in a way I caught them in the readme, because assumptions are made in there of things you know to make sure to do, that trip "regular" people up. I had to dig thru about 50 pages of this thread to find the answers, cause like I said, I break stuff. And its because I made assumptions also, obviously that caused the problems. I know for a fact I tried the method in the readme )python deploy-to-lambda.py) and got errors that I could not figure out, and I also changed the app_info and that did not work either (and I just remembered that in the app_info, I think it only had kodi-alexa, but creates the skill/function or whatever it is called kodi-alexa-master, which I now know was the directory name) I get why that is now of course, but when first running thru it was a problem.

And I don't remember if there was any mention of how to do multiple devices in the readme or if it was just in the thread, or what.

Anyway, I now know a bunch more than I started with and gave my feedback on what tripped me up and one or two that are mentioned several times in the thread. I get how it is supposed to work and hopefully when you update it, I will be able to update it easy. The readme is very helpful (tell github to add the red letter option!) and I understand how Alexa works much better.

All that being said, I sent Amazon a in depth report of the obvious problem with the GUI. After playing with it more, Once it gets that error, you are screwed, you can do nothing with the skill because it will not let you save anymore, it retains that error into eternity so you have to delete the skill and start over. Stupid. Even if you go back to the 20 or so I started with, before trying to past the 1400 or trying 200 or whatever, nothing works anymore. It is truly a critical error, because you wont be able to revise it.

I will add a few more thoughts. First of all, this is kodi we are talking about. 1400 shows is nothing. People have 3000 easy as they sit and download them day and night. That is not me, I have had replayTV and tivo going back to 1998 or earlier so I have been archiving shows forever and with reruns and old shows that I eventually record, I have a decent collection, but if you look on many of the forums, I am in the minority!
Turns out it seems to work just fine in general with about 30 shows, but since I could try and paste them all in there, I did and amazon choked hard on it.

As for error checking and logs and stuff. I think you should ALWAYS be able to save your work in progress everywhere and the GUI is the screwiest implementation of how to run a railroad I have ever seen. Lots of errors and makes me glad I don't develop on that platform full time. My friend said the apple app store was god awful in the beginning too so its growing pains I guess.

I always feel that errors should help you fix the problem, so wanting to save early and save often does not contradict with good error reporting. Many of the problems I had were nothing to do with the package you wrote, just weirdness in general, but I ran into them and others too obviously.

I found a few utterances I suggest, but have to put them on like my third box, because my first two skills have the error mentioned so I will have to rebuild them again. I'll paste them here and see if I can add them on github. These help me because they are commands I think to use, haven't tried them yet....

Code:
WatchLastShow resume watching show
WatchLastShow resume show
WatchLastShow resume last show
WatchLastShow resume episode
WatchLatestEpisode play latest

I am assuming I can then use the resume instead of continue.....

Also, I have not played with it but can you say something like watch "The Contest" episode of "Seinfeld" or Play episode "Daybreak" of "Battlestar Galactica" or can it only do numbers for episodes? Is that something you could add?

Finally what else.....

Quote:The saving slots issue is admittedly very screwy, but can be avoided with this single bit of advice in the readme: Generate and save your Slots first before pasting the Intents and Utterances to avoid errors when attempting to save.

I did that, its amazon's fault not yours but its stupid. Save always is my motto, error check with a different button damnit amazon.

Quote:I agree that it is annoying you can't duplicate a Skill, but once you know the "single line of advice" above you will find it much easier to create the additional Skills.
But you still have to paste all the text in the boxes right? Or am I missing something? you modify the env for the new kodi box and that creates the new function, but you have to build the whole skill for that new function right? Please tell me if I somehow missed that detail, because even more does Github need a red letter option if I missed that......

Quote:That made me chuckle, as you mention several times that you would like some type of error checking added, yet seem to disapprove being told to fix them before you can save Angel

You should always be able to save. Always. Error check should be different. They kinda even have it that way because on some things you can save, and then hitting next runs the error checking, but obviously they have bugs, ugly conflating bugs.....


And finally the multiple box issue. I already have mine setup but it seems like it can still all go thru one function/skill if shared.

It seems that with a shared database should it not be easy. I totally understand with different databases, because you have to do the different lookups and all that, but isn't the logic basically take input from alexa. Lookup info in db, spit it out to whatever box, Like Yatse (have you tried yatse, great remote control) It seems you just have a master db address.

So I have box a box b and box c. each at command/webaddress 1,2,3 in env file.
box a set in env file as lookup address 1/master DB. seems no different than processing shows and getting them right. BTW this is not my cheat, its how Yatse deals with it

Alexa, ask box a to watch season 1 episode 1 of Seinfeld.........she looks at box a for the episode address and then outputs it to your program which then sends back the command to box A and show starts. That's how it works now right?

Alexa ask box b to watch Season 1 episode 1 of Seinfeld......She looks at box A for the episode address and then outputs it to your program which then sends back the play command to box B which starts the episode on box B.

Alexa ask box c to watch Season 1 episode 1 of Seinfeld......She looks at box A for the episode address and then outputs it to your program which then sends back the play command to box C which starts the episode on box C. Granted only works for shared database, but what is missing?

I know sounds easy from my endNod Thanks for all your help and I will see what I can accomplish on Github.