Hello
I am trying to learn how to code in c# and Hg.
I have written a code using the examples I have found, to communicate with my Arduino (to and from). I can see the communications in the activity bubble in the top right. But the widget on the dashboards will not change with the change of input.
Please can you have a look at the code and see where I am going wrong.
Action<string>
HandleStringReceived = (string message) => {
Program.Notify("X10 Auto Bright", "Arduino" + "<br>" + "Com6" + " " + message); // write to bubble
const string Dashboard = "HomeAutomation.Dashboard";
if (message == "on")
{
Program.AddVirtualModules("HomeAutomation.Dashboard", "light", "homegenie/generic/light", 1, 1); // change widget states
Program.Notify("X10 Auto Bright", "Arduino" + "<br>" + "Com6" + " " + "Set on"); // write to bubble
}
if (message == "off")
{
Program.AddVirtualModules("HomeAutomation.Dashboard", "light", "homegenie/generic/light", 0, 0); // change widget states
Program.Notify("X10 Auto Bright", "Arduino" + "<br>" + "Com6" + " " + "Set off"); // write to bubble
}
};
Thanks
Ian