How to use the editor

The iFLUX programming model is based on Event-Condition-Action rules:

  1. Event sources push events to the /events API endpoint (exposed by the iFLUX middleware).
  2. The rules which have been configured on the middleware are evaluated. Every rule specify certain conditions (on the source, the event type, the event properties). Every rule also specify an action, which should be triggered if all conditions are met when an event is received. Every rule also specifies how the action properties should be computed (based on the triggering event properties).
  3. When an action is triggered, the iFLUX middleware issues an HTTP request to the /actions API endpoint (exposed by an iFLUX-compatible actuator or gateway.

The iFLUX middleware exposes the /rules API endpoint, so that users can create new rules. The payload accepted by the endpoint can be a bit tricky to write. The objective of this editor is to address this issue and to make the process easier. Using the editor involves three steps:

  1. Specify the IF clause of the rule, by defining conditions on the event source and the event type (conditions on event properties are not supported yet). In this step, also provide an example of event that would trigger the rule (this will make the next step easier).
  2. Specify the THEN clause of the rule. To do that, you will first specify an action target endpoint (this URL points to an action target component, such as an actuator or a gateway). You will also provide a schema that specifies how to generate the action payload (both the action type and the action properties).
  3. Finally, the editor will generate a rule payload. You can then grab this JSON data and POST it to the /rules API endpoint to add the rule to your iFLUX setup.

Event source

An event source is a particular sensor (hardware or software), which is registered on the iFLUX platform and which issues event notifications.

Example: a thermometer

Event type

Event sources emit events of different types. A type is associated with a list of properties.

Example: a temperature event

{ "timestamp" : "2015-01-12T05:21:07Z", "source" : "/event-sources/JI8928JFK", "type" : "/eventTypes/temperatureEventSchema", "properties" : { "temperature" : 22.5, "location" : "room 1" } }


An iFLUX event is defined by a source, a type, a timestamp and a list of custom properties.

Example: a temperature event may have 2 custom properties: location and temperature

Action target

An iFLUX action target implements the /actions/ endpoint defined in the iFLUX API. It accepts action payloads and executes them.

Example: a street light controller might accept actions to turn lights on and off.

{"type" : "sendEmail", "properties" : {"email" : "aware", "subject" : "New temperature", "body" : "The temperature in {{ properties.location }} is now: {{ properties.temperature }}." }}

Define a transformation schema (Handlebars)

The schema specifies how to generate an action, based on the incoming event properties.

{"timestamp": "now","type": "hello"}

Check the result action payload.

An iFLUX action is defined by a type and a list of properties.

API request