Override Modules through a button press?

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by arrikhan, Dec 31, 2016.

  1. arrikhan

    arrikhan

    Joined:
    Oct 16, 2011
    Messages:
    48
    Likes Received:
    6
    Location:
    Australia
    I've currently got windows set to automatic open/close based on temperature differential readings of inside/outside 5031RDTSL units based on help from this great forum. I'm a novice at coding but the below module works (with accompanying globals, system IO definitions and regular temp readings).

    I've been reading through help files on module controls and cannot workout how to disable the module based on using a manual intervention such as using a switch to control the same GA.

    Below is the code in module "CoolHouse" that triggers based on scenario's which are described but occasionally we want to override and take manual control of the windows in severe events (wind is so strong we want to close windows regardless of code).

    I figured if a user simply presses a switch to close an open window, it could be the same trigger (being an intervention of automation) to disable the module, but my code options seem limited to reading a state, not the button press ? Is this right?

    Am I missing something basic to be able to disable the module?

    I plan to just re-enable at the start of every day which is simple enough. I was also considering creating a widget on the wiser to re-enable automation manually but am not sure on that one.

    (module is as follows....)

    Code:
    // if its hot inside (>26) but cooler outside
    // and windows are closed, open them
      if (TempLounge > 26) and
          (TempLounge > TempExternal) and
            (GetLightingState("Clerestory Windows") = OFF) then
      SetLightingState("Clerestory Windows", ON);
    
    // if its hot inside (>25), hot outside (>25), outside it hotter than inside
    // and windows are open,  close them
     if (TempLounge > 25) and
          (TempExternal > 25) and
             (TempExternal > (TempLounge + 1)) and
            (GetLightingState("Clerestory Windows") = ON) then
      SetLightingState("Clerestory Windows", OFF);
    
    // if its cool inside (<23) but colder outside than inside
    // and windows are open, close them
     if (TempLounge < 23) and
          (TempExternal < TempLounge) and
            (GetLightingState("Clerestory Windows") = ON) then
      SetLightingState("Clerestory Windows", OFF);
    
      Delay("0:05:00"); 

    Regards,


    BenC
     
    arrikhan, Dec 31, 2016
    #1
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.