Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A couple of quick questions with design and states
#1
A couple of quick questions with design and states. These are probably simple things I am missing. I guess this is what happens when you dont play with it for a while
I have had a system working for a while now, but had it shutdown for a bit and now I am working on it again.

Question 1:
I have an ELK panel, with colored icons based off of the state of the zone.  For the front door icon, I have under image settings, one icon for false another for True. However, even when in the Driver it is showing the zone as open (shorted), it is still displaying the True Icon

Question 2:
I have a different icon trying to monitor a lutron light switch. 
State Field: Lutron.LGHT#Sw_DiningRoomChandelier
And two different icons based off of true or false.  
The icon is displaying though the error state. But when I go to the driver tab and I turn the light on and off, it toggles between true and false.


Question 3:
I am trying to make a button to turn the light on or off depending on the current state.
I believe I have the write part correct to set the light, but what is the proper way of reading the current state for an if/else. Below is what I have, but I know its wrong:
Code:
If
Devices::FieldRead
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=%(LVar:DiningChand)
    P3=True

Devices::FieldWrite
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=False
    P3=True

Else

Devices::FieldWrite
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=True
    P3=True

End
Thank you
Reply
#2
#1. Assuming you are using the V2 Elk driver, the zone state isn't a simple true/false, it has multiple states. So you'll have to check for the specific zone state value. See the docs for the Security device class, and the Zone_X_Status field.

https://www.charmedquark.com/Web2/CQCDoc...=/Security

#2. What type of widget are you using? That would normally be a Check Box type widget.

#3. In the read you have to use the actual name of the variable. YOu are passing the value of the variable. Remove the %() bits. Use that when you want to get the value in the variable.
Dean Roddey
Explorans limites defectum
Reply
#3
1 - I am using the V2 driver. If it has multiple states, how can I add another state into the image list. By default, there is only False, True and Error
2 - I was using a Field Baloon Image, I deleted and recreated and now it works
3 - What is the variable name for the state of the switch? Do I create a local custom one, or is there a default variable name, that references the state of the field?

Thank you
Reply
#4
I got #3 working with this code. Is it the most efficient way?
Code:
Devices::FieldRead
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=LVar:DiningChand
    P3=True

If
System::Equals
    P1=%(LVar:DiningChand)
    P2=True
    P3=Case

Devices::FieldWrite
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=False
    P3=True

Else

Devices::FieldWrite
    P1=Lutron.LGHT#Sw_DiningRoomChandelier
    P2=True
    P3=True

End


So now I only have to figure out the Elk issue.

Thanks
Reply
#5
(04-20-2020, 07:00 PM)ghurty Wrote: So now I only have to figure out the Elk issue.

Thanks

On my setup, I use the Field Enumerated Image for zones, and for example, my front door status in the driver is SEC#Zone_DoorFront_Status, which is created in the Client Interface when added there (Adding a DoorFront zone with the associated ID creates that field) in the driver.

In the enumerated widget I have 4 images - Secure, Not Read, Violated, ByPassed, and Unknown.  The image will change based on what the Elk is showing.  I attached a screenshot of how mine is setup.


.jpg   CQC Elk Screen.jpg (Size: 382.08 KB / Downloads: 12)
Reply
#6
Thank you. So I see this reply at 3 in the morning, and I need to try it right away. 
I did it your way and it works. Thank you
I love your interface (I checked your post history to see the rest of it, and it gave me some good ideas).
You do you have the buttons control whether text messages are sent? Do you store the status as a global variable? 

Thank you
Reply
#7
I set up a Boolean CQC Variable named SMSDoorExit and SMSMotion, and have it triggered.  When the button is pressed, it will set it to either true or false.

If the zone is violated, a trigger is set up so it will send an SMS Message.  I use AT&T and am able to send out an SMS text message from the CQC email setup.  Verizon has that too, and probably most if not of the other carriers.

System::EMail
    P1=GMAIL
    P2=[Phone No.]@txt.att.net
    P3=Front Door
    P4=Door was Opened


I have always used CQC Variables for System Wide storage that would affect all of the IV's, and Global Variables for storage for that specific IV.  If you were to use a Global Variable here, another IV would not see that.  (At least the way I understand).  With a CQC Variable, it will get changed and all of the others will see it.

And I am definitely a night owl - my best work is done after midnight.  Although when i was younger I used to tell all my friends that nothing good ever happens after midnight.  Smile
Reply
#8
Sorry about the misleading response. The check box would be for a true/false value, and the ability to toggle it, so for a light switch or that sort of thing. If you want to represent all the values of something like a zone state, and it's not something you can set just see, then the enumerated image that was suggested would be the one.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Widget color and states bryanb 10 1,793 08-14-2020, 03:29 PM
Last Post: Dean Roddey
  Web Camera Widget Questions znelbok 4 1,890 01-03-2019, 03:27 PM
Last Post: sic0048
  Can't Find a Couple of Documented Action Commands kblagron 7 3,319 10-02-2018, 05:47 PM
Last Post: kblagron
  Triggered Event Questions RichardU 3 2,035 07-14-2018, 03:53 PM
Last Post: Dean Roddey
  What device model to put for a Jasco/GE switch? And a questions about V1/V2/V3. ghurty 1 1,463 05-16-2018, 09:06 PM
Last Post: Dean Roddey
  Logic Server- Few questions EST 13 5,592 01-19-2018, 10:53 AM
Last Post: EST
  Really simple CML driver questions znelbok 327 131,185 10-11-2017, 09:19 PM
Last Post: znelbok
  A couple of small improvements pjgregory 1 1,464 06-29-2017, 08:50 PM
Last Post: Dean Roddey
  SOLVED -- Button States agarden 6 3,923 05-28-2017, 10:02 AM
Last Post: agarden
  Auto-gen questions IVB 11 6,445 05-15-2017, 11:53 AM
Last Post: IVB

Forum Jump:


Users browsing this thread: 1 Guest(s)