keatontaylor / alexa-actions

A README and associated code to get actionable notifications setup for Alexa devices.
GNU General Public License v3.0
391 stars 186 forks source link

[Bug]: Chapter: "Alexa Talking to Home Assistant (The Skill)" - Not working at all! #242

Closed Flutzi closed 5 months ago

Flutzi commented 6 months ago

Did you check our FAQ and Issue/PR for similar issues?

Contact Details

No response

What happened?

Hello.

I hope you can help me. During setup, I followed everything step by step. In the third chapter "Alexa Talking to Home Assistant (The Skill)", I worked through everything from start to finish exactly.

Now, when I try to test the skill and I enter the command "öffne actionable notifications" (in Englisch: "open actionable notifications") in the "Alexa Development Console" under "Test", it responds with: "Bei der Antwort des angeforderten Skill ist ein Problem aufgetreten." (in English: "There was a problem with the response of the requested skill!").

I have provided both my server (set up via cloudflared) and the token as described. Nevertheless, this error message appears every time after about 2-3 seconds.

Can someone tell me what's causing this? That would be really awesome. Thank you very much in advance for your help!

Version

-

What Alexa device are you using?

Echo

What other Alexa device are you using?

No response

Relevant log output

No response

DEADSEC-SECURITY commented 6 months ago

I need the skill logs to be able to help. Activate debug mode and send me the log output after duing a call.Sent from my Galaxy -------- Original message --------From: Flutzi @.> Date: 3/8/24 2:00 PM (GMT-08:00) To: keatontaylor/alexa-actions @.> Cc: Antonio @.>, Assign @.> Subject: [keatontaylor/alexa-actions] [Bug]: Chapter: "Alexa Talking to Home Assistant (The Skill)" - Not working at all! (Issue #242) Did you check our FAQ and Issue/PR for similar issues?

FAQ checked! Issues/PR checked!

Contact Details No response What happened? Hello. I hope you can help me. During setup, I followed everything step by step. In the third chapter "Alexa Talking to Home Assistant (The Skill)", I worked through everything from start to finish exactly. Now, when I try to test the skill and I enter the command "öffne actionable notifications" (in Englisch: "open actionable notifications") in the "Alexa Development Console" under "Test", it responds with: "Bei der Antwort des angeforderten Skill ist ein Problem aufgetreten." (in English: "There was a problem with the response of the requested skill!"). I have provided both my server (set up via cloudflared) and the token as described. Nevertheless, this error message appears every time after about 2-3 seconds. Can someone tell me what's causing this? That would be really awesome. Thank you very much in advance for your help! Version

What Alexa device are you using? Echo What other Alexa device are you using? No response Relevant log output No response

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were assigned.Message ID: @.***>

Flutzi commented 6 months ago

Thank you very very much for your answer! When I type in "öffne actionable notifications", this is the log for this command:

(Info: I connected my Homeassistant first with public-url (via cloudflared) and token. I changed this now to account linking without token and Nabu-Casa-URL (afterwards I linked my account in Alexa-App under Skill>Dev>Alexa Actionable Notification>Settings>Account Linking. The App said, that the Link was successful. But I cannot open the skill in the Developer Console)

Device Log

[23:46:30:391] - Event: Text.TextMessage [23:46:31:559] - Directive: SkillDebugger.CaptureDebuggingInfo [23:46:31:589] - Directive: SkillDebugger.CaptureError [23:46:31:864] - Directive: SkillDebugger.CaptureDebuggingInfo [23:46:31:882] - Directive: SkillDebugger.CaptureDebuggingInfo [23:46:31:904] - Directive: SkillDebugger.CaptureError [23:46:31:942] - Directive: SpeechSynthesizer.Speak [23:46:31:975] - Directive: CardRenderer.RenderCard [23:46:31:994] - Directive: SpeechRecognizer.RequestProcessingCompleted [23:46:32:213] - Event: SpeechSynthesizer.SpeechStarted [23:46:36:361] - Event: SpeechSynthesizer.SpeechFinished

Flutzi commented 6 months ago

I've now tried for an additional 6 hours and am feeling completely desperate at this point. After the twentieth backup I restored, I attempted the installation once again using the automatic installation 'AlexaActionAssistant' from Hassassistant (see: 'https://github.com/Hassassistant/AlexaActionAssistant'). The installation went smoothly. However, I'm encountering the same issue as the dozens of times before. When I run the script, I receive the message: 'There was a problem with the requested skill's response.'

So I assume the problem lies somewhere in the connection between the HA server and Alexa. However, I can't pinpoint exactly what the issue might be. I've tried both the Cloudflare and NabuCasa variants with tokens, as well as the variant via Account Linking.

No matter what I try, it just remains unsuccessful. Both in the Developer Console and via Home Assistant, it tells me: 'There was a problem with the requested skill's response.'

Does anyone have any idea where the problem might lie? Or is there a working alternative that you could recommend? I'm grateful for any help!

DEADSEC-SECURITY commented 6 months ago

Those logs look incomplete, please send new ones.

jross37 commented 6 months ago

I'm running into the exact same issue. Also using Cloudflare. I've gone through the instructions at least 5 different times and getting the same error "There was a problem with the requested skill's response."

ilwalti commented 5 months ago

Same here. Installed the latest-and-greatest 0.12.2, using italian as a language (and I get the error in Italian, that's fine!) Rebuilt some times from scratch, no joy. This is debug log for the error...

{
    "header": {
        "namespace": "SkillDebugger",
        "name": "CaptureError",
        "messageId": "d7b7b350-b751-40b7-a461-xxxxxxxxxxxxxxxxx"
    },
    "payload": {
        "skillId": "amzn1.ask.skill.d8ec62a4-b9da-44de-9a06-xxxxxxxxxxxxxxxx",
        "timestamp": "2024-03-12T13:40:58.113Z",
        "dialogRequestId": "1967f08e-6bc7-4d4c-82ea-xxxxxxxxxxxxxx",
        "skillRequestId": "amzn1.echo-api.request.f08cc94d-878b-4578-acd1-xxxxxxxxxxxxx",
        "code": "SKILL_ENDPOINT_ERROR",
        "description": "Skill execution returned an exception for requestId amzn1.echo-api.request.f08cc94d-878b-4578-acd1-xxxxxxxxxx",
        "debuggingInfo": {
            "type": "SkillExecutionInfo",
            "content": {
                "invocationRequest": {
                    "endpoint": "arn:aws:lambda:eu-west-1:500099140155:function:xxxxxxxxxxxx",
                    "body": {
                        "version": "1.0",
                        "session": {
                            "new": true,
                            "sessionId": "amzn1.echo-api.session.xxxxxxxxxxxxx",
                            "application": {
                                "applicationId": "amzn1.ask.skill.xxxxxxxxxxxxxxxxx"
                            },
                            "attributes": {},
                            "user": {
                                "userId": "amzn1.ask.account.xxxxxxxxxxxxx"
                            },
                            "affiliatedResources": []
                        },
                        "context": {
                            "Extensions": {
                                "available": {
                                    "aplext:backstack:10": {}
                                }
                            },
                            "Advertising": {
                                "advertisingId": "00000000-0000-0000-0000-000000000000",
                                "limitAdTracking": true
                            },
                            "System": {
                                "application": {
                                    "applicationId": "amzn1.ask.skill.xxxxxxxxxxxxxxxxxxx"
                                },
                                "user": {
                                    "userId": "amzn1.ask.account.xxxxxxxxxxxxxxxx"
                                },
                                "device": {
                                    "deviceId": "amzn1.ask.device.xxxxxxxxxx",
                                    "supportedInterfaces": {}
                                },
                                "apiEndpoint": "https://api.eu.amazonalexa.com",
                                "apiAccessToken": "xxxxxxxxxxxxxxx"
                            }
                        },
                        "request": {
                            "type": "LaunchRequest",
                            "requestId": "amzn1.echo-api.request.f08cc94d-878b-4578-acd1-xxxxxxxxx",
                            "locale": "it-IT",
                            "timestamp": "2024-03-12T13:40:57Z",
                            "shouldLinkResultBeReturned": false
                        }
                    }
                },
                "metrics": {
                    "skillExecutionTimeInMilliseconds": 430
                }
            }
        }
    }
}

Any hints?

vicky-katara commented 5 months ago

Seeing the same issue. I also updated the Lambda code to log the bearer token. Used that bearer token with a curl command, and it works fine.

I also moved from a cloudflare-tunnel fronted URL to a direct link (via port forwarding) url -- and I see the same thing -- a 401 response.

The best bet IMO now seems like a home-assistant update has caused the response / token headers to get interpretted incorrectly?

jross37 commented 5 months ago

Seeing the same issue. I also updated the Lambda code to log the bearer token. Used that bearer token with a curl command, and it works fine.

I also moved from a cloudflare-tunnel fronted URL to a direct link (via port forwarding) url -- and I see the same thing -- a 401 response.

The best bet IMO now seems like a home-assistant update has caused the response / token headers to get interpretted incorrectly?

In my case I'm running HA v2024.2.0.

RAW297 commented 5 months ago

@keatontaylor @DEADSEC-SECURITY

is there any movement on finding a fix to this issue please?

It seems there are many people all experiencing the same issue.

Happy to help with any logs or testing you need.

See here for logs I uploaded recently.

if you need other logs please direct me where to find them and will happily provide and test as required, have some free time Friday to test if needed.

` INIT_START Runtime Version: python:3.8.v43 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:b20481443932830049531ab20faaf09295061aff7a67a0b0f40496e5e1ddec59

LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'isodate' Traceback (most recent call last): `

danielbrunt57 commented 5 months ago

It's working now for me. I found & downloaded AlexaActionsNoBinaryLinuz.zip (v0.12.2) & imported the code into my lambda as per the Wiki instructions which was the crucial piece I was missing. That step is relatively new and is NOT in other online tutorials, etc!

I edited the URL in lambda_function.py, deployed it and it's working.

image

image

Flutzi commented 5 months ago

@danielbrunt57

Wow! That was the solution! Thank you very much! Finally, the step worked!

My mistake was that I couldn't find the file "AlexaActionsNoBinaryLinux.zip" at all. Instead, during the skill installation, I inserted the GitHub link or uploaded the ZIP file (However, the ZIP file that can be downloaded from the code page is named "alexa-actions-master"). Maybe it's time to tidy up the wiki here and make the description a bit clearer.

Otherwise, it works great, even with Cloudflared. If you encounter any issues with Cloudflared, try logging in there, select your URL, then go to "Security" > "Bots" on the left, and disable "Bot Fight Mode". That might help some users.

Again, a big thank you to you @danielbrunt57! You were a huge help!

danielbrunt57 commented 5 months ago

@danielbrunt57

Wow! That was the solution! Thank you very much! Finally, the step worked!

My mistake was that I couldn't find the file "AlexaActionsNoBinaryLinux.zip" at all. Instead, during the skill installation, I inserted the GitHub link or uploaded the ZIP file (However, the ZIP file that can be downloaded from the code page is named "alexa-actions-master"). Maybe it's time to tidy up the wiki here and make the description a bit clearer.

Otherwise, it works great, even with Cloudflared. If you encounter any issues with Cloudflared, try logging in there, select your URL, then go to "Security" > "Bots" on the left, and disable "Bot Fight Mode". That might help some users.

Again, a big thank you to you @danielbrunt57! You were a huge help!

I worked on this for days and like you I also use Cloudflare and was making the same mistakes until I woke up this morning and found the elusive zip file with the missing/required components (which is all new this month I think)! Previous to that though, I was following a cached wiki page I had open which contained the old instructions (like all other guides & online videos). I spent hours yesterday with python/pip trying to put together what was missing. Then I loaded a new page and WTH, this is different from my other page & what/where is this ZIP file??? I will post something/somewhere about my Cloudflare tunnel setup to keep the baddies out yet allow me on my phone or my laptop to get to my HA and Vaultwarden and also permit the Home Assistant Alexa skill (which serves double duty to permit Actionable Notifications). I'm also going to do a PR to update the wiki with a minimum of a clickable link to the releases area to download the file:

  1. Go to the latest release of the skill and download the zip file called AlexaActionsNoBinary.zip
RAW297 commented 5 months ago

@danielbrunt57

You legend! That has now worked for me too!

@keatontaylor @DEADSEC-SECURITY

Could we see the installation documentation updated to include links to where to find the relevant downloads etc. Speaking for myself, i'm no devleoper and was simply following the instructions slightly blind as wasn't able to find the Zip files even after searching in Github.

Thanks again for sharing @danielbrunt57.

danielbrunt57 commented 5 months ago

Wiki updated.

image

And new image reflecting what you would see after import...

image

danielbrunt57 commented 5 months ago

Now to get the authors of ALL of the 3rd party how-to's & videos updated........

BTW, I danced around my office for a while when Alexa responded with "Did you prepare your coffee? rather than "There was a problem with the requested skill's reponse"!

jross37 commented 5 months ago

Wiki updated.

image

And new image reflecting what you would see after import...

image

Thank you! This is much clearer. Originally it sounded like the code import was more optional -- other walk throughs (and the wiki) made it seem like all you needed to was copy in the 5 files or so. Looks like there's a lot more that comes in with the import.

Appreciate the help from everyone!

danielbrunt57 commented 5 months ago

@keatontaylor @DEADSEC-SECURITY (and everyone else) - Your welcome!!!

Flutzi commented 5 months ago

@danielbrunt57

Thank you again for your crucial hint. I was finally able to successfully connect Alexa with HA, and now Alexa is also asking me: „Did you prepare your coffee?“ So, I’m getting the appropriate question, which is saved in the input_text.helper, but it doesn’t matter what I answer, Alexa unfortunately always says: “You just triggered AMAZON.FallbackIntent.”

Have you happened to stumble upon the same issue and have any advice?

DEADSEC-SECURITY commented 5 months ago

Thank you @danielbrunt57

danielbrunt57 commented 5 months ago

Alexa unfortunately always says: “You just triggered AMAZON.FallbackIntent.”

My first thought upon reading this is your skill likely only lists the 4 very basic intents (Cancel. Help, Stop & NavigateHome). There should be 11 and your JSON Editor should look like this...

image

and if it doesn't then there probably was a missed/incorrect step when building the new skill.

Flutzi commented 5 months ago

@danielbrunt57

Oh man, you're really a god. Thank you very much, that's exactly where the problem lies. Strangely, I only had 6 intents listed in the JSON editor. Even when I rebuilt the skill, only 6 intents were to be found. I have now found the corresponding JSON file here on GitHub and manually inserted the missing lines. Now it finally works! Thank you so much for helping me and others so much! You're truly a selfless gentleman. I wish you a beautiful and fulfilling life, stay as you are :)

danielbrunt57 commented 5 months ago

Thank you @danielbrunt57

@DEADSEC-SECURITY @Flutzi I just stepped through the wiki instructions carefully to create a new Test skill and was unable to follow the instructions step-by-step having to guess what to do next and ended up with only the basic default 6 slot types rather than the custom skill's required 11 slot types.

image

There's a step missing in between...

Finally select your "Hosting region".

Screenshot of region selection Click the button "Next" in the upper right hand corner.

and here...

Importing the Code

  1. Go to the latest release of the skill and download the zip file called AlexaActionsNoBinary.zip

That step is to import the skill from https://github.com/keatontaylor/alexa-actions.git:

image

If we don't do that then we end up missing the custom JSON file as I and others have done!

I'll modify the wiki...

danielbrunt57 commented 5 months ago

@DEADSEC-SECURITY @Flutzi I've finished a major revamp of the Wiki at https://github.com/keatontaylor/alexa-actions/wiki/Alexa-Talking-to-Home-Assistant-(The-Skill). I'd appreciate someone (Antonio?) stepping through it as a total noob to see if it's accurate now and whether there any errors, omissions, typos, etc. as it it 2:15 am and I'm totally knackered now!!! Thanks.

legolas0802 commented 5 months ago

I followed all the instructions in the post, the updated guide, tried both new zip files, but I still have the same problem

danielbrunt57 commented 5 months ago

I followed all the instructions in the post, the updated guide, tried both new zip files, but I still have the same problem

Retry but use my forked repo to import the skill from and you can skip the ZIP upload step as I've added those to my repo.

Seppel62 commented 5 months ago

I can not do it. no matter what I do Error "There was a problem responding to the requested skill" Alexa_media_player works. Alexa can switch devices from HA, text from HA arrives at Alexa devices. "SKILL_ENDPOINT_ERROR" is displayed as an error in Alexa Developer

flynbvr commented 5 months ago

I started with some of the well known deployment videos only to discover theyre now deprecated. I tried multiple times before I found this thread. Then I attempted the deployment 4 more times using the current wiki information but I still get the same "problem responding". An unfortunate waste of time at this point. The rabbit hole is so deep Im not sure when Ill see light again.

DEADSEC-SECURITY commented 4 months ago

Wiki got updated recently. Also activate debug mode and send me logs @flynbvr