Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Querying Garade Door w/ Echo
#1
I've been trying to poll the status of my garage door using the Echo but can't seem to get it to work.  The skill is set up and working properly, and I can see in the log monitor that the phrase is being picked up correctly so I believe the config file is correct.

This is the global action I have:

If System::Equals(GC100-Garage1.IRSensor1,False, No Case)
   GlobalVars::SetVariable(GVar:EchoReply, The Garage Door is Closed)
Else
   GlobalVars::SetVariable(GVar:EchoReply, The Garage Door is Open)
End

When I run this I always get the response "The Garage Door is Open," even when it's closed.  I can see from the driver that the sensor shows a False value when the door is closed and a True value when the door is open.  Is there something wrong with my action statement?
Reply
#2
You have to dereference the field variable, you want to compare the value of the field to False not the field's name to False. $(GC100-Garage1.IRSensor1) not just "GC100-Garage1.IRSensor1".
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#3
I thought that's what I was doing.  I also tried using a fieldread first to read the value of the field into a variable and then compare the variable to False but that didn't work either.  How can I use the action editor to compare the field value to false?
Reply
#4
It would be like this:

Code:
If System::Equals($(GC100-Garage1.IRSensor1), False, No Case)

The way you are doing it, you were literally comparing "GC100-Garage1.IRSensor1" to "False". By 'dereferencing' the field name, you get the value, So $(GC100-Garage1.IRSensor1) gets replaced by the actual value of the field when the command is run.
Dean Roddey
Explorans limites defectum
Reply
#5
Thanks Dean, I'll try that when I get home from work tonight.
Reply
#6
Is the referencing and dereferencing of fields and variables covered in the reference material somewhere?  Also, is there a way to access the reference material from the website directly?  I'm at work and don't have access to the computer at my house where CQC is running.
Reply
#7
The HTML docs are not currently on the web site. But it's in "/Help/Docs/Actions/Big Picture". That provides the overview of how actions work. The "Token Replacement" page in there provides a lot of info on how fields and variables are referenced in actions using 'tokens' that are replaced when the action is run. There are various options that allow you to format the value as well.
Dean Roddey
Explorans limites defectum
Reply
#8
I changed the action to read:

If System::Equals($(GC100-Garage1.IRSensor1, False, No Case)
   GlobalVars::SetVariable(GVar:EchoReply, The Garage Door is Closed)
Else
   GlobalVars::SetVariable(GVar:EchoReply, The Garage Door is Open)
End

But I still only get the response "The Garage Door is Open" even when its closed.
Reply
#9
If that's literally the text, you forgot the closing parenthesis. It has to be $(GC-100-Garage1.IRSensor1). The easiest way to do it is to right click in the parameter entry field. Select Insert -> Field. Select the field, and check the By Value check box. That will insert it with the appropriate derefencing stuff.
Dean Roddey
Explorans limites defectum
Reply
#10
So, I got it working by fixing the syntax and properly dereferencing the variable.  Now I'm stuck on a second garage door I have that uses an Insteon I/O Linc and is controlled via an ISY994.  At first I was having problems dereferencing the variable on this one too because I couldn't figure out how to get the ) after the field. 

If System::Equals($(ISY994i.Garage2Door-Sensor_..., False, No Case)

I guess there must be a limit to how many characters a field can contain?  So, I changed the moniker to make it shorter and was able to add the ) which I thought would solve the problem.

However, the statement below still gives me the response "The West Garage Door is Closed" even when it's open.  When I view the ISY driver I can see it's working properly and generating a False when the door is closed and a True when the door is open.  Aside from referencing the ISY it's the same  action statement as the other door controlled by the GC-100 that is working.

If System::Equals($(ISY.Garage2Door-Sensor_Switch), False, No Case)
   GlobalVars::SetVariable(GVar:EchoReply, The West Garage Door is Closed)
Else
   GlobalVars::SetVariable(GVar:EchoReply, The West Garage Door is Open)
End

I don't get it.   Huh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Amazon Echo integration rhosch 8 354 05-15-2021, 01:06 PM
Last Post: Bugman
  Echo troubleshooting dlmorgan999 3 428 01-13-2021, 04:27 PM
Last Post: dlmorgan999
  Echo Set-up Woes znelbok 2 1,108 03-24-2019, 05:11 AM
Last Post: dlmorgan999
  If starting fresh, what is the best garage door system to go with to work with CQC? ghurty 1 1,425 08-30-2018, 03:23 PM
Last Post: znelbok
  With Echo integration is it possible to have a set and a query with the same command? ghurty 9 3,760 07-12-2018, 08:43 PM
Last Post: Dean Roddey
  Echo Config file issues ghurty 6 3,368 07-08-2018, 07:13 PM
Last Post: ghurty
  New Amazon Echo Support Dean Roddey 591 210,815 02-21-2018, 12:56 PM
Last Post: Dean Roddey
  Echo setup: Backslash now slash in EchoCfg.TXT IVB 3 2,023 01-13-2018, 05:14 PM
Last Post: Dean Roddey
  Alexa/Echo: AWS/Lambda config of myCQCHandler test fails KenC 8 5,623 09-27-2017, 07:55 PM
Last Post: Dean Roddey
  Zwave - FIBARO Door/Window Sensor + Temp batwater 5 3,855 03-18-2017, 02:16 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)