1 Key controlling 2 loads with PAC

Discussion in 'C-Bus Toolkit and C-Gate Software' started by lorenthehaloboy, Jun 6, 2006.

  1. lorenthehaloboy

    lorenthehaloboy

    Joined:
    Nov 18, 2004
    Messages:
    66
    Likes Received:
    0
    Ok, I am stumped.

    I have a single key that I want to somehow when short pressed control a light on/off and when long pressed, control another load on off.

    I need them to work independantly, so if 1 is on, turning the second load with the long press wont turn load 1 off etc.

    I have a PAC, so my thoughts were to somehow get the short and long press to ramp the levels to two different levels, and get the PAC to detect it, and do something after that...

    Any thoughts?
     
    lorenthehaloboy, Jun 6, 2006
    #1
  2. lorenthehaloboy

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The functions from the key are applied to all blocks a particular key is associated with. You have the PAC however so a solution should be readily achievable.

    Change the key functions for that key to Idle, Recall 1, Recall 2, Idle. Then set your Recall 1 and Recall 2 levels to two distinct levels. When you just do a short press and release of the key the unit will transmit the Recall 1 level. When you do a long press of the key the unit will transmit the Recall 2 level.

    Then, you'll need to write some PAC code to do something useful with these messages.
     
    Last edited by a moderator: Jun 7, 2006
    Newman, Jun 6, 2006
    #2
  3. lorenthehaloboy

    lorenthehaloboy

    Joined:
    Nov 18, 2004
    Messages:
    66
    Likes Received:
    0
    Thanks Newman... thats what I had already started, and just couldnt get my head around it.

    This is how I ended up doing it.

    Idle, Recall 1, Recall 2,Idle

    I made Recall 1 90% and Recall 2 80%.

    I then used a dummy group for this, and the logic below.

    Code:
    {Use dummy group "Bathroom Heatlight Fan" on single switch to recall group to 90% for light}
    once (GetLightingLevel("Bathroom Heatlight Fan") = 90%) then
    begin
         {If group is already on, then turn off}
         if GetLightingState("Bathroom Heatlight") then
            SetLightingState("Bathroom Heatlight", OFF)
         {if group is off, turn on}
         else
            SetLightingState("Bathroom Heatlight", ON);
         SetLightingState("Bathroom Heatlight Fan", OFF);
    end;
    
    {Use dummy group "Bathroom Heatlight Fan" on single switch to recall group to 80% for fan}
    once (GetLightingLevel("Bathroom Heatlight Fan") = 80%) then
    begin
         {If group is already on, then turn off}
         if GetLightingState("Bathroom Fan") then
            SetLightingState("Bathroom Fan", OFF)
         {if group is off, turn on}
         else
            SetLightingState("Bathroom Fan", ON);
         SetLightingState("Bathroom Heatlight Fan", OFF);
    end;
     
    lorenthehaloboy, Jun 6, 2006
    #3
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.