Amazon Echo Skill EchoToEventGhost

If you have a question or need help, this is the place to be.

Re: Amazon Echo Skill EchoToEventGhost

Postby SDeGonge » Sat Feb 04, 2017 2:01 am

therealbiglou wrote:
SDeGonge wrote:Is there a way to make the skill stay connected (with a timeout) so multiple commands can be send without having to say "Alexa ask <skill name> to..." each time?
I'm using this to mimic my SageTV remote so navigation becomes a real pain (ie: up up right enter).

Great skill by the way!


Yes there is! I recently asked about this myself and kgschlosser came up with a great solution.

Create a new Python Script action and paste the following:

Code: Select all
suffixes= eg.event.payload[0].split(' and ')

for suffix in suffixes:
    # the 2 options below will give you a "pretty" event suffix this is if you
    # are not using the actual suffix for anything other then just triggering
    # an event

    # remove the # before the next line if you would like all the first letters
    # in the suffix to be capital but not to mess with anything that might be
    # like NBC it will stay the same

    #suffix = ' '.join(list(word[0].upper() + word[1:] for word in suffix.split(' ')))

    # remove the # from the next line if you would like to remove all of the
    # spaces from the suffix

    #suffix = suffix.replace(' ', '')

    # swap the # between these 2 depending if you want to have the "Main."
    # in your event

    eg.TriggerEvent(prefrix='EchoToEG', suffix=suffix)
    #eg.TriggerEvent(suffix='EchoToEG.' + suffix)



That looks like something I'll implement as an additional feature but I would still like to keep Alexa listening for about 30 seconds so I can give individual commands.
So your code will let me ask...Alexa ask <skill name> to up AND up AND up AND right AND enter, for example which is good but I would also like to have the option to say...
Alexa <skill name>, wait for her to say "ready", then say up, up, up, right, enter. When she's done the connection would stay open for xx more seconds in case I wanted to give her more commands.

==================================================
So I answered my own question on this....

Yes, you can keep Alexa listening.
In Lambda function callEchoToEG you need to change var shouldEndSession from true to false, that's it!
Now after you initiate Alexa will keep listening.
After a short time of silence you will get a "I could not understand..." prompt. A short time after that it will timeout and disconnect.
You can also say "exit" to terminate the connection.

This works well except for one thing...since I'm using it to control the TV Alexa responds to the TV's dialog. I'll have to mute or pause when the connection is made an unmute or resume when I exit.
SDeGonge
 
Posts: 10
Joined: Thu Aug 09, 2012 10:01 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby PBvB » Mon Feb 06, 2017 12:37 pm

Hello everybody,

Firsttime poster here! So I've been using Eventghost for a short while and I'm getting the hang of it but I cannot seem to get it right to create a skill for Alexa.
The main issue I'm having is:
{
"errorMessage": "Invalid Application ID"
}


my var Echo_App_ID = The Application ID for a Skill I created on the Developer.amazon site, but It keeps giving me the error. Can anybody point me in the right directions? I've tried using Amazon but they have over 50 pages of information and I cannot seem to find what I am doing wrong....

thanks in advance! Peter
PBvB
 
Posts: 3
Joined: Mon Feb 06, 2017 12:31 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby PBvB » Mon Feb 06, 2017 3:31 pm

Hey all,

So I've got my brand new Echo and made the Lambda and the AWS, all fine here.
I can ask for "Alexa open Eventghost" (I named the Skill eventghost for testing purposes)
She says her thing: Helllo I'm your home's AI what can I do?
And whatever I say I get the response:
There is a problem with the requested Skills Reponse.

How can I fix this?

Thanks in advance!
Peter
PBvB
 
Posts: 3
Joined: Mon Feb 06, 2017 12:31 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby SDeGonge » Mon Feb 06, 2017 7:18 pm

PBvB wrote:Hello everybody,

Firsttime poster here! So I've been using Eventghost for a short while and I'm getting the hang of it but I cannot seem to get it right to create a skill for Alexa.
The main issue I'm having is:
{
"errorMessage": "Invalid Application ID"
}


my var Echo_App_ID = The Application ID for a Skill I created on the Developer.amazon site, but It keeps giving me the error. Can anybody point me in the right directions? I've tried using Amazon but they have over 50 pages of information and I cannot seem to find what I am doing wrong....

thanks in advance! Peter


Comment out the following....
Code: Select all
exports.handler = function (event, context) {
    try {
        console.log("EG: event.session.application.applicationId=" + event.session.application.applicationId);

// Commented out because amazon changed the way it reports ID                       // DISABLED
//        if (event.session.application.applicationId !== Echo_App_ID) {
//             context.fail("Invalid Application ID");
//            console.log(event.session.application.applicationId + " / " + Echo_App_ID);
//            console.log(event);
//        }
SDeGonge
 
Posts: 10
Joined: Thu Aug 09, 2012 10:01 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby PBvB » Tue Feb 07, 2017 8:54 am

ok, stupid me. I mistyped my wan IP adres.. But now that is fixed I can say: Alexa, Ask Eventghost to say Hello.
It will show up in my eventghost Log, so commands are getting through!
But Even if I let eventghost execute something, or nothing doesn't matter, Alexa will say: Error Eventghost Response Code 404.

What does this mean and how do I fix it?
PBvB
 
Posts: 3
Joined: Mon Feb 06, 2017 12:31 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby m19brandon » Wed Feb 22, 2017 3:58 am

A 404 is a Not found error. My guess in that your Endpoint (EventGhost's webserver page) is not rendering or loading correctly.

What is your response if you just remove Alexa from the test and hit this URL IP:port/index.html?EchoToEG&test in your web browser?

In the Marco where you mapped your EchoToEG event to, there should be an action like this and some more code to update eg.globals.ibl1_msg. This will provide a response in the index.html page when rendered.

Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1722">
    <Action>
        Webserver.SetValue(u'bb_response', u'{eg.globals.ibl1_msg}', False, False)
    </Action>
</EventGhost>
m19brandon
Experienced User
 
Posts: 148
Joined: Mon Feb 03, 2014 10:36 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby User1306 » Sun Apr 16, 2017 3:42 pm

Thanks for this great work.

is there a way to invoke Alexa to say something without having to initiate a command first?
so for example if a door opens, can Alexa say 'Door Opened'.
User1306
 
Posts: 42
Joined: Sat Oct 13, 2012 4:37 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby kkl » Sun Apr 16, 2017 9:25 pm

User1306 wrote:is there a way to invoke Alexa to say something without having to initiate a command first?
so for example if a door opens, can Alexa say 'Door Opened'.

Someone managed to do it, but not in EG: https://forums.developer.amazon.com/que ... tions.html
kkl
Experienced User
 
Posts: 305
Joined: Wed May 04, 2011 9:32 pm

Re: Amazon Echo Skill EchoToEventGhost

Postby yokel22 » Tue Apr 18, 2017 10:11 pm

Okay, so i'm a little late to the echo party here. I was waiting for them to open things up a bit more before picking one up. I was able to play around with it for a few hrs this weekend & got some pretty useful functionality out of it. So, i thought i'd share some of the stuff that folks are likely to use. I plan on doing some updates when i get time, but if anyone wants to throw some code at it, feel free.


For example purposes: My Invocation word is "Ghost".

Tree contains Control of these plugins: (Note: you'll probably need to re-change your XMBC2 & webserver credentials after opening this tree)

1. Kodi: The coolest thing here is full library search and play by voice. It works similar to the native alexa play commands. Simply say "Alexa, tell Ghost play "XXX". Where "XXX can be "Genre", "Artist", "Album", "Song", "Movie", "TVshow", "TVshow Season", "TVshow Season & episode". Examples: "Play Jazz", "Play Tito Puente", "Play Mellow Gold", "Play Super Troopers" "Play Futurama Season three", "Play Futurama Season four Episode ten".

(The only Caveat here is the spoken sting must match correctly to your library name. So if you say "Bob Marley" and your kodi library has it as "Bob Marley and the Wailer's", it will not match correctly right now. I plan on adding some junk word filtering to fix that kind of stuff. ) ** Update: Fixed in 2nd version posted, should match that fine now. ***

2. iTunes: Pretty much the same as kodi, just no movies,tv, or podcast search in the result. (Disabled by default)

3. Denon: You'll need the denonTCPIP plugin and a denon/marantz reciever for this to work. I included more as an example for other avr's. (Disabled by default)

4. AxialControlHA: You'll need AxialControlHA plugin and AxialControl software for this to work. I included more as an example for other home automation plugins. (Disabled by Default).

5. Other commonly used functions.

** Update: Added a second version that fixes the matching problem above & added some raise/lower volume 10% commands. Example"Alexa, tell Ghost, raise volume", this will trigger kodi by default". Or the volume of a specific program/system volume like this "Alexa, tell Ghost, raise "Kodi" volume", or "Alexa, tell Ghost, raise "System" volume", or "Alexa, tell Ghost, lower "iTunes" volume".

Are these working ok for folks, anything you want added? **
Attachments
Echo_Kodi_2.egtree
kodi_tree
(48.67 KiB) Downloaded 3 times
yokel22
Experienced User
 
Posts: 89
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Previous

Return to General Support

Who is online

Users browsing this forum: Alexa [Bot] and 5 guests

cron