Scene delay to then trigger another scene

Discussion in 'C-Bus Automation Controllers' started by AntDwyer3875, Mar 20, 2020.

  1. AntDwyer3875

    AntDwyer3875

    Joined:
    Jul 14, 2019
    Messages:
    19
    Likes Received:
    0
    I'm new to the NAC5500 and I know this is going to sound a bit foolish but I can't get this to work, any help would be appreciated.

    I am trying to create a "Good Night Scene".
    The objective is to turn on a few lights on low and after an extended period then turn them all off.
    Sounds simple but I can't get it to work correctly.
    I have created 2 scenes i.e. the ON and OFF sense with two triggers one to turn them on and the second which I placed in the first scene to turn them off after a period. Each of the scenes works individually but not when I put the second trigger into the first scene the lights to come on only for a second before going off disregarding the ramp up and then down setting within the scene.

    Should I be doing this some other way using scripting or similar?

    Any directions support or ideas would be appreciated.
     
    AntDwyer3875, Mar 20, 2020
    #1
  2. AntDwyer3875

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    I'm not sure what you are expecting here. If you trigger the second scene from the first scene (I assume you are using the scene trigger here) then as soon as you trigger the first scene it will immediately trigger the second one. That's how scenes work. They just step through each item and send out the appropriate command. The target devices then do the ramping, not the scene. Even if you use a lighting ga as the trigger it will ignore the ramp and just trigger on the value.

    The easiest way is to create an event based script on the trigger group then in the script delay however long you want, then set the second scene. (The trigger group will trigger the first scene for you).
     
    Ashley, Mar 21, 2020
    #2
  3. AntDwyer3875

    SgrAystar

    Joined:
    Oct 4, 2018
    Messages:
    57
    Likes Received:
    5
    Location:
    Melbourne, Australia
    When editing a scene, for each component you can choose to 'Ramp Group' or 'Pulse Group'.
    Does 'Pulse Group' do what you want to achieve?
     
    SgrAystar, Mar 22, 2020
    #3
  4. AntDwyer3875

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Unfortunately the NAC/SHAC does not support pulsing groups. I think you are referring to PICED
     
    Ashley, Mar 22, 2020
    #4
  5. AntDwyer3875

    SgrAystar

    Joined:
    Oct 4, 2018
    Messages:
    57
    Likes Received:
    5
    Location:
    Melbourne, Australia
    Yes, I was.
     
    SgrAystar, Mar 22, 2020
    #5
  6. AntDwyer3875

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    I have been looking to this, on the NAC/SHAC there doesn't seem to be a way to do a delay() like in Piced

    if you use os.sleep() you can potentially have "multiple instances" of the same event script running
    os.sleep() dose not block the script next time the event runs it just runs the script again in parallel to an already running script.
     
    Pie Boy, Mar 22, 2020
    #6
  7. AntDwyer3875

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    If you don't want this behaviour just interlock it with a global variable.

    Test the var at the start of the script. If it is non zero, just exit.
    Otherwise increment it, execute the script, the set it back to zero at the end.
     
    Ashley, Mar 23, 2020
    #7
  8. AntDwyer3875

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    @Ashley Yes it seems this way, although i cant see a way to make a variable global and persistent?
    i will either have to use storage.get()/storage.set() to store the value or use a user parameter as a sort of system io to store the data.
    it would be nice to have a function call to see if a script assigned to an objects event is still running or not...
    for now i will persevere with storing any data i want to be global in a user parameter
     
    Pie Boy, Mar 23, 2020
    #8
  9. AntDwyer3875

    AntDwyer3875

    Joined:
    Jul 14, 2019
    Messages:
    19
    Likes Received:
    0
    Thanks for your reply Ashley.
    Could you provide some guidance on how I would go about this?
     
    AntDwyer3875, Apr 15, 2020
    #9
  10. AntDwyer3875

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Just create 2 independent scenes with separate triggers in the same group but different action selectors. Then create a event script in the SHAC triggered by the first scenes action selector. In this scene just sleep however long then trigger the second scene by setting its action selector (i.e. setTriggerLevel command). when you trigger the first scene it will be set directly and the script started. The script will then wait for the set delay then trigger the second scene.
     
    Ashley, Apr 15, 2020
    #10
  11. AntDwyer3875

    AntDwyer3875

    Joined:
    Jul 14, 2019
    Messages:
    19
    Likes Received:
    0
    Ashley, I kind of get what you are saying but you have lost me, I'm new and self-taught.
    I have created the two scenes "Scene1-Turn the lights ON" & "Scene2-Turn Lights OFF".
    I have looked at creating an event script "Delay Scence2" i.e. using sleep "os.sleep(10.5)".
    Now I'm lost........
    1. What should the event script include i.e. How do I get the "Scene1" to trigger action selector in the script?
    2. How do I set the TriggerLevel command?
    I'm sorry to be a pain I thought this would be simple, as I had achieved it previously using PICED any help would be appreciated.
     
    AntDwyer3875, Apr 18, 2020
    #11
  12. AntDwyer3875

    ccola

    Joined:
    May 14, 2019
    Messages:
    1
    Likes Received:
    0
    Try this:
    Set the group to a new level lvl over ramprate ramp seconds for duration dur seconds then reset to final level finlvl (or -1 for previous level).

    PulseCBusLevel(net, app, group, lvl, ramp, dur, finlvl)
     
    ccola, Jun 24, 2020
    #12
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.