Sartronics IoT-Master

Rules

Rules are used to automatically control device actuators depending upon active conditions. Conditions can be the state of a device or a scheduled time period. Multiple conditions can be combined with 'and' or 'or' to determine a specific condition.When the condition id meet it will invoke an action. The action can be to drive a device such as turning a relay device on. The action can be applied to a group of devices which all have the same named group. The duration that the action is applied can be specified. Multiple actions can be applied from the same active condition.

 

For example with four IoT devices a light, a switch, a luminosity sensor and a motion sensor all mount in a room. It would be possible to set up 2 rules to control the behaviour of the light. Rule 1 when the IoT switch is on then turn the IoT light on. Rule 2 when the IoT switch is off and the IoT luminosity sensor detects it is dark and also the IoT motion sensor detector is active then turn the light on 20 minutes. This means the light switch can be used to turn on the light permanently however if the switch is left off then the light will be controlled by the luminosity and motion sensor.

 

To set or modify rules press . This will present a list of rules that can be modified or new rules added to it.

 

 

 

Setting Rules

Pressing button 'New' or 'Edit' will present the following dialog box.

 

Choosing the enter button will apply the changes else Cancel will discard them.

 

Specifying Devices

Both 'Condition' and 'Action' have type 'Device' along with its 'Control'. The device is an IoT device as set up with Device Manage. The Device drop list will list all the configured devices the application has. Once a device is chosen its list of Controls, also known as device resources is available to choose from. A combination of both the device and its control is what is required to specify a particular sensor or actuator.

 

 

Conditions

The conditions can be one of two types. It can be a device control or a scheduled timed period.

For devices the condition can be one of the following depending upon the type of device selected. A simple input type will be 'Active' (on) or 'Inactive' (off). An analogue input can also be set to to trigger when a specific level is reached.

 

When an analog type of device control is chosen the activation condition can be set to a specific value. Once the device control's level reaches the rules requirement the condition is meet and the action will proceed.

 

When the 'Greater' option is chosen then the condition is active when the value level exceeds the condition level. When the value level falls back below the set condition level then the condition is restored. However if the hysteresis is set then the value level must fall below the set level by the amount of the hysteresis to restore the condition. Similar rules apply for 'Equal', 'Less', 'Greater or equal', 'Less or equal' and 'Not equal'.

 

Time Condition

To trigger a rule that occur at a particular time of day the the 'Time' condition is used.

 

With the 'Time' condition type the days start time and the duration can be set. If this is to only apply on specific days then those days of the week can be ticked. Note if no days are ticked then it will apply very day anyway as though all days are ticked. If the finish time is before the start time then the time active period will start on the ticked day and continue on into the next day.

 

For 'Time' conditions the condition can be one of the following.It can be within the start and finish time or alternatively it can be outside of this time. With the 'Within' selected the condition start at the time start. When the finished time is reached the condition is no longer active. With the 'Outside' selected the condition is active once the 'Finish' time is reached. It stops once the 'Start' time is reached.

 

 

And or do

Multiple conditions can be used in combination. When either 'and' or 'or' is chosen then the condition is dependent upon the condition of the next rule.

 

If 'and' is picked then both conditions must be meet for the action to be triggered. Similarly if 'or' is chosen then either condition will trigger the action. Note that 'and' has precedence over 'or'. This with a combination of a 'or' followed by and 'and' then the logic is first determined by the 'and' before the 'or'. So if inputs 1, 2 and 3 are combined such as 1 'or' 2 'and' 3', then the condition would be true if 1 is active and also if 2 and 3 are both active at the same time. It does not follow linear order therefore input 1 is not anded with input 3. Thus the order of the conditions is important when they are combined with combinations of 'or' and 'and'.

Selecting 'do' means apply the action to the right of the condition. With multiple conditions combined then the last one must have the 'do' set.

 

 

Actions

The Actions can be one of two types. It can be a device control or a set of devices defined by the same group name.

For devices or groups the Action can be one of the following depending upon the type of device selected. A simple output type will be On, Off, Toggle or Oscillate. An analogue actuator can be set to a specific level.

 

On and Off will result in a command to output device's control to turn the output on or off. Toggle will send either a on or off command depending on its current known state. So if it is off then it will be commanded on, and if it is off it will be commanded on.For Oscillate the output will be drive on then off constantly.

All these can be controlled by the following operators.

 

If 'Follow condition' is ticked along with 'On' then the output will be commanded on

when the condition is active and commanded off when the condition reverts. Similar for the 'Off', and 'Toggle'. With 'Follow condition' ticked the 'Pulse Timed Forever' will be grayed out.

If 'Pulse' is selected then the command will be sent and followed immediately the revert action command. If 'Timed' is selected then the period the action is on is controlled by the hour, minute and seconds duration setting. If 'Forever' is chosen then the action will never revert.

 

The 'Set level' is used for commanding the actuator to a particular value.

 

 

With

When the actions 'With' option is ticked then multiple actions can be triggered from the same condition. The next rule will not have a condition and will only have and action. The last one is not ticked.

 

 

Back to overview