Security Panel Tiggering Scenes Via Logic

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by airman1, Sep 7, 2013.

  1. airman1

    airman1

    Joined:
    May 20, 2010
    Messages:
    21
    Likes Received:
    0
    Location:
    Australia
    Hi
    I have a Clipsal security panel interfaced with Cbus and I am attempting to use 2 x security PIRs to triggers scenes between certain times of the day
    I have been using the logic engine in the touch screen but once the scene is triggers it won?t time out and continues to stay on
    I have tried multiples lines of code to no avail
    If anyone can provide any info would be greatly appreciated??
    Cheers
     
    airman1, Sep 7, 2013
    #1
  2. airman1

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,548
    Likes Received:
    178
    Location:
    Adelaide, Australia
    It would probably help if you posted the logic that isn't working!

    But I'm not quite sure what you mean by the scene timing out as scenes don't ever actually time out. Generally you would create 2 scenes for this operation - an ON scene and and OFF scene. Trigger the on scene from the PIR and the Off scene after a time delay in the logic. If you are using logic and the OFF scene just turns all the groups off, you can just use an ON scene with the SetSceneLevel(sceneNumber, 0, 0) function to turn all the ON scene groups OFF
     
    Ashley, Sep 7, 2013
    #2
  3. airman1

    airman1

    Joined:
    May 20, 2010
    Messages:
    21
    Likes Received:
    0
    Location:
    Australia
    Logic below


    If SetCBusState("Local Network", "Trigger Control", "Entrance sensor", ON);
    (time =< "12:30AM"); and
    (time => "6:00AM"); and
    then
    Begin
    SetLightingState("Hall Way Light", ON);
    Delay("0:02:00");
    SetLightingState("Hall Way Light", OFF);
    End;
     
    airman1, Sep 8, 2013
    #3
  4. airman1

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,548
    Likes Received:
    178
    Location:
    Adelaide, Australia
    That logic full of syntax errors and would never compile so I assume you haven't copied it correctly. It also has logic errors.

    This is probably what you intended:

    If (GetCBusState("Local Network", "Trigger Control", "Entrance sensor") = ON) and ((time <= "12:30AM") or (time >= "6:00AM")) then
    Begin
    SetLightingState("Hall Way Light", ON);
    Delay("0:02:00");
    SetLightingState("Hall Way Light", OFF);
    End;

    SetCBusState sets a state, it doesn't read it. You can't have it in an IF anyway as SetCBusState is not a function and doesn't return a result.
    Semicolons terminate a statement so you want one after the final END of the IF.
    The time can never be <= 12:30 am and >=6:00 am on the same day so the condition would never trigger anyway.

    Much simpler just to write:

    Once (GetCBusState("Local Network", "Trigger Control", "Entrance sensor") = ON) and ((time <= "12:30AM") or (time >= "6:00AM")) then
    pulseCBusLevel("Local Network", "Lighting", "Hall Way Light", 100%, 0, "0:02:00", 0);

    This will also re-trigger the light during the 2 minute period.

    You may also want to check out when to use IF and ONCE

    Ashley
     
    Last edited by a moderator: Sep 8, 2013
    Ashley, Sep 8, 2013
    #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.