AIRS Ruler

In August 2013, we released AIRS Ruler, a rule engine that acts on ongoing AIRS recordings. On this page, we outline how to use AIRS Ruler and what possible usage scenarios are.

Why acting on AIRS recordings?

AIRS records a plethora of information right on your mobile. So why not perform actions on whatever is recorded at any time?

Imagine that you change your mood annotation to Happy – wouldn’t it be great to change the wallpaper that shows your lightened mood?

Imagine that you annotate your recordings with I am travelling – wouldn’t it be great to take this as a hint to switch off WiFi?

Many other usage can be envisioned, depending on what you record with AIRS at any moment in time. AIRS Ruler utilises these recordings without compromising your privacy, i.e., no access is granted to the historical database that AIRS generates.

Starting: Configure AIRS

Apart from configuring AIRS according to what you want to record (see here for more information on AIRS configuration), you will need to specifically enable AIRS to support applications like AIRS Ruler. For this, you will need to go into the Config tab of AIRS and select the General Settings:

Screenshot_2013-08-22-14-04-18

Once you are in the settings, enable AIRS Intents (see above). With this, you enable AIRS to send the currently recorded value (according to your configuration) as a so-called Android intent to any interested application, such as AIRS Ruler. Android intents is a lightweight Android OS mechanism that allows for so-called inter-application communication (here between AIRS and AIRS Ruler).

If you want to return to a totally private mode again, simply de-select AIRS Intents in the settings above.

Creating a Rule

The basis for AIRS Ruler is a rule, i.e., a condition upon which to react. In the main screen of AIRS Ruler, you create an empty rule by clicking on the + button in the action bar:

Screenshot_2013-08-22-14-17-49

 

The empty rule (called NEW) will be added to the list of your existing rules. Any new rule is by default disabled and does not contain any conditions and actions!

Creating Conditions

You can edit a rule by simply clicking on it in the list of rules (see picture above). This will open the following window:

Screenshot_2013-08-22-14-21-03

 

The first card in this window contains the name of the rule (here NEW since the rule has just been created). Simply select the edit box in the card and change the name to whatever you want.

The second card contains a default condition. You can select the sensor value you want to react upon:

Screenshot_2013-08-22-14-04-55

 

Mood and Event are the annotations you can define through the AIRS Event and Mood widgets while the other sensors are the equivalent AIRS sensors (e.g., AS for noise and LI for the light value).

You can also select the operator being used in the condition:

Screenshot_2013-08-22-14-05-04

 

AIRS Ruler supports the standard operators for larger, smaller, equal etc. In addition, the operator has can be used to test for a substring in a string. For instance, in order to create a rule that acts when the mood is happy or very happy, simply use the shown condition above, i.e., If Mood has ‘happy’.

The field on the right hand side of the condition card is the value to be tested for (here the string happy).

Pressing on the + button in the lower action bar creates an additional condition card:

Screenshot_2013-08-22-14-25-42

 

With the appearance of a second condition card, the first condition card now includes a boolean operator (AND by default), defining how the two conditions shall be combined (in this example, we test if mood has happy and event equals some string). Conditions can also be ORed by changing the boolean selector. Combining the rules through the boolean operators starts with the first one in the list and applies the boolean operator for each card after another – keep this in mind when you built complex rules with more than two conditions!

With the appearance of the second card, a delete button is shown for each condition (you can delete either of them). At least one condition is required which is why no delete button is shown when there is only one condition.

Defining the Action

The last card in our window is always the Action card. In case the sequence of conditions is true according to the definition, the action as defined in the Action card is executed by AIRS Ruler.

You can select from a number of actions:

Screenshot_2013-08-22-14-05-17

 

You can switch on/off Bluetooth and WiFi, have the device vibrate, change the wallpaper to your liking or show a brief text. Additional input parameters are required, depending on the action. In the wallpaper case, for example, you will see a small bitmap that shows the selected wallpaper to be shown. Clicking on this image will open a selector for defining the image you like.

Using Templates

In order to make rule building easier for you, we provide a list of easy to understand rules as templates. By clicking on the red folder icon on the right of the lower action bar, you will be presented with the list of supported templates:

Screenshot_2013-08-22-14-05-26

 

The chosen language abstracts from the concrete values that you will see once the conditions will be created for you (e.g., high pressure is appropriately translated in values above 1025).

Save Rules

Some changes in conditions and actions require saving. For this, simply press the save icon on the left side of the lower action bar. AIRS Ruler detects most changes you make and will ask to save these if you leave the rule definition without saving (e.g., by pressing the Back button).

Start the Rule

Finally, after having defined all the right conditions and the action to be taken, you will need to explicitly enable the new rule. This is done by pressing the Play button in the appropriate rule card of the main window:

Screenshot_2013-08-22-14-04-37

 

You can disable any rule by simply starting AIRS Ruler and pressing the Pause button (changing the stripe on the left to red).