Charmed Quark Systems, Ltd. - Support Forums and Community
With Echo integration is it possible to have a set and a query with the same command? - Printable Version

+- Charmed Quark Systems, Ltd. - Support Forums and Community (https://www.charmedquark.com/vb_forum)
+-- Forum: General Discussion (https://www.charmedquark.com/vb_forum/forumdisplay.php?fid=3)
+--- Forum: CQC Support (https://www.charmedquark.com/vb_forum/forumdisplay.php?fid=9)
+--- Thread: With Echo integration is it possible to have a set and a query with the same command? (/showthread.php?tid=10627)



With Echo integration is it possible to have a set and a query with the same command? - ghurty - 07-09-2018

For example you want to set the thermostat, but you then want alexa to reply with "I set the thermostat to...."

Thank you


RE: With Echo integration is it possible to have a set and a query with the same command? - Dean Roddey - 07-09-2018

Yeh, one comes as a set type intent and another as a query type intent. They have to be unique within a particular block within the config file, but it should be fine to have the same name in different blocks.


RE: With Echo integration is it possible to have a set and a query with the same command? - ghurty - 07-11-2018

(07-09-2018, 08:25 PM)Dean Roddey Wrote: Yeh, one comes as a set type intent and another as a query type intent. They have to be unique within a particular block within the config file, but it should be fine to have the same name in different blocks.

Can you please elaborate a bit.
I am trying to tell echo to arm the alarm, if the house isnt able to be armed it will respond by with which zones are open. I got the action part down (I think). and I have for my querymap:
Code:
 Action=/User/Echo/ArmHouse
   arm, arm alarm, arm house, alarm
That does work when I say "tell jarvis  to arm alarm", it doesnt work because it is trying to run the word alarm.

But if I will switch it to an run intent then it wont reply to me. So what would be the best way.

Another issue is that if I say ""tell jarvis  to arm alarm", it is trying to run "alarm" not "arm alarm", so I am not sure how I would be able to have a separate intent of "disarm alarm".

Thank you


RE: With Echo integration is it possible to have a set and a query with the same command? - Dean Roddey - 07-11-2018

Arm is an intent indicating word. You'd have to add one or more new utterances on the AWS side that allow for the word arm to map to a set intent.


RE: With Echo integration is it possible to have a set and a query with the same command? - ghurty - 07-11-2018

Will the a setinent allow echo to reply?


RE: With Echo integration is it possible to have a set and a query with the same command? - Dean Roddey - 07-11-2018

Any command can return text, since it's often used to report success or failure as well.


RE: With Echo integration is it possible to have a set and a query with the same command? - ghurty - 07-11-2018

Is there a way to see a better detailed log?
What I mean is that I have a phrase arm house to load action "arm house"

Code:
Action=/User/Echo/ArmHouse
   arm house
 EndAction  
I run the command vie echo and it says success. But the script I have for the arm house is:
Code:
If
System::Equals
   P1=Elk.Area_House_ArmUpMode
   P2=Not Ready To Arm
   P3=Case

System::DoGlobalAct
   P1=/User/Echo/CheckZones
   P2=

Else

Devices::FieldWrite
   P1=Elk.InvokeCmd
   P2=ArmArea: House, Stay,XXX
   P3=True

End
Now Area is currently in "not ready to arm" so based on that script, it should load the other action called "CheckZones" which should list the open zones. But nothing happens, all I get is "okay CQC has done that". And the CheckZones action is good, because when I call it directly via a different intent (a query intent)
Code:
QueryMap
 Action=/User/Echo/CheckZones
   zones, windows, zones open, windows open
 EndAction
       EndQueryMap
It does reply back to me. So I want to see better logs to see what is broken.

Thank you


RE: With Echo integration is it possible to have a set and a query with the same command? - Dean Roddey - 07-11-2018

Since they are just global actions, run them directly. Use the Test button which will bring up the action trace window. That shows you all of the expanded out content of the action commands as they run. Just pass them the same parameters that you expect to get when they are run via the Echo. The action trace allows you to enter parameters when you run the command.


RE: With Echo integration is it possible to have a set and a query with the same command? - ghurty - 07-12-2018

I think I figured out what why it wasnt working. I redid the code to change the temp on the thermostat that way I can actually see which step it is doing. And even though the house is in Not Ready to Arm state it is going to the Else version.  Below is the code. And I looked at the Elk client interface, and "Area_house_ArmUpMode" is  currently "Not Ready To Arm".
Any suggestions? Thank you

Code:
If
System::Equals
  P1=Elk.Area_House_ArmUpMode
  P2=Not Ready To Arm
  P3=Case

Devices::FieldWrite
  P1=Nest.THERM#Hallway~HighSetPnt
  P2=70
  P3=True

-System::DoGlobalAct
  P1=/User/Echo/CheckZones
  P2=

Else

Devices::FieldWrite
  P1=Nest.THERM#Hallway~HighSetPnt
  P2=80
  P3=True


End



RE: With Echo integration is it possible to have a set and a query with the same command? - Dean Roddey - 07-12-2018

You are comparing the actual field name to "Not Ready To Arm". You need to dereference it: $(Elk.Area_House_ArmUpMode)

That's a good reason to use the action trace. It shows you the expanded out values, so you'd see that you were comparing the literal field name because it wouldn't get expanded out.