Follow control in a nac

Discussion in 'General Discussion' started by Pc2022, Aug 3, 2022.

  1. Pc2022

    Pc2022

    Joined:
    Aug 3, 2022
    Messages:
    14
    Likes Received:
    1
    Hi all .

    New to coding/logic with the nac/shac

    What i am trying to do is Set one Group up to control 6 other Groups.
    What would be dimming of a scene in a touch screen/pac
    I have in the past written some code to do same in a pac (corridor linking with multiple Triggers)

    Eg

    Dummy 1 to 50%
    ga1
    ga2
    etc to 50%

    so it follows through the range

    Have tried going down the road of doing the same thing with a nac it works somewhat with some presets but not the desired effect.

    Not sure where to start with the code .
     
    Pc2022, Aug 3, 2022
    #1
    1. Advertisements

  2. Pc2022

    Dasman

    Joined:
    May 5, 2011
    Messages:
    19
    Likes Received:
    2
    Location:
    Adelaide
    Hi Pc2022,

    This is a good place where we can use keywords within the NAC/SHAC. We can use a C-Bus group to control a keyword with a bit of script, which in turn will control any C-Bus group bound to this keyword.

    1) Create your dummy group in the NAC/SHAC and then create an event based script bound to it.

    2) Under the objects tab, find each group that you want to control and add a keyword to it, this is just a piece of text, so the name does not matter, just so long as it is the same on each group that you wish to control. For this example I will use the keyword "ControlAll"

    3) in the script from the first step, insert the following code:

    net, app, group = event.dst:match("([%d,]+)/([%d,]+)/([%d,]+)")
    ramp = GetCBusRampRate(tonumber(net), tonumber(app), tonumber(group))
    SetCBusByKW({'ControlAll'}, 'or', {target = event.getvalue(), ramprate = ramp})

    Save and test by controlling your dummy group
     
    Dasman, Aug 3, 2022
    #2
    1. Advertisements

  3. Pc2022

    Pc2022

    Joined:
    Aug 3, 2022
    Messages:
    14
    Likes Received:
    1


    Have followed and add a new script in for this unfortunately still not having any luck

    net, app, group = event.dst:match("([%d,]+)/([%d,]+)/([%d,]+)")
    ramp = GetCBusRampRate((0), (56), (1))
    SetCBusByKW({'cans'}, 'or', {target = event.getvalue(), ramprate = ramp})

    cans being the key word

    The dummy group is a different application to the control group/key word would this be causing my issue.
     
    Pc2022, Aug 3, 2022
    #3
  4. Pc2022

    Pc2022

    Joined:
    Aug 3, 2022
    Messages:
    14
    Likes Received:
    1
    Dummy group needed to be the same application for it to work.
     
    Pc2022, Aug 4, 2022
    #4
    1. Advertisements

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.