Getting started

Automation Groups and Programs

From Configure->Automation section we can create new scenarios, extend system functionalities, add new features and achieve almost any sort of automation and interaction between our devices.

Automation section consists of configurable groups and programs. Each program is identified by a numeric ID.
Programs with ID below 1000 are system programs that we will find installed by default.



Adding a new Program

Since automation programs are sorted into groups, first we have to choose a group for the program. We can add a new group by tapping the  Add Group  button.
After that, in the  Actions  menu of the group screen, we'll have the button for adding a new program and that will lead us to the Program Editor.


For our newly added program we can now choose the type: Wizard, CSharp, Javascript, Python , Ruby.
Despite of the selected type, a program consist of two blocks: the Trigger Condition and the Code to Run.
If a Trigger Condition is defined, the automation engine will automatically execute the Code to Run whenever the Trigger Condition is satisfied.
We can also choose between different triggering behavior (Trigger Type):
  • when condition evaluation switches to true
    the Code to Run will be executed once, when the condition changes from false to true. To trigger again, the condition must first change to false and then back to true.
  • when condition evaluation switches to false
    the Code to Run will be executed once, when the condition changes from true  to false. To trigger again, the condition must first change to true and then back to false.
  • run once, when condition evaluation returns true
    the Code to Run will be executed once, whenever the condition is true.
  • when condition evaluation returns true
    the Code to Run will be continuosly executed (loop) until the condition is true.
  • when condition evaluation returns false
    the Code to Run will be continuosly executed (loop) until the condition is false.
If a Trigger Condition is not defined the program can otherwise be executed manually by the user at any time.

Wizard Script

A Wizard script do not require any programming knowledge. It can be created with a few clicks/taps on the screen.
See Creating Scenarios for an explaination about how to create a Wizard script.

Javascript, Python and Ruby

When we need to implement more complex automation tasks, we can choose a more advanced language as Javascript, Phyton or Ruby.
For all of them we can use some Helper Classes that are accessible using the builtin hg object. For instance if we want to turn on the porch light we'll use the Modules helper class like this:
hg.Modules.WithName('Porch Light').On()
For a complete documentation of Helper Classes see Helper Class Reference section in this manual.

CSharp

When using CSharp automation program there are some difference: there is no hg object and we can call a Helper Class directly using its name. So, as the previous example, for turning on the porch light, we'll write: 
Modules.WithName("Porch Light").On();               

Raspberry-IO

If you have got HomeGenie running on a Raspberry Pi, you can also easily program GPIO, I2C, SPI by using the RaspberrySharp-IO library.
See RaspberrySharp-IO Wiki for examples about using this library.
More examples about using this library in HG from Python and Ruby automation programs are available from this forum post.

Automation Program Module

Each automation program have a module associated to it. The program module is used to store program's data and it is treated by HG just as a standard module.
So it can be added to Control Groups and have a widget for displaying its data in the Control Panel. The default widget for a program is a simple button that will run the program itself once clicked.
Using the Program Helper class we can set a different widget and change the way the program is shown in the Control Panel and so, the program's parameters that will be displayed.
See the Widgets section for further informations.

 

User's Guide

If you find this project useful, please encourage its development by donating. Thank you! =)
Get it on Google Play

Lastest Topics