if (Program.Parameter("HomeGenie.SecurityTriggered").Value == "1") { // var alarmstart = DateTime.Now; // // send email // var subject = "HomeGenie Security System Alarmed"; var messagetext = "Security System Alarm triggered by " + Program.Parameter("HomeGenie.SecurityTriggerSource").Value; var recipients = Program.InputField("Email.Recipients").Value; if (recipients != "") { Program.RunAsyncTask(()=>{ Net.SendMessage(recipients, subject, messagetext); }); } var sirenstate = 0; while (Program.Parameter("HomeGenie.SecurityTriggered").Value == "1") { // flashing SecurityAlarm lights alarmModules.Toggle(); Pause(1); alarmModules.Toggle(); Pause(1); // var elapsed = new TimeSpan(DateTime.Now.Ticks - alarmstart.Ticks); if (sirenstate == 0 && Program.InputField("System.SirenStartTime").DecimalValue > 0 && elapsed.TotalSeconds > Program.InputField("System.SirenStartTime").DecimalValue) { sirenModules.on(); sirenstate = 1; } if (sirenstate == 1 && Program.InputField("System.SirenMaxTime").DecimalValue > 0 && elapsed.TotalSeconds > Program.InputField("System.SirenStartTime").DecimalValue + Program.InputField("System.SirenMaxTime").DecimalValue) { sirenModules.Off(); sirenstate = 2; } } //Pause(1); alarmModules.Off(); sirenModules.Off(); } Pause(1);
Program.WithName("jkUtils - Solar Altitude").Parameter("jkUtils.SolarAltitude.Morning.Sunrise.Start").Value
Just did that. It will be available with next release along with a bunch of other interesting stuff (before the end of this week).g.