Change the "Code to Run" of the "Automation/Scenes/Scheduled on/off" program like this:
var controlModules = Modules.WithFeature("HomeGenie.ScheduleControl");
controlModules.Each((module)=>{
try
{
var schedexpr = module.Parameter("HomeGenie.ScheduleOn").Value;
if (module.IsOff && Scheduler.IsScheduling(schedexpr))
{
Program.Notify("Scheduled Control", module.Instance.Name + " ON");
module.On();
}
}
catch
{
Program.Notify("Scheduler Error", "Module " + module.Instance.Name);
}
return false;
});
controlModules.Each((module)=>{
try
{
var schedexpr = module.Parameter("HomeGenie.ScheduleOff").Value;
if (module.IsOn && Scheduler.IsScheduling(schedexpr))
{
Program.Notify("Scheduled Control", module.Instance.Name + " OFF");
module.Off();
}
}
catch
{
Program.Notify("Scheduler Error", "Module " + module.Instance.Name);
}
return false;
});
I just added a Program.Notify so we can see at least the name of the device causing the error. Also the try/catch will prevent the program from stopping.
Cheers,
g.