Script launch on startup ??

Discussion in 'Pascal Logic Code Examples' started by noyzey, Oct 13, 2023.

  1. noyzey

    noyzey

    Joined:
    Mar 24, 2010
    Messages:
    34
    Likes Received:
    1
    Location:
    Sunshine Coast, Australia
    Hi Guys

    I have a couple of scripts that break when the HC is rebooted so, I'm looking for a place in the logic engine or syntax in a module I can use to run a bunch of script when the Home Controller is rebooted?

    Cheers
    gv
     
    noyzey, Oct 13, 2023
    #1
  2. noyzey

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,526
    Likes Received:
    173
    Location:
    Adelaide, Australia
    The scripting page has a "startUp (init) script" tab
     
    Ashley, Oct 13, 2023
    #2
  3. noyzey

    noyzey

    Joined:
    Mar 24, 2010
    Messages:
    34
    Likes Received:
    1
    Location:
    Sunshine Coast, Australia
    The scripting page has a "startUp (init) script" tab

    I'm using the Wiser 2/Space Logic Home Controller. I am not sure what you mean by Startup tab.
    I have tried using statements in the "Initialisation" section of the logic engine, but it doesn't run them on reboot.
    any ideas?
     
    Last edited: Oct 15, 2023
    noyzey, Oct 15, 2023
    #3
  4. noyzey

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,526
    Likes Received:
    173
    Location:
    Adelaide, Australia
    Sorry, wrong product. Schneider's naming conventions have become ridiculous. Also, in the pascal logic engine they are called modules, not scripts.

    Anyway, code in the Initialisation section will be run on startup. If it's not working you are probably trying to set cbus groups before cbus has fully started. Under tools/logic options menu, select the "other" tag and make sure "wait until cbus is online to start logic" is selected.
     
    Ashley, Oct 15, 2023
    #4
  5. noyzey

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    400
    Likes Received:
    37
    Location:
    Adelaide
    Just note that the intialisation section with the latest firmware for Wiser 2 /Home controller that the
    Advance|Initialsation section does not work for C-Bus GA's
    Therefore if you wish to set a group address level or state when the wiser starts up you will need to add a module in the modules section, then at the end of that particular module disable that module. for example


    SetLightingLevel("Back Hall", 0%, "0s");
    DisableModule("My Initialisation");
     
    Wonkey, Oct 16, 2023
    #5
  6. noyzey

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,526
    Likes Received:
    173
    Location:
    Adelaide, Australia
    I wasn't aware of this issue. Is it a bug?
     
    Ashley, Oct 16, 2023
    #6
  7. noyzey

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    400
    Likes Received:
    37
    Location:
    Adelaide
    No, its to do with how long the C-Bus daemon takes to start up in the new firmware.
    The intialisation script has executed prior to the C-Bus daemon being prepared to run, hence any C-bus GA's in the intialisation script would not be actions on the network.
    If you notice after a transfer now it says wait 3 minutes, it used to be 90 secs.

    Should probably mention its worth while putting a 1 min delay in this home built intialisation script before setting the GA's
     
    Last edited: Oct 16, 2023
    Wonkey, Oct 16, 2023
    #7
  8. noyzey

    noyzey

    Joined:
    Mar 24, 2010
    Messages:
    34
    Likes Received:
    1
    Location:
    Sunshine Coast, Australia
    SOLVED
    Thanks for your comments guys. I came to the same conclusion with the delay and EnableModule within the initialisation section options mentioned above.

    I found the script in my "Startup" module will run about 90 secs after a restart. I didn't need a delay command at the start of the script, nor in the initialisation section. The module runs perfectly at the end of the 90 secs. And yes I needed to add a DisableModule command at the end of the scripts.
     
    noyzey, Oct 17, 2023
    #8
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.