IoT Export
IoT Core Data Model

IoT Logic Core

57min
description the iot logic core provides a data model and commands for scenes, rules and associated links 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 connectiondto 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" } connectiondeleteddto field data type description id string unique id of the device in the system code examples connectiondeleteddto { "id" "2d46cc1b 5780 4d4e b5de 293ec346d6b7" } scenes scenes are required to switch devices or trigger actions these contain preconfigured values for devices or actions to be triggered executorcollectiondto 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" } ] } executorcollectiondeleteddto field data type description id string unique id of the device in the system code examples executorcollectiondeleteddto { "id" "2d46cc1b 5780 4d4e b5de 293ec346d6b7" } executor 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 executors with the same value for the position may be executed in a different order the "type" field is used to specify the type of executor the following types are possible type executor delay iot logic core docid\ khqqklgdjkioaqd8w kdf loop iot logic core docid\ khqqklgdjkioaqd8w kdf message iot logic core docid\ khqqklgdjkioaqd8w kdf url iot logic core docid\ khqqklgdjkioaqd8w kdf parameter iot logic core docid\ khqqklgdjkioaqd8w kdf random iot logic core docid\ khqqklgdjkioaqd8w kdf state iot logic core docid\ khqqklgdjkioaqd8w kdf state toggle iot logic core docid\ khqqklgdjkioaqd8w kdf value iot logic core docid\ khqqklgdjkioaqd8w kdf increase decrease iot logic core docid\ khqqklgdjkioaqd8w kdf fade to iot logic core docid\ khqqklgdjkioaqd8w kdf fade from to iot logic core docid\ khqqklgdjkioaqd8w kdf link iot logic core docid\ khqqklgdjkioaqd8w kdf delayexecutordto 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 } loopexecutordto 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 } messageexecutordto 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 users must be created locally on the gateway please note that the spelling is case sensitive 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 " } urlexecutordto 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 } thing executor 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 parameterexecutordto 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" } } channel executor 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 linkexecutordto 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" } randomexecutordto 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" } statetoggleexecutordto 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" ] } stateexecutordto 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" } channel value executor 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 variable names may only consist of letters and not of the above operators or function names 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" } } valueexecutordto 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 fadefromtoexecutordto 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 } } fadetoexecutordto 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 } indecreaseexecutordto 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 rules can be used to define triggers for scenes the evaluation is carried out sequentially in order, taking into account the "position" field conditioncollectiondto 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 a conditioncollection object can also be used as a condition this is helpful for a nested evaluation with possibly complex blocks 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 } ] } ] } conditioncollectiondeleteddto field data type description id string unique id of the device in the system code examples conditioncollectiondeleteddto { "id" "e37b6aee 2e35 4b64 82a5 8dd7a822e861" } condition 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 iot logic core docid\ khqqklgdjkioaqd8w kdf operator iot logic core docid\ khqqklgdjkioaqd8w kdf time iot logic core docid\ khqqklgdjkioaqd8w kdf state iot logic core docid\ khqqklgdjkioaqd8w kdf value iot logic core docid\ khqqklgdjkioaqd8w kdf conditionoperatordto 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 if there are several conditions in a conditioncollection, these can be linked with a conditionoperator the "position" field of the conditions must be filled correctly if there is no conditionoperator between two conditions, an and comparison is automatically performed the "position" field is decisive for the sequence code examples conditionoperatordto { "type" "operator", "position" 0, "comparator" "or" } time condition a time condition is a way of taking current time information into account in the evaluation timeconditiondto 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 condition 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 statechannelconditiondto 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" } valuechannelconditiondto 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 }