Once I switched to version 525 my night and day detection stopped working. I might have messed it up myself though... Does anyone care to examine the below and see if they see something wrong? Basically it always reports NIGHT
if (module.Is("BackPorchMotion"))
{
//jkUtils
time_sunrise = DateTime.ParseExact(Program.WithName("jkUtils - Solar Altitude").Parameter("jkUtils.SolarAltitude.Morning.Sunrise.Start").Value, "H:mm", System.Globalization.CultureInfo.InvariantCulture);
time_sunset = DateTime.ParseExact(Program.WithName("jkUtils - Solar Altitude").Parameter("jkUtils.SolarAltitude.Evening.Sunset.End").Value, "H:mm", System.Globalization.CultureInfo.InvariantCulture);
//Program.Notify("Hello","time_sunrise");
//
[email protected];
//
[email protected];
if (DateTime.Compare(DateTime.Now, time_sunrise)<0 || DateTime.Compare(DateTime.Now, time_sunset)>0)
{
Night = true;
Program.Notify("Msg from BackPorchMotion","It is Nighttime");
//Log("Night");
}
else
{
Night = false;
Program.Notify("Msg from BackPorchMotion","It is Daytime");
//Log("Day");
}
}