Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: New Amazon Echo Support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
jkmonroe Wrote:check page 13 of the document. you can log the parameter and then use IF statements to assign it.

so for on/off, you can use a single global action:

IF CQCActParm_03:ON
then turn on light
IF CQCActParm_03:OFF
then turn off light
I think I should have been a little bit more clear. The first thing I should mention is that I don't do script, etc. If I were 50 years younger, I'd probably learn it.

So, I'm trying to use the simplest way possible to do things like this. The light on/off thing is an exercise in getting a simple thing working. Then, I'd use that for more involved Actions.

For instance, Turning on the Home Theater. That will involve a series of Actions to turn lights on, lower blinds, turn audio equipment on, etc, etc. I need to figure out how to simply have Echo activate a single Global Action just as my finger would do it on a button on my iPad.

Right now, I'm getting Echo to Load Configuration with no trouble. I'm reaching CQC with a skill, but the error message is that CQC doesn't know what to do with the instruction.

Here's my Config file now, which doesn't work. I have two Global Actions for TrackLight, one ON and the other OFF. Obviously, I have something wrong.

EchoConfig
MyKey=Viola
EndEchoConfig

RunMap

Action=\User\Echo\TrackLightON
EndAction

Action=\Echo\User\TrackLightOFF
EndAction


EndRunMap

SetMap
Action=\Echo\User\TrackLightON
EndAction

Action=\Echo\User\TrackLightOFF
EndAction

Action=\User\Echo\SetMedia
Volume, Music Volume, Theater Volume
EndAction
EndSetMap

QueryMap
EndQueryMap
its not really scripting, it's all done in the action editor for a global action.

just clicky-clicky stuff, no CML. but you have to grab the message that comes back from the Echo and do something with it.

for example, you want to turn on your Home Theater and you say "Alexa, tell Control to turn the Home Theater ON." In that phrase there are three key bits, the Intent, the Key, and the Parameter which CQC will automatically parse out for you. They will be TURN (Intent), HOME THEATER (Key), and ON (Parm).

What you need to do is use those bits to perform your action. Let's just use the SetMedia (it's in what you've posted below) to get this working.

Add Home Theater into this and save it:

Action=\User\Echo\SetMedia
Home Theater, Theater
EndAction
EndSetMap

Now, tell Alexa to load the configuration "Alexa, tell control to load configuration".

Open up your Admin Interface, and click the Global Actions button. You should have a folder called Echo, if not create one and browse into the folder. Type SetMedia as the filename and hit Select.

This opens up your action editor for your global action.

In here, let's run a simple test. On the left side, click CMD, System, LogMsg.

For the source, type Test Action. Line stays at 0. For message type the following exactly:

Intent:%(LVar:CQCActParm_01), Key:%(LVar:CQCActParm_02),Parms:%(LVar:CQCActParm_03)

Severity should be Status.

Go ahead and hit save.
You have to provide key words to look for. Look at the SetMedia example, which has words like Volume, Music Volume, etc... that tell CQC that this action should be run when one of these targets is used in a Set type command.

When you send a command, the web server looks at the intent type, a Set type intent in this case, and then it goes to the map for that type of intent, and it looks for an action that has a match for the target of the intent. In your case you provided no target values to match in either of your actions so they won't ever get matched.

So you would want something like:

Code:
SetMap
    Action=\Echo\User\TrackLight
       Track Light, Track Lighting, Track Lights
    EndAction
EndSetMap

Then, when you say something like:

Alexa, tell Bubba to turn the Track Lights Off
Alexa, tell Bubba to turn the Track Lights On

It will look through the SetMap area for a handler that matches Track Lights, and run that one.

However, it can't be separate actions for off and on, because there would be nothing to distinguish one from the other. Both the above statements create identical targets. So you'll have to handle both off and on in a single action.

It's pretty straightforward to do. The 3rd parameter is going to be off or on n the above scenarios, so something like:

Code:
If (System::Equals(%(LVar:CQCActParm_3), off, NoCase)
    .... do the light off command here ....
Else
    --- do the light on command here ...
EndIf
Once you've saved your global action, open up your Log Monitor (Monitor the Log Server).

Then say "Alexa, tell control to set Home Theater to ON"

you should see a message come through your log server that looks something like:

Key=<echo key> Intent=CQCSetToIntent, Phrase=Home Theater, Value=ON.

let me know if you see all of that and we can get you started with an action to actually control your devices.
hey Dean, check out my post a page back about those log messages im getting. Is there any way to stop them? doesn't seem to be affecting anything.
OK, thanks to both of you (Dean & JK) Lot's here to chew on. It's like riding a bicycle. However, I was never able to stand upright on the seat and keep it upright.:-)

I've got to go out now and measure a house for a mass of motorized HunterDouglas PowerView Shades to be controlled by iPad. That will be my first one dealing with Hunter's new tablet control system. Wish me luck.

Hunter is trying to get me to install some of the PowerView in my house so I will have more experience with them and I tell them until they fix the Hub so I can run it with CQC they aren't going to get installed. That's supposedly coming.
jkmonroe Wrote:hey Dean, check out my post a page back about those log messages im getting. Is there any way to stop them? doesn't seem to be affecting anything.

shit, i fixed it. it was the Hue Sim from wuench, i forgot there is no 'driver' for the native stuff.
Deane Johnson Wrote:\
Hunter is trying to get me to install some of the PowerView in my house so I will have more experience with them and I tell them until they fix the Hub so I can run it with CQC they aren't going to get installed. That's supposedly coming.

Deane: Let me know how that goes as I'm looking into power shades for my home theater room. After your experience, perhaps a reco?

Bugman
I have gone through and set it up as recommended and I think there is significant progress. The track light turns on as ordered and Alexa confirms it's been done. However, when ordering it to turn off, it doesn't turn off even though both Alexa and the log show it happening.

Something must be off a notch in the "Commands for this Event"

If System::Equals
P1=(%(LVar:CQCActParm_3)
P2=Off
P3=No Case

Devices::FieldWrite
P1=VRC0P-V1.LivingRoomTrack
P2=0
P3=True

Else
Devices::FieldWrite
P1=VRC0P-V1.LivingRoomTrack
P2=61
P3=True

End
Bugman Wrote:Deane: Let me know how that goes as I'm looking into power shades for my home theater room. After your experience, perhaps a reco?

Bugman
I'll be happy to help you figure out what to do. That's my profession. When you're ready to think about it, I'll go through the questioning process along with review pictures you send to help you figure out what to do.

I'm not allowed to sell you HunterDouglas on line, but I can tell you how much you might expect to pay for a given approach.

I also have access to other products, but not Lutron or Somfy which are overpriced anyway. Though both Graber and Kirsch use the Somfy components and the performance is fantastic.

Right now, the new Hunter PowerView are hot. I've sold more PowerView since they came out in July than the old Hunter PowerRise in the past 5 years.