Skip to content

IoT Logic Core

The IoT Logic Core provides a data model and commands for scenes, rules and associated links.

Links are used to create N:N connections between rules and scenes. Rules serve as triggers for triggering. The links are used to resolve which scenes are to be executed.

Field Data type Description
id String ID for unique identification in the system.
name String The assigned name.
description String The assigned description.
active Boolean Specifies whether the link is activated.
conditionCollectionId String Specifies the ID of a rule.
executorCollectionId String Specifies the ID of a scene.
Code examples
ConnectionDTO
{
"id": "2d46cc1b-5780-4d4e-b5de-293ec346d6b7",
"active": false,
"conditionCollectionId": "0809bb46-4ce7-42a3-8c78-04cb7d24a30e",
"executorCollectionId": "971c0c85-8f5d-45b6-894a-b8026f09d6ca",
"name": "Connection 1",
"description": "Connects cond1 and exec1"
}
Field Data type Description
id String Unique ID of the device in the system.
Code examples
ConnectionDeletedDTO
{
"id": "2d46cc1b-5780-4d4e-b5de-293ec346d6b7"
}

Scenes are required to switch devices or trigger actions. These contain preconfigured values for devices or actions to be triggered.

Scenes are represented by a container. Each scene is represented by a container. Such a container contains a list of commands to be executed in the “executors” field.

Field Data type Description
id String ID for unique identification in the system.
name String The assigned name.
description String The assigned description.
executors Array An array of executor objects.
Code examples
ExecutorCollectionDTO
{
"id": "76dd6b1f-3f6a-4c02-b6d7-3539cd03201c",
"name": "Bathroom off",
"description": "Leave Bathroom",
"executors": [
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "RAW",
"value": 0.0
}
},
{
"position": 1,
"type": "DELAY",
"delay": 5000
},
{
"position": 2,
"type": "STATE",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"channelId": "Valve",
"state": "CLOSE"
}
]
}
Field Data type Description
id String Unique ID of the device in the system.
Code examples
ExecutorCollectionDeletedDTO
{
"id": "2d46cc1b-5780-4d4e-b5de-293ec346d6b7"
}

General functions are referred to as executors. These are independent of devices or channels. The delay and loop executor can be used to control the execution behavior of a scene.

Field Data type Description
type String Specification of the executor type.
position Number The position determines the order of execution.

The “type” field is used to specify the type of executor. The following types are possible:

Type Executor
DELAY DelayExecutor
LOOP LoopExecutor
MESSAGE MessageExecutor
URL UrlExecutor
PARAMETER ParameterExecutor
RANDOM RandomExecutor
STATE StateExecutor
STATE_TOGGLE StateToggleExecutor
VALUE ValueExecutor
INCREASE_DECREASE InDecreaseExecutor
FADE_TO FadeToExecutor
FADE_FROM_TO FadeFromToExecutor
LINK LinkExecutor

Creates a delay during the execution of a scene.

Field Data type Description
delay Number Delay in milliseconds
Code examples
ExecutorCollectionDeletedDTO
{
"position": 4,
"type": "DELAY",
"delay": 5000
}

Control element for the repetition of the scene.

Field Data type Description
loop Number A value less than 0 deactivates the loop function; a value of 0 causes the execution to be repeated indefinitely; a value greater than 0 specifies how often the execution is repeated.
Code examples
ExecutorCollectionDeletedDTO
{
"position": 1,
"type": "LOOP",
"loop": 3
}

Send message by e-mail / push to the specified users.

Field Data type Description
message String The message to be sent.
messageType String The message type.
recipients Array List of users who should receive the message.

The following message types can be used in the “messageType” field:

Type


NOTIFICATION


WARNING


ALERT


ERROR


CUSTOM


Code examples
MessageExecutorDTO
{
"position": 0,
"type": "MESSAGE",
"messageType": "NOTIFICATION",
"recipients": [
"User1",
"User2"
],
"message": "Gateway will be shutdown in 30 minutes."
}

Call a user-defined URL.

Field Data type Description
url String The URL to be called up incl. prefix such as https://
user String The user for authentication.
password String The password for authentication.
ignoreCert Boolean Deactivate the validity check of certificates.
Code examples
UrlExecutorDTO
{
"position": 1,
"type": "URL",
"url": "https://192.168.0.12:8080/info.html",
"user": "user",
"password": "passw@rd",
"ignoreCert": true
}

A Thing Executor always refers to the control of a device and requires the device ID.

Field Data type Description
thingId String The unique device ID.

Sets one or more device parameters.

Field Data type Description
parameters Object Each object field represents a parameter by specifying the parameter ID and the corresponding value.
Code examples
ParameterExecutorDTO
{
"position": 0,
"type": "PARAMETER",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"parameters": {
"8D4B49E26FB8A194A7CCB05DC0BB507A": "ON",
"CF97094FDCA80778221D783811E0A573": "10.3"
}
}

The channel executor controls individual channels of a device. The device ID and the channel ID are therefore required.

Field Data type Description
thingId String The unique device ID.
channelId String The unique channel ID for a device.

Use state or value from another channel of a device.

Field Data type Description
foreignThingId String The unique device ID of the device from which the value is to be transferred.
foreignChannelId String The unique channel ID of the channel of the other device from which the value is to be transferred.
Code examples
LinkExecutorDTO
{
"position": 0,
"type": "LINK",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"foreignThingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"foreignChannelId": "Dimmer"
}

Sets a random value or state within the valid value range.

Code examples
UrlExecutorDTO
{
"position": 0,
"type": "RANDOM",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer"
}

Toggles between specified states.

Field Data type Description
states Array Specifies the states to be used as a string. If the array remains empty, all states except UNKNOWN are used.
Code examples
StateToggleExecutorDTO 1
{
"position": 0,
"type": "STATE_TOGGLE",
"thingId": "dec83c14-1fdc-439b-844c-1f01d4f58194",
"channelId": "Switch"
}
StateToggleExecutorDTO 2
{
"position": 0,
"type": "STATE_TOGGLE",
"thingId": "dec83c14-1fdc-439b-844c-1f01d4f58194",
"channelId": "Switch",
"states": [
"ON",
"OFF"
]
}

Sets the state of a channel to the specified value.

Field Data type Description
state String The state to be set.
Code examples
StateExecutorDTO
{
"position": 0,
"type": "STATE",
"thingId": "dec83c14-1fdc-439b-844c-1f01d4f58194",
"channelId": "Switch",
"state": "OFF"
}

A special feature of numerical values is that they are represented by an object. This makes it possible to use extended functions to determine the actual value.

Field Data type Description
type String Specifies the type of the value container.

The following types are possible.

type Description
RAW The value is specified directly.
CALCULATED The value is calculated using a formula and variables.
LINK The value is taken from another device / channel.

RawValueDTO

The value is specified directly.

Field Data type Description
value Number The value to be used.
Code examples
RawValueDTO
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "RAW",
"value": 100.0
}
}

CalculatedValueDTO

Calculation of the value based on a formula and the definition of further values as variables and function expressions.

Field Data type Description
expression String Formula for the calculation.
values Object Each field of the object represents a variable that can be used in the calculation. A value container object is again stored there as a value. A variable may only consist of letters!

Each field of the object represents a variable that can be used in the calculation. A value container object is again stored there as the value.

The following operators and control characters can be used in the “expression” field:

character description
+ Addition
- Subtraction
* Multiplication
/ Division
( Parenthesis on
) Parenthesis closed

The following functions can be used in the “expression” field. Note: x,y could be variables or values.

Function Description
min(x,y) Returns the number with the smaller value
max(x,y) Returns the number with the greater value
sqrt(x) square root
pow(x,y) Returns the value of a base (x) raised to a power (y)
floor(x) Takes as input a real number x, and gives as output the greatest integer less than or equal to x
ceiling(x) Maps x to the smallest integer greater than or equal to x
round(x) Rounds the specified value to the closest long value
abs(x) Returns the non-negative value of x without regard to its sign
log(x) Returns the natural logarithm (base e) of x
log10(x) Returns the base 10 logarithm of x
sin(x) Sinus of x
sinh(x) Sinus hyperbolicus of x
asin(x) Returns the arc sine of x
cos(x) Cosinus
cosh(x) Cosinus hyperbolicus of x
acos(x) Returns the arc cosinus of x
tan(x) Tangens
tanh(x) Tangens hyperbolicus of x
atan(x) Returns the arc tangens of x
Code examples
CalculatedValueDTO 1
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "CALCULATED",
"expression": "a+b",
"values": {
"a": {
"type": "RAW",
"value": 10.0
},
"b": {
"type": "RAW",
"value": 20.0
}
}
}
}
CalculatedValueDTO 2
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "CALCULATED",
"expression": "(a*3)/2",
"values": {
"a": {
"type": "LINK",
"foreignThingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"foreignChannelId": "Dimmer"
}
}
}
}
CalculatedValueDTO 3
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "CALCULATED",
"expression": "max(a,min(b,c))",
"values": {
"a": {
"type": "RAW",
"value": 100.0
},
"b": {
"type": "LINK",
"foreignThingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"foreignChannelId": "Dimmer"
},
"c": {
"type": "RAW",
"value": 10.0
}
}
}
}

LinkedValueDTO

Use value from another device channel. Only data type value can be linked, not a state.

Field Data type Description
foreignThingId String Specification of the device ID.
foreignChannelId String Specification of the device channel ID.
Code examples
LinkedValueDTO
{
"position": 0,
"type": "VALUE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "LINK",
"foreignThingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"foreignChannelId": "Dimmer"
}
}

Change the numerical value of a channel to the specified value. The actual value is determined at check time using the stored value container.

Field Data type Description
value Object Value container for the value to be used.

Changes a numerical value incrementally from a specified start value to the specified target value within a specified time.

Field Data type Description
from Object Value container for the start value.
to Object Value container for the target value.
ms Number Time specification in milliseconds.
Code examples
FadeFromToExecutorDTO
{
"position": 1,
"type": "FADE_FROM_TO",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"to": {
"type": "RAW",
"value": 100.0
},
"ms": 5000,
"from": {
"type": "RAW",
"value": 0.0
}
}

Changes a numerical value incrementally to the specified target value within a specified time.

Field Data type Description
to Object Value container for the target value.
ms Number Time specification in milliseconds.
Code examples
FadeToExecutorDTO
{
"position": 1,
"type": "FADE_TO",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"to": {
"type": "RAW",
"value": 80.0
},
"ms": 2500
}

Increases or decreases the channel value by the specified value.

Field Data type Description
value Object Value container for the value to be used.
decrease Boolean Specifies whether the channel value should be decreased by the value from the “value” field, otherwise it is increased.
Code examples
InDecreaseExecutorDTO
{
"position": 1,
"type": "INCREASE_DECREASE",
"thingId": "91905b50-bf83-4584-a14b-d4c2800cec1e",
"channelId": "Dimmer",
"value": {
"type": "RAW",
"value": 20.0
},
"decrease": true
}

Rules can be used to define triggers for scenes. The evaluation is carried out sequentially in order, taking into account the “position” field.

A ConditionCollection represents a rule with a collection of conditions.

Field Data type Description
id String ID for unique identification in the system.
name String The assigned name.
description String The assigned description.
conditions Array A collection of conditions for logical evaluation.
type String The type of the ConditionCollection is always COLLECTION
position Number The position field is taken into account in the evaluation and the conditions are sorted accordingly beforehand
Code examples
ConditionCollectionDTO 1
{
"type": "COLLECTION",
"position": 0,
"id": "7c6ba18c-d4ee-4254-91aa-9989bf581f68",
"name": "Conditon1",
"description": "Checks Dimmer Bathroom Condition",
"conditions": [
{
"type": "STATE",
"position": 0,
"comparator": "EQUAL",
"thingId": "d5da720e-2ad6-4c86-88c0-f84390f76570",
"channelId": "WindowHandle",
"smartCheck": false,
"state": "CLOSED"
},
{
"type": "OPERATOR",
"position": 1,
"comparator": "OR"
},
{
"type": "VALUE",
"position": 2,
"comparator": "GREATER",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"channelId": "Dimmer",
"smartCheck": false,
"value": 45.0
}
]
}
ConditionCollectionDTO 2
{
"type": "COLLECTION",
"position": 0,
"id": "7c6ba18c-d4ee-4254-91aa-9989bf581f68",
"name": "Conditon1",
"description": "",
"conditions": [
{
"type": "STATE",
"position": 0,
"comparator": "EQUAL",
"thingId": "d5da720e-2ad6-4c86-88c0-f84390f76570",
"channelId": "WindowHandle",
"smartCheck": false,
"state": "CLOSED"
},
{
"type": "OPERATOR",
"position": 1,
"comparator": "OR"
},
{
"type": "VALUE",
"position": 2,
"comparator": "GREATER_EQUAL",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"channelId": "Dimmer",
"smartCheck": false,
"value": 45.0
},
{
"type": "OPERATOR",
"position": 3,
"comparator": "AND"
},
{
"type": "COLLECTION",
"position": 4,
"id": "e37b6aee-2e35-4b64-82a5-8dd7a822e861",
"name": "Inner conditionCollection",
"description": "description example",
"conditions": [
{
"type": "VALUE",
"position": 1,
"comparator": "SMALLER",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"channelId": "Dimmer",
"smartCheck": false,
"value": 30.0
}
]
}
]
}
Field Data type Description
id String Unique ID of the device in the system.
Code examples
ConditionCollectionDeletedDTO
{
"id": "e37b6aee-2e35-4b64-82a5-8dd7a822e861"
}

A condition is used for the logical evaluation of device data or other factors such as checking the time.

All condition objects have the following fields:

Field Data type Description
type String The type of the condition.
position Number The position field is taken into account in the evaluation and the conditions are sorted accordingly beforehand.
comparator String Comparison operator to be used. This depends on the condition type used.

The “type” field indicates the type of condition.

Type Condition DTO
COLLECTION ConditionCollection
OPERATOR ConditionOperator
TIME TimeCondition
STATE StateChannelCondition
VALUE ValueChannelCondition

A comparison operator enables conditions to be linked logically.

The following comparison operators are possible in the “comparator” field:

Possible comparison operators


AND


NAND


OR


NOR


XOR


NXOR


Code examples
ConditionOperatorDTO
{
"type": "OPERATOR",
"position": 0,
"comparator": "OR"
}

A time condition is a way of taking current time information into account in the evaluation.

Field Data type Description
selectedDays Array Selected days as a string array.
startTime Number Start time as Unix timestamp.
endTime Number End time as Unix timestamp.
timerType String Timer Type to define how the parameters are evaluated.

The “timerType” field is used to determine what type of timer is involved. The following types are possible:

Type Description
DATE Date range from startTime to endTime.
TIME Time range from startTime to endTime.
DAYS One or more days of the week.
DAYS_TIME Within a time range from startTime to endTime on one or more days of the week.

An array with the selected days can be stored in the “selectedDays” field.

Day


MONDAY


TUESDAY


WEDNESDAY


THURSDAY


FRIDAY


SATURDAY


SUNDAY


The following comparison operators are possible in the “comparator” field:

Possible comparison operators


EQUAL


NOT_EQUAL


Code examples
TimeConditionDTO 1
{
"type": "TIME",
"position": 4,
"comparator": "EQUAL",
"selectedDays": [
"MONDAY",
"TUESDAY"
],
"startTime": 1705069046,
"endTime": 1705151846,
"timerType": "DAYS_TIME"
}
TimeConditionDTO 2
{
"type": "TIME",
"position": 4,
"comparator": "EQUAL",
"startTime": 1705070352,
"endTime": 1705153152,
"timerType": "TIME"
}

Channel conditions are used to check a channel value. Each specialization has its own fields for defining the check value and a list of possible comparison operators

Field Data type Description
thingId String Unique device ID
channelId String Unique (related to the device) channel ID
smartCheck Boolean Intelligent check. Prevents multiple evaluation as true until the check value has been evaluated as false again.

Checks the (string) state of a channel.

Field Data type Description
state String The state which is compared with the current channel value.

The following comparison operators are possible in the “comparator” field:

Possible comparison operators


EQUAL


NOT_EQUAL


Code examples
StateChannelConditionDTO
{
"type": "STATE",
"position": 0,
"comparator": "NOT_EQUAL",
"thingId": "d5da720e-2ad6-4c86-88c0-f84390f76570",
"channelId": "WindowHandle",
"smartCheck": true,
"state": "CLOSED"
}

Checks the numerical value of a channel.

Field Data type Description
value Number The value that is compared with the current channel value.

The following comparison operators are possible in the “comparator” field:

Possible comparison operators


EQUAL


NOT_EQUAL


GREATER


GREATER_EQUAL


SMALLER


SMALLER_EQUAL


Code examples
ValueChannelConditionDTO
{
"type": "VALUE",
"position": 1,
"comparator": "SMALLER",
"thingId": "f5a69feb-59f0-4a44-a243-d2420c84f562",
"channelId": "Dimmer",
"smartCheck": false,
"value": 30.0
}