IoT Export
IoT Core Datenmodell
IoT Logic Core
56 min
beschreibung der iot logic core stellt ein datenmodell und kommandos für szenen, regeln und dazugehörige verknüpfungen bereit verknüpfungen über verknüpfungen werden n\ n verbindungen zwischen regeln und szenen geschaffen regeln dienen hierbei als trigger für die auslösung über die verknüpfungen wird aufgelöst, welche szenen auszuführen sind connectiondto feld datentype beschreibung id string id zur eindeutigen identifizierung im system name string der zugewiesene name description string die zugewiesene beschreibung active boolean angabe ob die verknüpfung aktiviert ist conditioncollectionid string angabe der id einer regel executorcollectionid string angabe der id einer szene codebeispiele 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 feld datentype beschreibung id string eindeutige id des gerätes im system codebeispiele connectiondeleteddto { "id" "2d46cc1b 5780 4d4e b5de 293ec346d6b7" } szenen um geräte zu schalten oder aktionen auszulösen, werden szenen benötigt diese enthalten vorkonfigurierte werte für geräte oder auszulösende aktionen executorcollectiondto szenen werden durch einen container abgebildet jede szene wird durch einen container repräsentiert ein solcher container enthält im feld "executors" eine liste von befehlen, die ausgeführt werden sollen feld datentype beschreibung id string id zur eindeutigen identifizierung im system name string der zugewiesene name description string die zugewiesene beschreibung executors array ein array von executor objekten codebeispiele 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 feld datentype beschreibung id string eindeutige id des gerätes im system codebeispiele executorcollectiondeleteddto { "id" "2d46cc1b 5780 4d4e b5de 293ec346d6b7" } executor allgemeine funktionen werden als executor bezeichnet diese sind unabhängig von geräten oder kanälen zur steuerung des ausführungsverhaltens einer szene kann der delay und loop executor genutzt werden feld datentype beschreibung type string angabe des executortyps position number die position bestimmt die reihenfolge der ausführung executoren mit dem gleichen wert für die position werden gegebenenfalls in unterschiedlicher reihenfolge ausgeführt über das feld "type" wird angegeben, um was für eine art von executor es sich handelt folgende typen sind möglich type executor delay iot logic core /#delayexecutordto loop iot logic core /#loopexecutordto message iot logic core /#messageexecutordto url iot logic core /#urlexecutordto parameter iot logic core /#parameterexecutordto random iot logic core /#randomexecutordto state iot logic core /#stateexecutordto state toggle iot logic core /#statetoggleexecutordto value iot logic core docid 1fyvqpaz8z hjilszqtdo increase decrease iot logic core /#indecreaseexecutordto fade to iot logic core /#fadetoexecutordto fade from to iot logic core /#fadefromtoexecutordto link iot logic core docid 1fyvqpaz8z hjilszqtdo delayexecutordto erzeugt eine verzögerung während der ausführung einer szene feld datentyp beschreibung delay number verzögerung in millisekunden codebeispiele delayexecutordto { "position" 4, "type" "delay", "delay" 5000 } loopexecutordto steuerelement für die wiederholung der szene feld datentyp beschreibung loop number ein wert kleiner als 0 deaktiviert die loop funktion der wert 0 bewirkt eine unendliche wiederholung der ausführung ein wert größer als 0 gibt an wie oft die ausführung wiederholt wird codebeispiele loopexecutordto { "position" 1, "type" "loop", "loop" 3 } messageexecutordto nachricht per e mail / push an die angegebenen benutzer versenden true false 151false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type die benutzer müssen lokal am gateway angelegt sein bitte achten sie bei der schreibweise auf groß und kleinschreibung folgende nachrichten typen können im feld "messagetype" verwendet werden true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele messageexecutordto { "position" 0, "type" "message", "messagetype" "notification", "recipients" \[ "user1", "user2" ], "message" "gateway will be shutdown in 30 minutes " } urlexecutordto aufruf einer benutzerdefinierten url true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele urlexecutordto { "position" 1, "type" "url", "url" "https //192 168 0 12 8080/info html", "user" "user", "password" "passw\@rd", "ignorecert" true } thing executor ein thing executor bezieht sich immer auf die steuerung eines geräts und benötigt dazu die geräte id true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type parameterexecutordto setzen von einem oder mehreren geräteparametern true false 138false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele parameterexecutordto { "position" 0, "type" "parameter", "thingid" "f5a69feb 59f0 4a44 a243 d2420c84f562", "parameters" { "8d4b49e26fb8a194a7ccb05dc0bb507a" "on", "cf97094fdca80778221d783811e0a573" "10 3" } } channel executor der channel executor steuert einzelne kanäle eines gerätes daher werden die geräte id sowie die kanal id benötigt true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type linkexecutordto wert/status von einem anderen kanal eines gerätes nutzen true false 156false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type codebeispiele linkexecutordto { "position" 0, "type" "link", "thingid" "91905b50 bf83 4584 a14b d4c2800cec1e", "channelid" "dimmer", "foreignthingid" "f5a69feb 59f0 4a44 a243 d2420c84f562", "foreignchannelid" "dimmer" } randomexecutordto stellt einen zufälligen wert oder state innerhalb des gültigen wertebereichs ein codebeispiele randomexecutordto { "position" 0, "type" "random", "thingid" "91905b50 bf83 4584 a14b d4c2800cec1e", "channelid" "dimmer" } statetoggleexecutordto schaltet zwischen angegebenen states hin und her true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele 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 setzt den state eines kanals auf den angebenen wert true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele stateexecutordto { "position" 0, "type" "state", "thingid" "dec83c14 1fdc 439b 844c 1f01d4f58194", "channelid" "switch", "state" "off" } channel value executor eine besonderheit bei zahlenwerten ist, dass diese durch ein objekt repräsentiert werden dies ermöglicht es, erweiterte funktionen für die ermittlung des eigentlichen wertes zu nutzen true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type folgende typen sind möglich true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type rawvaluedto der wert wird direkt angegeben true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele rawvaluedto { "position" 0, "type" "value", "thingid" "91905b50 bf83 4584 a14b d4c2800cec1e", "channelid" "dimmer", "value" { "type" "raw", "value" 100 0 } } calculatedvaluedto berechnung des wertes basierend auf einer formel und der definition weiterer werte als variablen true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type jedes feld des objektes repräsentiert eine variable, die in der berechnung genutzt werden kann als wert ist dort wieder ein wert container objekt hinterlegt folgende operatoren und steuerzeichen können im feld "expression" genutzt werden true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type die folgenden funktionen können im feld "expression" verwendet werden hinweis x,y können variablen oder werte sein true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type variablennamen dürfen nur aus buchstaben bestehen und nicht aus den o g operatoren oder funktionsnamen codebeispiele 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 wert von einem anderen gerät / kanal nutzen true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele 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 den zahlenwert eines kanals auf den angegebenen wert ändern der eigentliche wert wird zum prüfzeitpunkt anhand des hinterlegten wertcontainers ermittelt true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type fadefromtoexecutordto ändert einen zahlenwert innerhalb einer zeitlichen vorgabe inkrementell von einem angegebenen startwert auf den angegebenen zielwert true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele 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 ändert einen zahlenwert innerhalb einer zeitlichen vorgabe inkrementell auf den angegebenen zielwert true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele fadetoexecutordto { "position" 1, "type" "fade to", "thingid" "91905b50 bf83 4584 a14b d4c2800cec1e", "channelid" "dimmer", "to" { "type" "raw", "value" 80 0 }, "ms" 2500 } indecreaseexecutordto erhöht oder verringert den kanalwert um den angegebenen wert true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele indecreaseexecutordto { "position" 1, "type" "increase decrease", "thingid" "91905b50 bf83 4584 a14b d4c2800cec1e", "channelid" "dimmer", "value" { "type" "raw", "value" 20 0 }, "decrease" true } regeln mit hilfe von regeln können auslöser für szenen hinterlegt werden die auswertung erfolgt sequenziell in reihenfolge unter berücksichtigung des feldes "position" conditioncollectiondto eine conditioncollection repräsentiert eine regel mit einer sammlung an conditions true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type ein conditioncollection objekt kann auch als bedingung genutzt werden dies ist hilfreich für eine verschachtelte auswertung mit gegebenenfalls komplexen blöcken codebeispiele 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 true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type codebeispiele conditioncollectiondeleteddto { "id" "e37b6aee 2e35 4b64 82a5 8dd7a822e861" } condition eine condition oder bedingung dient der logischen auswertung von gerätedaten oder anderen faktoren wie beispielsweise einer prüfung der uhrzeit alle condition objekte besitzen folgende felder true false 116false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type das feld "type" gibt an um welche art von condition es sich handelt true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type conditionoperatordto ein vergleichsoperator ermöglicht es conditions logisch zu verknüpfen im feld "comparator" sind folgende vergleichsoperatoren möglich true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type sind mehrere conditions in einer conditioncollection vorhanden, können diese mit einem conditionoperator verknüpft werden dabei muss das feld "position" der conditions korrekt befüllt werden befindet sich zwischen zwei conditions kein conditionoperator, wird automatisch ein and vergleich durchgeführt das feld "position" ist hierbei ausschlaggebend für die reihenfolge codebeispiele conditionoperatordto { "type" "operator", "position" 0, "comparator" "or" } time condition eine time condition stellt eine möglichkeit dar, aktuelle zeitliche informationen bei der auswertung zu berücksichtigen timeconditiondto true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type über das feld "timertype" wird bestimmt um was für eine art von timer es sich handelt folgende typen sind möglich true false 118false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type im feld "selecteddays" kann ein array mit den ausgewählten tagen hinterlegt werden true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type im feld "comparator" sind folgende vergleichsoperatoren möglich true falsefalse left unhandled content type false left unhandled content type false left unhandled content type codebeispiele 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 dienen zur prüfung eines kanalwertes jede spezialisierung bringt besitzt eigene felder zur definition des prüfwertes und eine liste von möglichen vergleichsoperatoren true false 131false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type statechannelconditiondto prüft den (string) state eines kanals true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type im feld "comparator" sind folgende vergleichsoperatoren möglich true falsefalse left unhandled content type false left unhandled content type false left unhandled content type codebeispiele statechannelconditiondto { "type" "state", "position" 0, "comparator" "not equal", "thingid" "d5da720e 2ad6 4c86 88c0 f84390f76570", "channelid" "windowhandle", "smartcheck" true, "state" "closed" } valuechannelconditiondto prüft den zahlenwert eines kanals true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type im feld "comparator" sind folgende vergleichsoperatoren möglich true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type codebeispiele valuechannelconditiondto { "type" "value", "position" 1, "comparator" "smaller", "thingid" "f5a69feb 59f0 4a44 a243 d2420c84f562", "channelid" "dimmer", "smartcheck" false, "value" 30 0 }