hi nolio,
probably because you're constantly querying modules in the trigger code with this:
return (Program.WithName("Security Alarm System").Parameter("HomeGenie.SecurityTriggered").Value == "1");
Instead, it is strongly recommended that you use an event based model by changing your trigger code to:
return true;
and by adding an event listener to the program code (Code to Run):
When.ModuleParameterChange( (module, parameter) =>
{
if (module.Is("Security Alarm System") && parameter.Is("HomeGenie.SecurityTriggered") && parameter.Value == "1")
{
// alarm was triggered...
alarmTriggeredLogic();
return false;
}
return true;
});
var alarmTriggeredLogic = new Func<bool>(()=>{
// this code will be executed when the alarm is triggered; put your code logic here...
return true;
});
Program.GoBackground();
Cheers,
g.