Amazon Echo Skill EchoToEventGhost

If you have a question or need help, this is the place to be.
Post Reply
m19brandon
Experienced User
Posts: 177
Joined: Mon Feb 03, 2014 10:36 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by m19brandon » Wed Jul 19, 2017 1:10 am

I know what you mean. My kids have figured out the tv.

dfawlt
Posts: 2
Joined: Wed Aug 30, 2017 4:03 am

Re: Amazon Echo Skill EchoToEventGhost

Post by dfawlt » Wed Aug 30, 2017 4:15 am

I can't figure out how to not fire all python script macros simultaneously.

I've made 3 macros, each with an HTTP.EchoToEG inside, followed by the python script.

And then 3 macros, each with an event name (referenced in their own sister python script).

I've tried one macro with one HTTP.EchoToEG inside, and 3 python scripts.

I've tried one python script that has multiple if statements, but it will always revert to the else and ask me to try again.

I'm sure this is more a EG thing, but I'd really appreciate some help.\

TIA

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

Re: Amazon Echo Skill EchoToEventGhost

Post by m19brandon » Wed Aug 30, 2017 6:43 pm

They should run serially versus simultaneously. Is that what you are seeing?

arkania
Posts: 5
Joined: Mon Nov 23, 2009 6:00 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by arkania » Thu Sep 07, 2017 5:53 pm

Hey guys, quick question. When I try and fire an event I'm getting this format in eg:

HTTP.EchoToEG [u',ts',u",u'SessionId.xxx"]

Not sure when EG is getting the event from Amazon in this format. Any ideas? It won't fire macros properly for me in this format.

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

Re: Amazon Echo Skill EchoToEventGhost

Post by m19brandon » Thu Sep 07, 2017 8:20 pm

The post from Amazon should be in this format. There is a sample py file in the download.

0 #command
1 #Location (deviceID)
2 #SessionID
3 #RequestID

arkania
Posts: 5
Joined: Mon Nov 23, 2009 6:00 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by arkania » Sat Sep 09, 2017 1:06 pm

Ah, okay, thanks so much!

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

Re: Amazon Echo Skill EchoToEventGhost

Post by User1306 » Thu Sep 28, 2017 2:13 pm

just a quick question.
i'm about to buy another amazon echo Dot, and i was wondering if you can run the same skill on both to be able to interact with evenghost, or do i need to make a copy of the skill and add one skill on each device?
thanks in advance

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

Re: Amazon Echo Skill EchoToEventGhost

Post by m19brandon » Sun Oct 01, 2017 11:56 pm

The version of the code from July will pass the deviceID to EG as part of the payload, you just need to map that out in your python code. No need for different skills name per device anymore.

I have 1 echo, 2 dots and Alexa on my cell. I say Alexa tell home to turn on the lights and the EG can figure out where I am based on the device ID passed. No need to say Alexa tell home to turn on the master bedroom lights anymore.

Hope that helps.

Atramhasis
Posts: 13
Joined: Sun Feb 18, 2007 8:50 am

Re: Amazon Echo Skill EchoToEventGhost

Post by Atramhasis » Tue Oct 10, 2017 1:25 pm

Thank you for this cool tool, m19brandon!
The Amazon Services changed the UI a bit, so I had to think a bit how to set it up, but it works now!

Seenig e.g. @dfawlt struggle with the python script to switch all commands, I had a similar problem. You just have to use one script and the loop if: elif: else: (see docs).

An other problem was, that I use the german version of Alexa and it does not support LITERAL as slot type (just US english). So I have created a custom slot type ("LIST_OF_ACTION") and added all commands as values (a bit more work...). The utterance is simply:

Code: Select all

PerformAction {Action}
I also changed all english phrases (like "'Something went wrong,...") to german. @m19brandon Maybe you could separate the strings to make it easy to translate and update to newer versions?

MindEyes
Posts: 2
Joined: Tue Jan 30, 2018 2:15 am

Re: Amazon Echo Skill EchoToEventGhost

Post by MindEyes » Tue Jan 30, 2018 2:18 am

Atramhasis wrote:
Tue Oct 10, 2017 1:25 pm
Thank you for this cool tool, m19brandon!
The Amazon Services changed the UI a bit, so I had to think a bit how to set it up, but it works now!

Seenig e.g. @dfawlt struggle with the python script to switch all commands, I had a similar problem. You just have to use one script and the loop if: elif: else: (see docs).

An other problem was, that I use the german version of Alexa and it does not support LITERAL as slot type (just US english). So I have created a custom slot type ("LIST_OF_ACTION") and added all commands as values (a bit more work...). The utterance is simply:

Code: Select all

PerformAction {Action}
I also changed all english phrases (like "'Something went wrong,...") to german. @m19brandon Maybe you could separate the strings to make it easy to translate and update to newer versions?
Hey m8, im german too and ive got some problems here
cant fix it to german specifications..
do you mind a upload for me?
it'll help me a lot :o :/

nikeb
Posts: 9
Joined: Fri Dec 19, 2014 12:09 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by nikeb » Tue Oct 30, 2018 10:04 am

Hi guys

Nice guide.
I m guessing it's a bit out-of-date cause the Alexa Developer Portal looks a bit different than your guidelines.
For example i don't know how to copy and paste your files and i don't know if i m doing that right.

slattynan
Experienced User
Posts: 62
Joined: Fri Jul 06, 2018 12:15 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by slattynan » Sun Nov 11, 2018 12:45 am

Hi,

I set this up today, as you say its the setup process has changed significantly. As a result, the tutorial is misleading. It takes a bit of figuring out but still works.

If m19brandon likes I can type up an updated process. Failing that, if you let me know where you are stuck I should have the answer!

Great plugin BTW, I've been having a lot of fun with this beyond the usual HA activities :D

slattynan
Experienced User
Posts: 62
Joined: Fri Jul 06, 2018 12:15 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by slattynan » Fri Nov 16, 2018 5:49 pm

The fun continues with this. I've ordered 2 dots while they are on the early black Friday deals, so I guess I'm all in with this plugin!

My python script now has 300 lines of code and continues to grow as I find more amusing ways to interact with my home. Giving my home a voice powered by my childish humour is not what I intended when I started playing with HA :lol:

dfawlt
Posts: 2
Joined: Wed Aug 30, 2017 4:03 am

Re: Amazon Echo Skill EchoToEventGhost

Post by dfawlt » Sun Jan 20, 2019 7:43 pm

slattynan wrote:
Sun Nov 11, 2018 12:45 am
Hi,

I set this up today, as you say its the setup process has changed significantly. As a result, the tutorial is misleading. It takes a bit of figuring out but still works.

If m19brandon likes I can type up an updated process. Failing that, if you let me know where you are stuck I should have the answer!

Great plugin BTW, I've been having a lot of fun with this beyond the usual HA activities :D
I'm stuck at the IntentScheme JSON code. Pasting the below gives me errors.

{
"intents": [ {
"intent": "PerformAction",
"slots": [ {
"name": "Action",
"type": "LITERAL"
} ]
} ]
}

Could you offer a hand when you have a minute? my username @ gmail would ping me fastest, cheers

slattynan
Experienced User
Posts: 62
Joined: Fri Jul 06, 2018 12:15 pm

Re: Amazon Echo Skill EchoToEventGhost

Post by slattynan » Thu Jan 24, 2019 9:18 pm

dfawlt wrote:
Sun Jan 20, 2019 7:43 pm
slattynan wrote:
Sun Nov 11, 2018 12:45 am
Hi,


Could you offer a hand when you have a minute? my username @ gmail would ping me fastest, cheers

Sure thing, I can talk you through it this weekend. Suggest some times in a PM and we'll sort it out.

I modified my json code slightly from the template (not only to suit the changes to the alexa dev console), its got some content which I'm not sure whether adds any value or not? For instance, I added examples of the most common commands I use in the hope that Alexa would interpret them more easily, as it accepts any command and was working fine I never got round to proving if it improved recognition.

My code is below, hope this helps?


Code: Select all

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "event ghost",
            "intents": [
                {
                    "name": "AMAZON.FallbackIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.NavigateHomeIntent",
                    "samples": []
                },
                {
                    "name": "PerformAction",
                    "slots": [
                        {
                            "name": "Action",
                            "type": "AMAZON.SearchQuery",
                            "samples": [
                                "start screen saver",
                                "screensaver",
                                "start plex",
                                "start kodi",
                                "start spotify",
                                "volume down {Number}",
                                "volume up {Number}",
                                "volume max",
                                "volume down",
                                "Volume up",
                                "restart homeserver",
                                "restart computer",
                                "spotify",
                                "open spotify",
                                "open kodi",
                                "kodi",
                                "plex",
                                "open plex",
                                "fast forward",
                                "rewind",
                                "lock home",
                                "lock house",
                                "skip track",
                                "play music",
                                "turn on",
                                "shutdown",
                                "next track",
                                "previous track",
                                "previous",
                                "turn off",
                                "stop",
                                "pause",
                                "play"
                            ]
                        },
                        {
                            "name": "Number",
                            "type": "AMAZON.NUMBER"
                        }
                    ],
                    "samples": [
                        "Perform Action {Action}"
                    ]
                }
            ],
            "types": []
        },
        "dialog": {
            "intents": [
                {
                    "name": "PerformAction",
                    "confirmationRequired": false,
                    "prompts": {},
                    "slots": [
                        {
                            "name": "Action",
                            "type": "AMAZON.SearchQuery",
                            "confirmationRequired": false,
                            "elicitationRequired": true,
                            "prompts": {
                                "elicitation": "Elicit.Slot.XXXXXXXXXXXXX.XXXXXXXXXXXXX"
                            },
                            "validations": [
                                {
                                    "type": "isInSet",
                                    "prompt": "Slot.Validation.XXXXXXXXXXX.XXXXXXXXXXXX.XXXXXXXXXXXXX",
                                    "values": [
                                        "play",
                                        "lock home",
                                        "restart computer",
                                        "turn off",
                                        "previous",
                                        "spotify",
                                        "skip track",
                                        "restart homeserver",
                                        "pause",
                                        "play music",
                                        "turn on",
                                        "open kodi",
                                        "stop",
                                        "previous track",
                                        "lock house",
                                        "rewind",
                                        "open plex",
                                        "fast forward",
                                        "plex",
                                        "kodi",
                                        "open spotify",
                                        "shutdown",
                                        "next track"
                                    ]
                                }
                            ]
                        },
                        {
                            "name": "Number",
                            "type": "AMAZON.NUMBER",
                            "confirmationRequired": false,
                            "elicitationRequired": false,
                            "prompts": {}
                        }
                    ]
                }
            ],
            "delegationStrategy": "SKILL_RESPONSE"
        },
        "prompts": [
            {
                "id": "Slot.Validation.XXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXX",
                "variations": [
                    {
                        "type": "PlainText",
                        "value": "Command not recognised please try again"
                    }
                ]
            },
            {
                "id": "Elicit.Slot.XXXXXXXXXXXXX.XXXXXXXXXXXXX",
                "variations": [
                    {
                        "type": "PlainText",
                        "value": "What action should I take?"
                    }
                ]
            }
        ]
    }
}

Post Reply