http://qs321.pair.com?node_id=11126138

Bod has asked for the wisdom of the Perl Monks concerning the following question:

Happy New Year to all in and visiting the Monastery

This isn't all a strictly Perl question but I know that here we have a huge diversity of knowledge and skill and I am really hoping someone can point me in the right direction as I seem to be getting absolutely nowhere. I've hit the point where "it isn't doing what the documentation says it does" which usually means I am missing something obvious!

As part of the Controlling USB on Raspberry Pi project, I have connected the RPi to Alexa using ngrok to provide the tunnel to the remote device and HTTP::Server::Simple to handle instructions from Alexa. I specifically wanted to use Smart Home instead of a Skill so that we can use Alexa, open the curtains instead of having to use Alexa, ask the curtains to open. The major downside of this choice is having to use AWS Lambda to handle the calls. But...*sigh of relief*...it is all working and Alexa can open and close the curtains :)

What Alexa cannot do is report whether or not the curtains are open.

Within the Discovery.Response directive that I send to Alexa, I set "retrievable": true which should allow me to ask Alexa, are the curtains open?. When I ask that I get Sorry, curtains doesn't support that and no ReportState directive is passed to my code on Lambda.

This is the relevant part of the "capabilities" section of the Discovery.Response directive.

"capabilities": [ { "type": "AlexaInterface", "interface": "Alexa.ToggleController", "instance": "Curtains", "version": "3", "properties": { "supported": [ { "name": "toggleState" } ], "proactivelyReported": false, "retrievable": true, "nonControllable": false }, "semantics": { "actionMappings": [ { "@type": "ActionsToDirective", "actions": [ "Alexa.Actions.Close" ], "directive": { "name": "TurnOff", "payload": {} } }, { "@type": "ActionsToDirective", "actions": [ "Alexa.Actions.Open" ], "directive": { "name": "TurnOn", "payload": {} } } ] } } ]
Any suggestions of what I can try to debug the problem would be greatly appreciated.

Back to Perl - does anyone have any experience of using Perl within the AWS Lambda ecosystem using AWS::Lambda? Is it as easy an the documentation makes out? I can foresee all sorts of issues with creating an EC2 instance and trying to ensure all the paths are correct when deploying the Perl build.