CBus backbone , Crestron Control and motion detectors

Discussion in 'C-Bus Toolkit and C-Gate Software' started by Gcapel, Feb 5, 2016.

  1. Gcapel

    Gcapel

    Joined:
    Mar 10, 2012
    Messages:
    7
    Likes Received:
    0
    Location:
    sydney
    Hey guys
    Ive been doing basic cbus stand alone installs for a while, but now ive been given a job, that has a Cbus backbone controlling Dali lights.
    With a Crestron AV system will be doing the main control for the dimming of various sections (programmed by some one else)

    I have a Couple of questions, if any one can help with.

    1. They have asked for 6 scenes for each lighting Zone 0%, 20%, 40%, 60%, 80%, 100%.
    which i have setup having a trigger group , and then 5 action selectors in that group for each scene. then pass him the hex addresses ect..

    Zone - Scene - Trigger Group Hex - Address Action selector Hex Address
    zone 1 - 0% - 01 - 00
    zone 1 - 20% - 01 - 01
    zone 1 - 60% - 01 - 02
    zone 1 - 80% - 01 - 03
    zone 1 - 100% - 01 - 04

    Does this sound right?

    2. There is also Motion Detectors in the zones that will be doing occupancy detection in the zone. With setting up the 5753PEIRL ,
    will it work if i set the Motion Detector application to trigger control (or 2ndry) and have the move day/night virtual key set to that zones trigger group.
    using the example above zone 1, and when triggered it will set the lights to the last scene, say 80% that the crestron set that zone at?
     
    Gcapel, Feb 5, 2016
    #1
  2. Gcapel

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Your scene setup is fine with the action selectors (except for the 40%?).

    The occupancy detector won't work as you think though. The trigger group is equivalent to a lighting group address. The action selector is equivalent to the group level. If you set the sensor up for your trigger application (which is fine), the sensor by default will set the action selector to 255 (i.e. ON) when triggered, and 0 (i.e. OFF) after it times out. Given you have no scene attached to action selector 255 no much will happen. There is certainly no way you can get it to remember the last scene selected without the use of logic.

    You can set up the sensor to trigger a specific action selector on detection by changing the short/long press from ON to RECALL 1 then setting recall 1 to the required action selector. Alternatively just change one of the scenes to use action selector 255.
     
    Last edited by a moderator: Feb 6, 2016
    Ashley, Feb 6, 2016
    #2
  3. Gcapel

    Gcapel

    Joined:
    Mar 10, 2012
    Messages:
    7
    Likes Received:
    0
    Location:
    sydney
    Hey ashley,

    Thanks for the answer

    Opps on the 40% just threw that together quickly for example.

    I set up a little test box to mess around with it, i couldn't get the recall 1 idea you said to work, but the idea of the set a scene for 255 does.
    **edit** I sort of worked out the recall 1 idea, it seems the % numbers in there dont actually line up with action selectors, 100% to the 255 selector.

    as these are for only after hours, i might end up using that and setting a scene that way.
     
    Last edited by a moderator: Feb 7, 2016
    Gcapel, Feb 6, 2016
    #3
  4. Gcapel

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Group levels (and group addresses and applications) are 8 bit values so all have a range from 0-255. Because that's a bit odd to use, scenes (and logic commands) take values in percentage where 0 is 0% and 255 is 100%. The actual calculations are:

    level = truncate ((percent * 255) / 100 )
    Percent = truncate(level+ 2)*100 / 255 )

    With the sensor, if it's only for night access you could just set it up to control a single light. That gives you the advantage of a slow ramp off which tells you the light is about to go out.
     
    Ashley, Feb 7, 2016
    #4
  5. Gcapel

    Gcapel

    Joined:
    Mar 10, 2012
    Messages:
    7
    Likes Received:
    0
    Location:
    sydney
    So with the logic you mentioned earlier.

    In broad strokes what how would you go about it.

    i was looking into if every time the action selector for a zone was changed (eg crestron set a scene)

    then do something, but i cant work out what that Something i have to do was to stop the sensor from going to 100%

    eg
    once (GetTriggerLevel("Zone 5 TC") = 1 {"20%"} ) then
    begin

    end;

    is it possible to set the recall 1 value on the sensors in that zone?
    or do something similar to the logic on the cbus dimmers logic tab where you can set a MINIMUM Logic on a group address.
     
    Gcapel, Feb 7, 2016
    #5
  6. Gcapel

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    If you want to expand the functionality of the sensor with logic, the way to do it is create a new group address (e.g. 'Sensor Triggered') and set that up as the sensors control ga (i.e. under motion in dark and motion in light). Then in logic you can test for changes in this ga and do whatever you want.

    e.g.
    Code:
      Once GetLightingState("Sensor Triggered") = ON then
      Begin
        // Do whatever you want here when sensor triggered. e.g.
        SetScene("Sensor Triggered Scene")
      End;
    
      Once GetLightingState("Sensor Triggered") = OFF then
      Begin
        // Do whatever you want here when sensor times out. e.g.
        SetScene("Sensor End Scene")
      End;
    
    This way you have complete control over how the sensor operates.

    If, say, you wanted the sensor to trigger the last scene set by the switches, you just need to look for changes in the trigger group, store the new value, and set it in the sensor triggered block.

    e.g.

    Code:
    In globals:
    
      lastActionSelector: integer;
      newActionSelector: integer;
    
    in module:
      newActionSelector := getTriggerLevel("theTriggerGroup");
      if (newActionSelector <> 0) and 
         (newActionSelector <> lastActionSelector) then
         lastActionSelector := newActionSelector; // Save last used selector
      Once GetLightingState("Sensor Triggered") = ON then
        setTriggerLevel("theTriggerGroup", lastActionSelector);  
      Once GetLightingState("Sensor Triggered") = OFF then
        setTriggerLevel("theTriggerGroup", 0);  // Off scene
     
    Ashley, Feb 8, 2016
    #6
  7. Gcapel

    Gcapel

    Joined:
    Mar 10, 2012
    Messages:
    7
    Likes Received:
    0
    Location:
    sydney
    Thanks again,

    now this makes sense, i was focused on trying to work out how to control something in the sensor with the logic, rather then just using the sensors activating to be detected by a module , like your example.


    The code you wrote looks perfect for what i need with a but of customisation for my project.

    I think i might have to spend some time going through the logic manual once this project is done.

    Thanks again!
     
    Gcapel, Feb 8, 2016
    #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.