question

newuser-b5afff99-bc28-40b4-8026-8940f88d22d6 avatar image

My alexa smart home skill not calling lambda function.

Hi,

My lambda function is in region N.Virginia and smart home skill geographical region is North America. I am able to authenticate and enable skill in alexa app but it is not invoking lambda function. I have entered correct application id in lambda triger with smart home alexa. i have also configured smart home skill with correct lambda ARN. How to fix this problem ???

alexa smart home
3 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mike-Michael-R avatar image Mike-Michael-R commented ·

If you add the CloudWatch Logs it will be more easy to answer your question...

0 Likes 0 ·
newuser-b5afff99-bc28-40b4-8026-8940f88d22d6 avatar image newuser-b5afff99-bc28-40b4-8026-8940f88d22d6 Mike-Michael-R commented ·

When i am selecting EU(Ireland) region for lambda function my alexa app then discover my devices but voice enabled device not discovering. Again when i am selecting N.virginia region my alexa app unable to discover devices as it is not invoking lambda. lambda cloudWatch log is empty in case of N.virginia region.

0 Likes 0 ·
Jamie Grossman avatar image Jamie Grossman ♦♦ commented ·

Hi there,

Can you please confirm the following?

  1. Have you set up the Alexa Smart Home Event trigger in AWS Lambda?
  2. Are you receiving events to your lambda? To confirm, you should add logging to your lambda function at the very beginning of the execution such as
exports.handler = function(request, context) { 
console.log(JSON.stringify(request)); 
... 
... 
} 

Then confirm the events are getting logged in the cloudwatch logs.

0 Likes 0 ·
visztpeter avatar image
visztpeter answered

My problem was that i used the node.js alexa-smart-home-skill-adapter blueprint while creating my Lambda function, but this has old event namespaces defined. You need to change it based on the sample python code that you can see here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/steps-to-create-a-smart-home-skill#create-a-lambda-function

So for example:

case 'Discovery'

Should be:

case 'Alexa.ConnectedHome.Discovery'

And so on... After the changes, it was working as expected. Without these changes, the CloudWatch log was completely empty.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks visztpeter. I have already checked these conditions and its exactly what you suggested.

When i am selecting EU(Ireland) region for lambda function my alexa app then discover my devices but voice enabled device not discovering. Again when i am selecting N.virginia region my alexa app unable to discover devices as it is not invoking lambda. lambda cloudWatch log is empty in case of N.virginia region.

0 Likes 0 ·
Jason_Lu avatar image
Jason_Lu answered

Do you have solve this problem ,and how ,I have apper this problem

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

aren avatar image
aren answered

difficult problem, at my place it is the other way around. I only get it to work ( from skill to aws) when I select Virginia for AWS.

when I select ireland, I can test my AWs part, and that works. but it seems that the skill cannot reach ireland??

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I have the same problem. Even if I choose the 'English (UK)' language in the skill, my 'EU west (Ireland)' lambda never gets called. I must host the lambda in Virginia.

0 Likes 0 ·
Rohit avatar image
Rohit answered

With me also Ireland lambda skill is getting discovered while the NVirginia Skill is not. Any update on this ?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.