Scene On/Off "Indicator"

Discussion in 'C-Bus Toolkit and C-Gate Software' started by tidefan, Oct 6, 2009.

  1. tidefan

    tidefan

    Joined:
    Jan 6, 2009
    Messages:
    45
    Likes Received:
    0
    Location:
    Alabama
    I am trying to obtain a specific Room On/Off function with special indicator function. The room contains ten lighting groups. I created two scenes: Room On and Room Off. Both are in the CTC. The Room On scene is triggered when a Group "Room On/Off" is set to 255, and the Room Off scene is triggered when it is set to 0. Then, using logic, I said that once all ten groups are at 0 level, then turn group "Room On/Off" off. This worked well to sync the Group "Room On/Off" indicator to reflect same status as the room when all loads are turned off individually. OK, so now I would like for the group On/Off indicator to "Reset" when any of the ten lighting groups in the room is turned on or set to any level greater than 0. The problem is that if I use logic to command that Group "Room On/Off" be turned on when any of the individual groups is greater than 0, then it will trigger the "Room On" Scene turning on every light in the room. I only want to reset the button so that the next press turns the room off. Maybe I am using the wrong method?? Any suggestions??
     
    tidefan, Oct 6, 2009
    #1
  2. tidefan

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    If I were doing what I think you are trying to do, I would use two different groups - one for triggering the scene, and another one for indicating the scene state. What it looks like you are doing is trying to use the same group for both triggering and indicating purposes, and to do that you need that group to have more than two different states.

    An alternative approach would be to allow a third state for the trigger / indicator group - say a level of 1. As C-Bus state indicators are illuminated whenever the level is not zero, this would still achieve what you want on a room key LED, but the level of 1 would not match any scene action selectors ( you only use 0 and 255), so won't affect scenes.
     
    Don, Oct 6, 2009
    #2
  3. tidefan

    tidefan

    Joined:
    Jan 6, 2009
    Messages:
    45
    Likes Received:
    0
    Location:
    Alabama
    First, please forgive my ignorance, as I am still a novice. I understand the concept of utilizing a third state for the trigger group to control the indicator. However, I have a few more questions:
    1) Can I use the Logic Wizard in PICED to command that an indicator turn on when groups x,y, & z are greater than 0?
    2) If the keypad button controlling "Room On/Off" is in the OFF state, and then the indicator only is turned ON by a logic statement, then will the "Room On/Off" button cbus level got to OFF upon the next press? Or will I have to press the button twice which is what I am trying to eliminate?
     
    tidefan, Oct 6, 2009
    #3
  4. tidefan

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You are welcome.

    What you are trying to achieve is not really what we would except a "novice" to attempt, but it is possible.

    If I understand correctly, you are trying to toggle between two Scenes (Room On and Room Off) with a single button, but have the button indicator show whether any groups in the Scene are on.

    Normally the indicator on a button shows a status related to its action. In the case of a Scene button, the indicator would show whether the Scene is set.

    To do what you want, I would suggest:
    1. Have a button which toggles the Room On/Off group. This will toggle between the two Scenes. Do not use this button to show status.
    2. On top of that button, add another button which is used to show the indicator. This button will show the status of a different C-Bus group, which I will call Indicator Group.
    3. You then need to add some logic to control the Indicator Group to show whether any of the groups are on:

    Code:
    // Switch off indicator once all groups are off
    once SceneIsSet("Room Off") then
    begin
      SetLightingState("Indicator Group", OFF);
    end;
    
    // Switch on indicator once any groups are on
    once not SceneIsSet("Room Off") then
    begin
      SetLightingState("Indicator Group", On);
    end;
    
    An alternative way of determining if any groups are on is to use this code:

    Code:
    once (GetSceneMaxLevel("Room On") > 0%) then...
    If you want this to work from a keypad, you just need to key to toggle the Room On/Off group and the indicator to show the status of Indicator Group.

    You can generate either version of the code shown above using the logic wizard.

    If you use the idea of a separate group for the indicator, then changing the indicator will have no effect on the operation of the button.

    If you use a single group address and use logic to set the level to 1% when a group is on (to show that a group is on without setting the scene), then the next press will switch the group off, and trigger the room off scene.
     
    Darren, Oct 6, 2009
    #4
  5. tidefan

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    No problem on asking questions. I am a bit of a novice when it comes to PICED myself, however I can offer assistance with scenes.
    I can't answer your first question - I'm sure some PICED experts reading will be able to fill you in on that one.

    If the indicator in the keypad button controlling "Room On/Off" is configured to follow a group, it will only be OFF if the level of that group is 0 (zero). Note that in C-Bus input units, the indicator is usually configured to show the state of the same group that the key controls, but this need not always be the case. Key indicators can be configured to follow ANY group, independent of the group the key controls. Thus, it is possible for logic in PICED to respond to the key press ( use of bell press function here might be appropriate in your case as it has no state memory), and to drive the indicator to agree with any requirement. This allows two different groups to be used as per my first suggestion.

    If you still desire to use one group for both functions, you can take advantage of the fact that the status indicator shows OFF for one level (action selector) only, and shows ON for 255 other levels (action selectors). In this case you can use PICED to turn the LED on when the key is used to toggle a group ON with a logic statement to go to some level between 1 and 254. As the logic statement level is also ON, the key toggle state will not be upset, and you will only need one more press to turn the scene OFF.
     
    Don, Oct 6, 2009
    #5
  6. tidefan

    tidefan

    Joined:
    Jan 6, 2009
    Messages:
    45
    Likes Received:
    0
    Location:
    Alabama
    Thank you for your suggestions! ! !
     
    tidefan, Oct 7, 2009
    #6
  7. tidefan

    tidefan

    Joined:
    Jan 6, 2009
    Messages:
    45
    Likes Received:
    0
    Location:
    Alabama
    OK, I was finally successful in triggering a scene On/Off with only one keypad button AND also have the button indicator ON when any group turned ON (at any level), AND off when all groups within the scene went to OFF. In addition, I was able to eliminate the need to double press the keypad button. I first created a lighting group "Game Room ON/OFF" which is controlled by Button 1 of a DLT. Then I created two scenes "Game Room ON" and "Game Room OFF" which are stored in a Color Touch Screen. I setup the scene "Game Room OFF" to be triggered when lighting group "Game Room ON/OFF" is OFF. The scene "Game Room ON" has no trigger but is set ONLY via logic. See copy of logic module below with special attention given to the order of events which enable this to work correctly.

    once (GetSceneMaxLevel("Game Room OFF") = 0%) { All Groups Off ? } then
    begin
    SetCBusLevel("Network C", "Lighting 2", "Game Room ON/OFF", 0%, "0s");
    end;
    once (GetSceneMaxLevel("Game Room ON") > 0%) { Any Groups On ? } then
    begin
    SetCBusLevel("Network C", "Lighting 2", "Game Room ON/OFF", 100%, "0s");
    end;
    once (GetSceneMaxLevel("Game Room OFF") = 0%) { All Groups Off ? } and
    (GetCBusLevel("Network C", "Lighting 2", "Game Room ON/OFF") = 100%) then
    begin
    SetScene("Game Room ON");
    end;
     
    tidefan, Oct 13, 2009
    #7
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.