Amazon Echo Skill EchoToEventGhost

If you have a question or need help, this is the place to be.
Post Reply
SDeGonge
Posts: 10
Joined: Thu Aug 09, 2012 10:01 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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.

PBvB
Posts: 3
Joined: Mon Feb 06, 2017 12:31 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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

Post by 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

SDeGonge
Posts: 10
Joined: Thu Aug 09, 2012 10:01 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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);
//        }

PBvB
Posts: 3
Joined: Mon Feb 06, 2017 12:31 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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?

m19brandon
Experienced User
Posts: 177
Joined: Mon Feb 03, 2014 10:36 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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>

User1306
Experienced User
Posts: 53
Joined: Sat Oct 13, 2012 4:37 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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'.

kkl
Experienced User
Posts: 306
Joined: Wed May 04, 2011 9:32 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by 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

yokel22
Experienced User
Posts: 153
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Amazon Echo Skill EchoToEventGhost

Post by 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 63 times

DanRoss
Posts: 19
Joined: Wed Mar 23, 2016 2:15 am

Re: Amazon Echo Skill EchoToEventGhost

Post by DanRoss » Thu May 04, 2017 11:34 pm

Surio89 wrote:After a few problems it works now but it would be nice to say "alexa, turn on projector" instead of using an additional invocation name.

Did somebody manage to setup a Smart Home Skill where you dont have to use an invocation name?
https://developer.amazon.com/public/sol ... -skill-api

I setup a Smart Home Skill using AWS Auth0 following this Blogger but it got to complex for me in later steps...
https://developer.amazon.com/blogs/post ... home-skill
https://developer.amazon.com/blogs/auth ... el+Palermo

maybe somebody with some more experience in amazon aws could manage this and give us some advice.

You could create a separate skill and make the invocation name "the projector" so you can say "alexa, tell the projector to turn on"

holdestmade
Posts: 49
Joined: Thu Dec 04, 2014 2:44 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by holdestmade » Fri Jun 09, 2017 12:46 pm

I have finally got this to work. Many thanks to m19brandon.

I'd also like to thank jimbowen as he helped me figure out after hours of trying that Peerblock was blocking the skill !

Working with an RTI XP6 remote processor and a Vera Z wave controller, I have full voice control of my lights, heating, av systems, alarm etc. "watch tv", "play game" etc

I also use canned responses (I recorded from Amazon Alexa Skill test page using Audacity) using eventghost for events from my RTI remote and vera via UDP and TCP, ie "The garage door is open", "the drying is complete", "there is someone at the front door",

Also, using an android tablet with tasker, have notifications such as "new ebay bid", "the green bin will be collected tomorrow" etc using UDP to eventghost

I have my echo dot feeding into line in of my server PC and server PC outputs to a bluetooth speaker so Alexa and the Alexa recorded responses come out the same place and sound as one.

Thanks to all.

Simon

phairplay
Posts: 10
Joined: Wed Jan 18, 2017 12:02 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by phairplay » Fri Jun 09, 2017 1:11 pm

Hi @holdestmade
Could you share your alexa skill set up?
I'm not sure I have Mine set up correctly

holdestmade
Posts: 49
Joined: Thu Dec 04, 2014 2:44 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by holdestmade » Fri Jun 09, 2017 1:46 pm

Not really sure I've anything to add as all the info is on here but here are screenshots of my Amazon setup and the python script needed in eventghost

Make sure your webserver is setup and running OK first, your router is allowing the webserver port through and that peerblock or firewall are not blocking your port

Let me know if you need any specific info.

Cheers.

Image
Image
Image
Image
Image
Image

holdestmade
Posts: 49
Joined: Thu Dec 04, 2014 2:44 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by holdestmade » Fri Jun 09, 2017 3:37 pm

Not sure if this is possible - can you send text to Alexa from Eventghost to speak ?

I know its possible with a reply using this skill, was thinking like a direct notification ?

Thanks

Simon

m19brandon
Experienced User
Posts: 177
Joined: Mon Feb 03, 2014 10:36 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by m19brandon » Sat Jun 10, 2017 2:10 pm

Not yet, Amazon just released push notifications to a select number of development teams but I hope by the end of the year a public framework will be release.

Post Reply