more G-Labs products

Author Topic: Imputing value to switch or senser.  (Read 464 times)

November 11, 2016, 12:47:26 AM
Read 464 times

IanR

  • **
  • Information
  • Jr. Member
  • Posts: 31
Hello
I have been trying to follow the examples.
I can create a sensor and switch but I can’t seam to change the value of the sensor or switch,
Here is a bit of demo I code I have created:

Code: [Select]
const string A_DOM = "HomeAutomation.INPUT_Test";
Program.AddVirtualModule(A_DOM, "1","Switch", "homegenie/generic/switch");
var AModule = Modules.InDomain(A_DOM).WithAddress("1").Set();
hg.Settings.Parameter("AModule").Value = "on";

//var Senser1 = hg.Modules.WithName("Arduino Senser1").Get();
hg.Settings.Parameter("AModule").Value = "on";
while (Program.IsEnabled)
{
hg.Settings.Parameter("AModule").Value = "on";
   Program.Notify("X10 Auto Bright", "on" + "<br>" + "**** on *****");
  Pause(5);
hg.Settings.Parameter("AModule").Value = "off";
     Program.Notify("X10 Auto Bright", "off" + "<br>" + "**** off *****");
  Pause(5);
  hg.Settings.Parameter("AModule").Value = "1";
   Program.Notify("X10 Auto Bright", "on" + "<br>" + "**** 1 *****");
  Pause(5);
hg.Settings.Parameter("AModule").Value = "0";
   Program.Notify("X10 Auto Bright", "off" + "<br>" + "****0 *****" );
  Pause(5);
}
Program.GoBackground();

The popups are working as expected but the switch will not change state,
And when i try it with a sensor I just get a blank sensor widget displayed.

any help would be appreciated.
Thanks


There are no comments for this topic. Do you want to be the first?