The way you're using ModuleParameterChanged is not correct. This is supposed to be used for listening to module events, for instance when you turn on a module the Status.Level parameter will change to 1.
When.ModuleParameterChanged( (module, property) => {
Program.Notify("Homeduino switch", "Test2");
if (module.Instance.Domain == MODULES_DOMAIN )
{
int lightnumber = Convert.ToInt32(module.Instance.Address);
switch (property.Name) {
case "Meter.Watts":
Program.Notify("Homeduino switch", "Meter.Watts = " + property.Value);
break;
case "Status.Level":
Program.Notify("Homeduino switch", "Status.Level = " + property.Value);
break;
default:
break;
}
}
return true;
});
when you click the ON button the "Control.On" command will be called, and so the WebServiceCallReceived function will perform
Program.RaiseEvent(module, "Status.Level", 1, "My Light");
causing the module Status.Level change to 1.
g.