CGATE how to tell if status was initiated by a wall keypress

Discussion in 'General Discussion' started by ievolve, Nov 9, 2014.

  1. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Connecting via CGate and I am trying to decipher which events are the result of a keypress of a wall unit.

    Events look like this:
    lighting on //WEBB/254/56/64 #sourceunit=40 OID=d1b6aba0-4a0e-1032-981b-d2305edbd9a7

    What is "sourceunit"? It appears to be the ID of the device that generated the event (in this case a light switch)

    Now, if I programmatically write to CGate something like:
    OFF //WEBB/254/56/64

    Then the following status event comes in:
    lighting off //WEBB/254/56/64 #sourceunit=1 OID=d1b6aba0-4a0e-1032-981b-d2305edbd9a7

    When you write to CGate, is the sourceunit that comes through in the status event always == 1?

    Thanks
     
    ievolve, Nov 9, 2014
    #1
  2. ievolve

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    It's been a while since I looked closely at C-Gate, but at a guess the 1 is probably the unit address of the PCI/CNI that C-Gate is connected to.

    And to answer your first question, I don't think you can specifically tell what type of device issued a command without keeping some sort of lookup table against unit ID's.

    BTW out of interest why do you want to know this?

    Cheers

    Rohan
     
    Last edited by a moderator: Nov 9, 2014
    rhamer, Nov 9, 2014
    #2
  3. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    @rhamer I bet you are right. Hmm, I suppose unless I maintain a list of the sourceunits then it might be tough to get at what I need.
     
    ievolve, Nov 9, 2014
    #3
  4. ievolve

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    Actually, in looking closer at my tree, I see this:

    320-//WEBB/254/p/1 ($1) type=PCLOCAL4 app=255($ff),255($ff) state=ok groups=

    I think that sourceunit 1 is actually the CNI, so my code may work.
     
    ievolve, Nov 9, 2014
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.