alexa-samples / alexa-smarthome

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

Couldn't find any new smart home devices #43

Closed rajeshdhoot closed 6 years ago

rajeshdhoot commented 6 years ago

Hi, I have posted my issue in forum. Following is the link of it:

https://forums.developer.amazon.com/questions/107832/couldnt-find-any-new-smart-home-devices.html#answer-108133

I am getting problem with discovery response. Discovery command hit Lambda function. But Alexa is not detecting any smart home devices. I have check the response of Lambda function with JSON Schema Lint, it is not showing any error. I am deploying Lambda in JAVA8. Please help me, I am stuck here.

DotNetPat commented 6 years ago

Hey, I kind of have the same issue. Even when I try to return the sample of the discovery response as it is (https://github.com/alexa/alexa-smarthome/blob/master/sample_messages/Discovery/Discovery.response.json). The validator says its valid and also the validator says, that mine is valid too. But Alexa simply says she was not able to find any new devices.

I also submited this to Alexa support but i just got kind of an automated message, nothing informative that could help to solve the issue.

This is my post: https://forums.developer.amazon.com/questions/109213/devices-not-discovered.html

rajeshdhoot commented 6 years ago

Hi @DotNetPat, Initially I was using custom Lambda Handler "RequestHandler", The I switch over to Stream Request Handler, "RequestStreamHandler", with this change my problem get solved. Hope this may help you. All the best!

DotNetPat commented 6 years ago

Unfortunately it did not fix the problem, Im not using Java anyway. I have no clue why a valid response and also the sample response is not working when returned on discovery. perhaps its because its hosted in Ireland xD But im forced to host it in Ireland, because my Alexa is speaking German. Anyway, without information about the processing of the response in Alexa it seems to be impossible ...

rajeshdhoot commented 6 years ago

You have to select that language which is supported in the region of your Lambda function. Check your Lambda function Region and language of Skill.

DotNetPat commented 6 years ago

Found it out, god such a silly mistake. I built up the response as an anonymous obejct graph. But I serialized it before returning, so it got serialized twice because returning an object graph triggers serialization xD

mikemaas-amazon commented 6 years ago

I have had something like this happen to me when using Python and returning not just a dict, but a dict dumped as a JSON string. Usually a quick look at the logs and the oddly serialized response contents sets me back on track.

rajeshdhoot commented 6 years ago

Great Job. It is working. Congratulations!