alexa-samples / alexa-smarthome

Resources for Alexa Smart Home developers.
https://alexa.design/smarthome
Other
682 stars 336 forks source link

Smart home skill not invoking lambda #89

Closed Kasuhikdas closed 10 months ago

Kasuhikdas commented 5 years ago

Having the problem with skill not calling lambda. My skill is English(US) and Lambda is (N. Virginia). After account linking the discovery is not happening. -Lambda Trigger is enabled -Gerographical Location is English(US) and N.virginia -Device discovery in test is happening -In app and test console it does not call the lambda there is no cloud watch logs.

Can anyone suggest what is the #problem? If i need to change the endpoint what should be the region?

paolonz82 commented 5 years ago

I had the same problme. Did you resolve this issue?

Kasuhikdas commented 5 years ago

For me Ireland lambda is working.

paolonz82 commented 5 years ago

Ireland lambda and Language Skill English Uk? My developer account Country is Italy

Kasuhikdas commented 5 years ago

My skill language is English us but I am accessing from India so Ireland is working.

On Tue, Nov 13, 2018, 1:02 AM paolonz82 <notifications@github.com wrote:

Ireland lambda and Language English Uk?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexa/alexa-smarthome/issues/89#issuecomment-437979591, or mute the thread https://github.com/notifications/unsubscribe-auth/AZoRDJQnqjx4byDAZnnNI_QuyqRZsjWFks5uubtAgaJpZM4X3Nfi .

moonlitknight commented 5 years ago

same here. All IDs double checked, tried Lamdas in US East and EU West, Lambdas tested working, but never called by the skill.

Kasuhikdas commented 5 years ago

@moonlitknight did you set arn in default region or geographical region? try to setting the lambda arn in both default and geographical region.

moonlitknight commented 5 years ago

@Kasuhikdas yes I tried that

pinoyyid commented 5 years ago

After leaving this overnight, it is now working with no changes from me. Additionally, a number of local devices which had suddenly stopped working 3 weeks ago have today started working again. This smells like an internal issue that Amazon have fixed.

lubols commented 5 years ago

are there any news about this problem ? I have the same issue, Lambda function tests are OK, alse i can see the logs from lambda test but when I try to discover device in my app i get no new devices, even from test simulator, no logs in CloudWatch...just nothing. It looks like lambda function is not responding to skill call. I followed the instructions step by step and everything went smoothly until app device discover :/

andrew01144 commented 5 years ago

FYI - My fix for this problem:

My Echo and I are in the UK. I followed the instructions for skill-sample-python-smarthome-switch, creating the Lambda and DynamoDB in us-east-1. As others have found: Discovery does not discover, and the Lambda is not triggered.

My Fix: Skill - Add language, so it has English(US) and English(UK) - not sure if this is required. Lambda - Create the function in Ireland (eu-west-1). Skill - add the new Lambda's eu-west-1 ARN to the endpoint box for 'Europe, India'. DynamoDB - Create the table in in Ireland (eu-west-1). (Leaving the existing us-east-1 Lambda function and DynamoDB table seems not a problem).

Now discovery works. I say: Alexa, turn on/off sample switch. Looking at the DynamoDB "Items", I can see the value change between ON and OFF.

Why Ireland? It looks like London does not have support for Alexa.

omernaeem commented 4 years ago

I am having the exact same issue. Following the fix from andrew01144, I created lambda function in Ireland, and added language English UK but it didnt work

Then I added one more Lambdafunction in N. Virginia. So now I have three endpoints in (N.Virginia, Ireland and Oregon) Three languages (US, UK, AU)

After enabling the Skill, and starting discovery. None of the lambda functions in all three regions are invoked.

theGeekyLad commented 4 years ago

For me Ireland lambda is working.

I live in India and my Alexa skill is in English (IN). As far as I understand, the skill's region is language-agnostic as it depends on where the Amazon developer account is based. I tried creating Lambda functions in us-east-1 and eu-west-1 matching it with Alexa skills created in English (IN) as well as English (US) (with the same Indian Amazon developer account though). While the eu-west-1 Lambda function is never triggered irrespective of the Alexa skill language, the us-east-1 function with either of the Alexa skills behaves weirdly, illustrated as follows:

  1. I ask Alexa to initiate a discovery request. My home server logs correctly show that the discover-devices endpoint was fired by the Lambda function linked with this skill.
  2. I ask Alexa to turn on the fan. There is no new log record on my home server stating that a request was made to turn the fan on. Hence the command seems to have done nothing.
  3. I ask Alexa to turn off the tubelight. My server logs show that the power-state-toggle endpoint was fired by the Lambda function, but to "turn on the fan" (evidently, this is the "previous" request in pt-2).
  4. I ask Alexa to turn off the fan. This time, just as in the pt-3 case, the logs show that the tubelight has been turned off (note: "turn off fan" request seems to be queued).
  5. Interestingly, if I now initiate another discovery request, my server logs show that it has received 2 requests one after the other:
    1. Turn off the fan (as requested in pt-4)
    2. Get the list of devices
  6. Any subsequent non-discovery request follows the same cycle as above.

I left a post here on Amazon Developer Forums fleeting hours ago which has been under moderation ever since.

Any idea guys?

Xyon75 commented 3 years ago

Same problem:

dievaa commented 10 months ago

The discovery process can potentially fail because of a mismatch between the account's PFM (Preferred market place), the skill locale, and the lambda endpoint region.

For example, if your skill locale includes en-US, if you want to make the discovery work for US customers, you should deploy the lambda function also in the us-east-1 region. If you want to test it, you also have to set the PFM of your dev account to US.

You can find additional information here: https://developer.amazon.com/en-US/blogs/alexa/device-makers/2023/07/smart-home-discovery-alexa-july-2023