HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: Peter1977 on August 11, 2014, 05:40:27 PM
-
Hello All!,
Can someone help me with a small simple code sample ? (c# or java)
I want a trigger when the current time is greater than a schedulerevent (eg. SolarAltitude.Day.Start).
And in the runcode i just want to turn on a zwave lamp.
I know this is easily done with the wizardscript but i want to do it in c# or javascript so i can learn from there on. (i had some programming experience long time ago and i want to refresh it :))
I also would like to thank the creators of this wonderful program!!!
Thanks in advance!
-
Here's a simple example, there might be a more efficient way of doing it, but this works for me:
Trigger code (javascript):
var dayStart = hg.Scheduler.WithName("SolarAltitude.Day.Start");
if (dayStart.IsScheduling())
{
hg.SetConditionTrue();
}
-
Thanks mvdarend!
I've tried your code and it works! I suppose i put it in the trigger section of the code ?
The only problem is that i get the following error code "Runtime.Error = "TC: hg is not defined""
Do you know what it means?
-
The only problem is that i get the following error code "Runtime.Error = "TC: hg is not defined""
Do you know what it means?
I get that message quite often, I just ignore it and the script seems to work fine. Not sure if it's a bug or something I'm doing wrong.
-
thanks!!