Logic Show Page

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by DarylMc, Jan 4, 2012.

  1. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello everyone
    I have been trying to use some logic to get Homegate or Colour Touch to change pages.
    The use I have in mind is for IP cameras but for now I have created some logic to change pages according to a group status.
    I got that to work correctly but then the page wouldnt time out.
    So I added a delay to get it to go back to the home page but now it won't work while that delay is running.
    I'm not sure if that will stop it from being usefull but could someone please give me some advice how to get around this.

    once (GetLightingState("OFFICE LIGHTS") = ON) then
    begin
    ShowPage("OFFICE");
    Delay("0:01:00");
    ShowPage("HOME");
    end;
     
    DarylMc, Jan 4, 2012
    #1
  2. DarylMc

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    323
    Likes Received:
    5
    Location:
    FNQ
    Hello DarylMc.

    Instead of delays, try using a timer.

    once (GetLightingState("OFFICE LIGHTS") = ON) then
    begin
    ShowPage("OFFICE");
    TimerStart(1);
    end;

    once
    TimerTime(1) = 60 then
    begin
    ShowPage("HOME");
    end;

    Mark
     
    Mr Mark, Jan 4, 2012
    #2
  3. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Mark
    Thanks very much for the tip.
    I will give it a go.
     
    DarylMc, Jan 4, 2012
    #3
  4. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Mark
    That seems to have fixed it.
    Thanks again for the example of timer use.
     
    DarylMc, Jan 4, 2012
    #4
  5. DarylMc

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Just for the record, so you understand *why* the original logic didn't work is that the "Delay" function stops that module executing for that amount of time.

    BTW - the new logic will switch to "HOME" one minute after switching to "OFFICE", regardless of what the user has done since (eg if they have navigated away and are doing something else)...

    You might be better off addressing why the "OFFICE" page wouldn't time out in the first place... what was the timeout on the page "OFFICE" set to?

    Nick
     
    NickD, Jan 8, 2012
    #5
  6. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Thanks for the explanation Nick.
    I have only just started to create some tasks for the logic engine and I'm a bit overwhelmed sometimes but hopefully it will all sink in.
    What I had in mind was the Colour Touch to go to a page with a camera view when someone opened a garage door.
    I think that will do the trick now without causing any other problems.
     
    DarylMc, Jan 9, 2012
    #6
  7. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Nick
    I see what you are saying about the timer timeout going back to home page regardless of which page you may have moved to.
    Is there a way to use the show page command but then revert back to the project page timeout.
    I'm fairly sure if I didnt tell it to go back to the Home page it would stick on the page which showpage sent it to.

    Edit
    I just added this and now if you navigate to another page it reverts to project page timeout.
    Code:
    {Go to "Office" page when office lights turn on}
      once (GetLightingState("OFFICE LIGHTS") = ON) then
      begin
      ShowPage("OFFICE"); 
      TimerStart(1);
      end;
    {If still on Office page after 60 sec return to home page}
      once TimerTime(1) = 60  then
      if showingpage ("Office")then
      begin
      ShowPage("HOME");
      end;
    
    
    Thanks
     
    Last edited by a moderator: Jan 10, 2012
    DarylMc, Jan 9, 2012
    #7
  8. DarylMc

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    This should be the default behaviour. Each page has its own timeout setting (by default it uses the project setting)... go to "Page->Edit Page Properties".

    Is it possible the page you're switching to is set to never time out?

    Nick
     
    NickD, Jan 10, 2012
    #8
  9. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,315
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hello Nick
    Since I have Homegate running in Demonstration mode it timed out of Simulation Mode and also when I was making changes to the logic I exited Sim mode so I think that was my problem.
    Once I put it back to simulation mode the project page timeout seems to be working correctly without me having to direct it from the logic and is a simple task.
    I am very sorry to send you on a wild goose chase.
    Thank you very much for the assistance.
     
    Last edited by a moderator: Jan 10, 2012
    DarylMc, Jan 10, 2012
    #9
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.