more G-Labs products

Author Topic: Sunrise and sunset condition  (Read 568 times)

August 29, 2016, 04:42:05 PM
Read 568 times

billy_hannant

  • *
  • Information
  • Newbie
  • Posts: 3
Hi All

Hope someone can help. I used to use the Sun.Event on the weather underground program with the ping at home program to switch on the lights when we arrived home. Since that has stop working I can find a set variable for when the sun has set.

I know about the new SolarTimes variable but that only seems to trigger the once and not again if the time is not at sunset when we arrive home.

All I'm looking for is a variable that is set at sunset and sunrise. Hope someone can help.

Many thanks

August 29, 2016, 05:19:48 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Are you trying to use a motion sensor and a time of day to determine if lights should turn on?  If so, check out the Advanced Smart Lights code.  It uses jkUtils Solar Altitude rather than WU or a luminescence sensor to determine sunrise/sunset.  You can either use that script or modify your code based on how it works.