Trouble turning lights on after sunset

Discussion in 'Pascal Logic Code Examples' started by dynajet, Mar 30, 2019.

  1. dynajet

    dynajet

    Joined:
    Feb 3, 2013
    Messages:
    12
    Likes Received:
    0
    Location:
    North Carolina
    I have the following code running on my Wiser v1 to turn on lights after sunset. I have setup the GPS coordinates for my location to define the sunrise and sunset times.

    once (Time > sunset ) then
    begin
    Delay ("0:15:00");
    SetLightingState("Garage Front Lights", ON);
    SetLightingState("Front Walk Lights", ON);
    SetLightingState("Driveway Lights", ON);
    SetLightingState("Front Patio Ceiling Lights", ON);
    end;

    For some reason this turns the lights on early and at different times each day before sunset and the time difference is more then the the change in sunset time. I would appreciate any help.

    Note: My Wiser unit was purchased in 2011 and I have never updated the firmware. Could this be a firmware problem?

    Thanks,
    dynajet
     
    dynajet, Mar 30, 2019
    #1
    1. Advertisements

  2. dynajet

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    940
    Likes Received:
    59
    Location:
    Adelaide, Australia
    Can't see anything wrong with the code, although you don't really need the delay as you can go
    once time > (sunset + "0:15:00") then

    Try running PICED and in the project details see what time it thinks sunset and sunrise are for your location.
     
    Ashley, Mar 31, 2019
    #2
    1. Advertisements

  3. dynajet

    dynajet

    Joined:
    Feb 3, 2013
    Messages:
    12
    Likes Received:
    0
    Location:
    North Carolina
    Ashley,

    I checked the project details and for my location the sunset time is 7:49 pm. The lighting came on tonight at 7:04 pm which is 1 hour before the programed time. The displays on my Saturn DLT keypads shows the correct time. Any other suggestions would be appreciated.

    Thank you, Dynajet
     
    dynajet, Apr 1, 2019
    #3
  4. dynajet

    Trevor

    Joined:
    Nov 22, 2018
    Messages:
    63
    Likes Received:
    2
    Out on a limb here, what about daylight savings times ?
     
    Trevor, Apr 1, 2019
    #4
  5. dynajet

    Wonkey

    Joined:
    Aug 3, 2004
    Messages:
    143
    Likes Received:
    5
    Location:
    Adelaide
    Run you project in simulation mode in piced
    First of put on the testing screen a few component that align with your group addresses
    Change the time on the PC to test
    Ensure the logic engine is running
     
    Wonkey, Apr 1, 2019
    #5
  6. dynajet

    dynajet

    Joined:
    Feb 3, 2013
    Messages:
    12
    Likes Received:
    0
    Location:
    North Carolina
    Last night as I said the lights came on an hour before sunset but on my module to turn off the lights at 11:00PM the lights went off at 11:00PM.

    If I look at my Wiser screen I goto the settings to check the time. The daylight savings box is not checked but the clock has the correct time. when I check the box the clock goes ahead one hour. This my help the sunset module but cause a problem with the off module. I'm going to give it a try for tonight.
     
    dynajet, Apr 1, 2019
    #6
  7. dynajet

    dynajet

    Joined:
    Feb 3, 2013
    Messages:
    12
    Likes Received:
    0
    Location:
    North Carolina
    I finally have the lights going on and off at the correct times. I had to go into settings and turn off daylight savings time. I then added an addition 1 hour delay for the lights to come on. This has now worked for 2 nights in a row. I feel that there is a problem with the daylight savings setup. Any ideas?
     
    dynajet, Apr 6, 2019
    #7
  8. dynajet

    Trevor

    Joined:
    Nov 22, 2018
    Messages:
    63
    Likes Received:
    2
    Just another thought here, check that the time zone and location in the Piced project options are correct for your location, they may default to some ware in another time zone.
     
    Trevor, Apr 7, 2019
    #8
  9. dynajet

    dynajet

    Joined:
    Feb 3, 2013
    Messages:
    12
    Likes Received:
    0
    Location:
    North Carolina
    I already have. Time zone is GMT -5. Location checks out with my GPS unit. This is what makes this so frustrating that it does not work.
     
    dynajet, Apr 7, 2019
    #9
  10. dynajet

    Trevor

    Joined:
    Nov 22, 2018
    Messages:
    63
    Likes Received:
    2
    All I can say is hmmm???? at this time. I'll keep thinking about it as I like playing around in Piced :cool:
     
    Trevor, Apr 8, 2019
    #10
    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.