Hey,
So I'm new to home genie and as I don't have any hardware it supports I thought I'd attempt to write a program or two. First I thought I'd control the Lightpack I have attached to the TV. I was aiming for simple on/off.
However I've looked over various bits of code and started but hit a hurdle where the widget on/off buttons won't fire the module changed event.
I added the virtual module to the dashboard and nothing, I get the "Entered!" notification sometimes but I'm assuming that's other modules firing. So the question is why is my widget disconnected?
Also as this program is only controlling one device is there much point in having a virtual module, I read there is a module associated to the program but I'm unsure how its addressable.
When.ModuleParameterChanged( (module, property) => {
Program.Notify("HomeAutomation.Prismatik", "Entered!");
if (module.Instance.Domain == "HomeAutomation.Prismatik" )
{
Program.Notify("HomeAutomation.Prismatik", "Fired!");
switch (property.Name) {
case "Control.On":
Program.Notify("HomeAutomation.Prismatik", "Command ON");
break;
case "Control.Off":
Program.Notify("HomeAutomation.Prismatik", "Command OFF");
break;
default:
break;
}
return false;
}
return true;
});
Program.GoBackground();
Program.Setup(()=>{
Program.AddOption("IPAddress", "", "0. Enter IP address of Prismatik", "text");
Program.AddOption("Port", "", "1. Enter port of Prismatik", "text");
Program.AddOption("APIKey", "", "2. Prismatik API Key", "text");
Program.AddVirtualModules("HomeAutomation.Prismatik", "Light", "homegenie/generic/colorlight", 1, 1);
});
return true;