more G-Labs products

Author Topic: Help convert pseudocode into automation scenario?  (Read 934 times)

December 13, 2014, 04:02:10 PM
Read 934 times

ryan

  • *
  • Information
  • Newbie
  • Posts: 1
Hello!  I have some zwave units set up and talking to HG properly, reporting their status as expected.  I'd like to try automating some lights as a starting point in HG, but have not been able to find any appropriate examples on the web site.  The "Overview by Example" section is all code examples, nothing about how to use the very nice GUI to set up automation.

Here are two scenarios I'd like to try to get my feet wet, hopefully using the GUI so I don't have to learn C#.  One is to simply turn a light switch on at sunset.  The other is to turn the lights on after sunset when the front door opens.

First example:

if (currentTime >= sunsetTime)
     turn on lightSwitch1

And what about this:

if (currentTime >= sunsetTime) and (doorSensor == open)
  turn on lightSwitch1

Can this be done without delving into manual C# scripting?

Thanks much.  I'm very intrigued by HG so far.  I just need to wrap my head around making it "work" for my use cases now.

Ryan

December 13, 2014, 11:27:51 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I use C# exclusively, so I'm not sure if you can do logic in a wizard script.  If you just want to perform actions at times, you can use the scheduled control module.  If you want to use a specific time, you can use crontab style inputs.  If you want to use things like sunrise/sunset, then you will need to enable one of the weather modules or the time of day code.  Then you use the name with a "@" as a prefix.  This is all documented on the HG website in the help section.