3 scenes on 2 buttons

Discussion in 'Pascal Logic Code Examples' started by UK Household Automation, May 31, 2016.

  1. UK Household Automation

    UK Household Automation

    Joined:
    Aug 6, 2004
    Messages:
    103
    Likes Received:
    0
    Oh, you guys must love these 'I-want-to-trigger-multiple-scenes-from-one-button' queries.....
    so here's another one, I'm sorry if this is duplicating other queries, I spent a while sifting through the forums but couldn't see anything that I could take as an answer specifically.

    Is this going to work?
    I ask this because I'm aware that most button functions will not re-transmit a telegram irrespective of the current state/level of the associated group but I understand that the "Recall" function will.

    I have three scenes configured in a PAC; let's call them
    "Bright"
    "Dimmed"
    "Off"
    The "Off" scene is triggered by "Trigger Group 1", "Action Selector 0"

    I want button 1 on a DLT to toggle between the "Bright" and "Off" scenes
    I want button 2 to toggle between the "Dimmed" and "Off" scenes
    I want the button indicators to work appropriately

    Button 1 on the DLT is set as "Recall 1" and fires "Action Selector 255" of "Trigger Group 1"
    Button 2 on the DLT is set as "Recall 2" and fires "Action Selector 128" of "Trigger Group 1"

    The logic that I've come up with is as follows...

    Code:
    once (GetTriggerLevel("Trigger Group 1") = 255 {"Action Selector 255"} ) then
    begin
       if (GetSceneLevel("Bright") <> -1) then
           SetScene("Bright")
       else
           SetTriggerLevel("Trigger Group 1", "Action Selector 0");
    end;
    once (GetTriggerLevel("Trigger Group 1") = 128 {"Action Selector 128"} ) then
    begin
       if (GetSceneLevel("Dimmed") <> -1) then
           SetScene("Dimmed")
       else
           SetTriggerLevel("Trigger Group 1", "Action Selector 0");
    end;
    
    Thanks,
    JP
     
    UK Household Automation, May 31, 2016
    #1
  2. UK Household Automation

    qun

    Joined:
    Sep 27, 2004
    Messages:
    16
    Likes Received:
    0
    Hi JP,

    If you don?t have too many scenes created on PAC, then you can create four scenes, ?Bright?, ?Dimmed? and two ?OFF? scenes.

    Using a trigger group 1 triggers the ?Bright? and the first ?OFF? scene, set group 1 level to 255 triggers ?Bright? scene and 0 triggers ?OFF? scene.

    Using a trigger group 2 triggers the ?Dimmed? and the second ?OFF? scene, set group 2 level to 255 triggers ?Dimmed? scene and 0 triggers the second ?OFF? scene.

    Button 1 on the DLT uses the trigger group 1 with ON/OFF function, ON command triggers the ?Bright? scene, OFF command triggers the first ?OFF? scene.

    Button 2 on the DLT uses the trigger group 2 with ON/OFF function, ON command triggers the ?Dimmed? scene, OFF command triggers the second ?OFF? scene.
     
    qun, Jun 1, 2016
    #2
  3. UK Household Automation

    UK Household Automation

    Joined:
    Aug 6, 2004
    Messages:
    103
    Likes Received:
    0
    Ah yes....
    a simpler way is always welcome.

    Thanks for your input Qun

    I missed the fact that I could set the buttons on A DLT to work on two different Trigger groups.

    I think I'll make the "OFF 2" scene contain only the Trigger group 1 at value 0 which will then fire the "OFF 1" scene.
    I think I'll also include the Trigger groups in their opposing "ON" scenes, but at some other spurious value to ensure that they are not set at 255 or 0.

    Cheers!
    JP
     
    UK Household Automation, Jun 1, 2016
    #3
  4. UK Household Automation

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    If your bright scene has every light on at the same level you can do it all with a single scene. Just create one scene for the dimmed condition then in the PAC use the SetScene command to set the dimmed scene and the setSceneLevel command to set the Off the Bright scenes.

    You could also do this on a single button. Just set short release to toggle and long press to recall 1 with some intermediate value. Then a short press toggles the scene between off and bright or dim as required, and a long press sets the other scene. If the intermediate scene is on, and short press will toggle it off.

    Also, if you are using a logic device to trigger a scene I generally just use a lighting ga as the trigger. It gets over the silly limit of a single trigger group per key input unit.
     
    Last edited by a moderator: Jun 2, 2016
    Ashley, Jun 2, 2016
    #4
  5. UK Household Automation

    qun

    Joined:
    Sep 27, 2004
    Messages:
    16
    Likes Received:
    0
     

    Attached Files:

    qun, Jun 2, 2016
    #5
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.