09-26-2017, 10:15 AM
Hello, 
As expected, Amazon has made some changes to both the AWS/Lambda (JS handler) & Developer Console (Alexa Skills) screens since the help documentation was written, including help from prior forum posts.  So I did my best to configure both areas, but Alexa skill testing failed under the Service Simulator using the Utterance...set Volume.  The response I get back is....The remote endpoint could not be called, or the response it returned was invalid.  Note: using the "arn" from Lamda to point new skill in console correctly to handler/JS and pasted the CQC Echo & CQC Echo Skills support files as noted in help doc.
Next, I tried to test the CQCHandler in AWS/Lambda, and fails w/ message:
{
 "errorMessage": "Exception: TypeError: Cannot read property 'application' of undefined"
}
The path to test handler above is: Action, Configure Test Event, Sample Event Template, Alexa Smart Home Discovery.
However, if I use these two Sample Event Templates, Alexa Start Session & End Session, it passes these two tests.  All other Sample Event Templates yield a failure message.
In configuration, I selected Runtime as Node js 4.3,  index.handler, & lambda_basic_execution. Not sure I pasted JS properly in code entry:
CODE Entry:
exports.handler = (event, context, callback) => {
    // TODO implement
    callback(null, 'Hello from Lambda');
};
//
//  Adjust these values to your specific system
//
//      HTTPType is either http or https. The latter is MUCH preferred,
//      but it requires that you have a registered security certificate
//      for your web server and configure the CQC web server to use it.
//
//      The IdKey is just a value that you will configure on the CQC
//      side, to help make sure you are getting a legitimate call from
//      your own Amazon account. Keep in mind though that, if you don't
//      use http, it's sent in the open and anyone could grab it and use it.
//
// The TarAddr and TarPort are your public address and the HTTP or
// HTTPS port of the web server (usually 80 and 443, but you whatever
// you set up when you installed CQC.)
//
var CQC_TarAddr = "1.2.3.4";
var CQC_TarPort = "80";
var CQC_HTTPType = "http";
var CQC_IdKey = "ABCDEF";
//
// Route the incoming request based on type (LaunchRequest, IntentRequest,
// etc.) The JSON body of the request is provided in the event parameter.
etc, etc.,,,============================================================.
BTW: I'm a newbie to CQC and just loaded the product a few days ago to evaluate a purchase w/ my existing HA/HomeTheater; i.e., ElkM1Gold/VantageControls (In-Fusion).  I'm not a programmer (hardware guy), but experienced using design tool/programming and GUI touchscreen development from Vantage (Q-link/Infusion), including Elk M1 programming and setting up rules, etc.  So please be gentle!   I can attached screens or logs if needed.
thanks, Ken
As expected, Amazon has made some changes to both the AWS/Lambda (JS handler) & Developer Console (Alexa Skills) screens since the help documentation was written, including help from prior forum posts.  So I did my best to configure both areas, but Alexa skill testing failed under the Service Simulator using the Utterance...set Volume.  The response I get back is....The remote endpoint could not be called, or the response it returned was invalid.  Note: using the "arn" from Lamda to point new skill in console correctly to handler/JS and pasted the CQC Echo & CQC Echo Skills support files as noted in help doc.
Next, I tried to test the CQCHandler in AWS/Lambda, and fails w/ message:
{
 "errorMessage": "Exception: TypeError: Cannot read property 'application' of undefined"
}
The path to test handler above is: Action, Configure Test Event, Sample Event Template, Alexa Smart Home Discovery.
However, if I use these two Sample Event Templates, Alexa Start Session & End Session, it passes these two tests.  All other Sample Event Templates yield a failure message.
In configuration, I selected Runtime as Node js 4.3,  index.handler, & lambda_basic_execution. Not sure I pasted JS properly in code entry:
CODE Entry:
exports.handler = (event, context, callback) => {
    // TODO implement
    callback(null, 'Hello from Lambda');
};
//
//  Adjust these values to your specific system
//
//      HTTPType is either http or https. The latter is MUCH preferred,
//      but it requires that you have a registered security certificate
//      for your web server and configure the CQC web server to use it.
//
//      The IdKey is just a value that you will configure on the CQC
//      side, to help make sure you are getting a legitimate call from
//      your own Amazon account. Keep in mind though that, if you don't
//      use http, it's sent in the open and anyone could grab it and use it.
//
// The TarAddr and TarPort are your public address and the HTTP or
// HTTPS port of the web server (usually 80 and 443, but you whatever
// you set up when you installed CQC.)
//
var CQC_TarAddr = "1.2.3.4";
var CQC_TarPort = "80";
var CQC_HTTPType = "http";
var CQC_IdKey = "ABCDEF";
//
// Route the incoming request based on type (LaunchRequest, IntentRequest,
// etc.) The JSON body of the request is provided in the event parameter.
etc, etc.,,,============================================================.
BTW: I'm a newbie to CQC and just loaded the product a few days ago to evaluate a purchase w/ my existing HA/HomeTheater; i.e., ElkM1Gold/VantageControls (In-Fusion).  I'm not a programmer (hardware guy), but experienced using design tool/programming and GUI touchscreen development from Vantage (Q-link/Infusion), including Elk M1 programming and setting up rules, etc.  So please be gentle!   I can attached screens or logs if needed.
thanks, Ken