Posts: 283
Threads: 26
Joined: Dec 2012
Dean Roddey Wrote:I assume you tried to open it in something besides a text editor and it tried to run it. You need to open it with Notepad or something like that. Then just make the required modifications at the top, then select all text and paste it into the Lambda function editor.
yes, the .js will mean you'll need to open it from notepad vs double clicking as with .txt file.
Posts: 283
Threads: 26
Joined: Dec 2012
Dean, on the Lambda Configuration tab we have:
Runtime: NodeJS
Handler:
Role: lambda_basic_execution
What are we using for Handler?
Posts: 40,483
Threads: 491
Joined: Aug 2002
I'm not sure if it matters, but set it to "index.handler", without the quotes. I'll update the document to indicate that.
Dean Roddey
Explorans limites defectum
Posts: 40,483
Threads: 491
Joined: Aug 2002
BTW, bring up the log monitor as well. If you get far enough that the web server got a valid Echo command, it will log the info it got. Eventually I'll make this logging verbose only, but for now it's always on. And, if it gets something it doesn't understand it should complain about that in the logs as well.
If you aren't seeing any of this, then you aren't getting far enough to get anything to the web server. The test screen on the skill setup also will go through all the motions, so you should see the web server log stuff if you are getting that far.
Dean Roddey
Explorans limites defectum
Posts: 696
Threads: 62
Joined: Jun 2010
10-11-2015, 04:29 PM
(This post was last modified: 10-11-2015, 04:57 PM by Deane Johnson.)
[cqc]\CQCData\Server\Data\Echo\EchoCfg.Txt
In adding the last \EchoCfg.txt, is that the name of the last folder?
Posts: 283
Threads: 26
Joined: Dec 2012
Dean, can you briefly describe how to create a CQC config file to handle dimmable V2 lighting?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Deane Johnson Wrote:[cqc]\CQCData\Server\Data\Echo\EchoCfg.Txt
In adding the last \EchoCfg.txt, is that the name of the last folder?
EchoCfg.Txt is the name of the file. \Echo\ is the last folder.
Dean Roddey
Explorans limites defectum
Posts: 40,483
Threads: 491
Joined: Aug 2002
pinballmark Wrote:Dean, can you briefly describe how to create a CQC config file to handle dimmable V2 lighting?
Setting a dimming level is very difficult, because we can't accept numbers. They come across as text, e.g. fifty five. I could provide some sort of mapping function for the hundreds of possible variations I guess to turn those into numbers, but that doesn't exist currently.
It would be easier to set a scene, or to use the Set intent to set a faux scene that your action interprets and does the appropriate light actions. The example I give in the PDF document, though it uses volume, would work equally well for some kind of scene setting thing.
Dean Roddey
Explorans limites defectum
Posts: 283
Threads: 26
Joined: Dec 2012
Dean Roddey Wrote:Setting a dimming level is very difficult, because we can't accept numbers. They come across as text, e.g. fifty five. I could provide some sort of mapping function for the hundreds of possible variations I guess to turn those into numbers, but that doesn't exist currently.
It would be easier to set a scene, or to use the Set intent to set a faux scene that your action interprets and does the appropriate light actions. The example I give in the PDF document, though it uses volume, would work equally well for some kind of scene setting thing.
ok, that makes sense. Config example for light on/off?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Nothing different from what you've already set. Just set up an Action= block and point it at some global action you've created. For the values, you could list the lights you want the user to be able to target, so something like:
Code:
Action=
Kitchen, Kitchen Light, Kitchen Lights
Bedroom, Bedroom Light, Bedoom Lights
EndAction
in the SetMap section. So they'd say something like:
Alexa, tell CQC to turn the Bedroom Lights off (or on)
That translates to a SetOff or SetOn intent, which shows up to you something like:
Intent=CQCSetOffIntent
Target=Kitchen
Value=Off
So just use that to do the appropriate light off/on command. If you can set the first value of each of the lines to the actual name of the light, then you could do it pretty much in a handful of lines. Convert the Off/On value to a new Boolean state to set (False or True), then all you'd need is:
Code:
Devices::FieldWrite(MyLights.LGHT#Sw_%(LVar:CQCActParm_2), %(LVar:NewState), True)
Dean Roddey
Explorans limites defectum