HomeGenie Forum
General Category => Troubleshooting and Support => Topic started by: teo1969 on October 29, 2015, 09:37:31 PM
-
Dear, I have a PIR X10 sensor named: "B3" that trigger a C# program "Startup Code" . I would like to run the code content in "program code" section, when B3 goes "on".
I develop this code that succesfully read event X10(B3) sensor but i'm not able to run the corresponding "program code" when i recive "B3=on" event.
what 'wrong in my code? .... why when B3 goes "on", and i see my trigger notification, my program code is not executed?
**my startup/trigger code:**
When.ModuleParameterChanged((module, parameter) => {
if (module.Is("B3"))
{
if (parameter.DecimalValue > 0){
Program.Notify("Event: ON->GO", "execute my program code");
return true;
}else{
Program.Notify("Event OFF: ","do nothing");
return false;
}
}
return false;
});
Program.GoBackground();
**my Program code:**
...
//TODO
Program.Notify("Program Code ","do somethings!!");
...
Many Thx in advance!!
Matteo
-
move your current "startup code" to the "program code" and just put a
Program.Run();
in the startup code.
-
Thanks, now it's working.