Generic REST Server
Einleitung
Abschnitt betitelt „Einleitung“Das Export Modul “Generic REST Server” stellt einen REST Service per HTTP sowie HTTPS unter Verwendung des Generic IoT Datenmodell bereit.
Es handelt sich hierbei um ein “Single Service” Modul, somit kann nur eine Exportinstanz angelegt werden.
Konfiguration
Abschnitt betitelt „Konfiguration“Das Modul kann über den Bereich “IoT Export” in der Webkonfiguration oder der BSC Remote aktiviert und der “x-api-key” hinterlegt werden.
Zugriff
Abschnitt betitelt „Zugriff“Der Service wird unter folgender URL bereitgestellt:
https://<IP des Gerätes>/iot/export/generic/things
Api Schutz
Abschnitt betitelt „Api Schutz“Bei der Aktivierung des Moduls kann ein “x-api-key” konfiguriert werden. Dieser ist standardmäßig mit einem zufälligen String befüllt.
Wird ein leerer String hinterlegt ist der Zugriff nicht geschützt.
Ansonsten muss der dort hinterlegte Key bei jeder Anfrage im Headerfeld “x-api-key” mitgesendet werden.
Endpunkte
Abschnitt betitelt „Endpunkte“Einstiegspunkt ist der /things Endpunkt. Dort werden alle Geräte mit detailierten Informationen aufgelistet.
Die weiteren Endpunkte dienen dazu, gezielt bestimmte Informationen eines Gerätes auszulesen oder auch eine Wertänderung vorzunehmen.
Alle Geräte abrufen
Abschnitt betitelt „Alle Geräte abrufen“Abrufen einer Liste aller verfügbaren Geräte Objekte
Code examples
curl --location --request GET 'https://<IP>/iot/export/generic/things' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<IP>/iot/export/generic/things', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<IP>/iot/export/generic/things", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<IP>/iot/export/generic/things"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<IP>/iot/export/generic/things")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
[{ "id": "b9f09ef8-3c3f-459e-841f-66bdaedff183", "name": "FSB14", "channelGroups": [{ "channelGroupId": "Sensor Group", "channelDescriptionData": null, "channels": [{ "channelId": "Jalousie", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" } }, "value": "0.0", "valueDescriptionData": { "valueType": "NUMBER_DOUBLE", "unit": "%", "min": 0.0, "max": 100.0, "stepping": 1.0, "decimalPartDigits": 1, "possibleValues": null }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Jalousie", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Jalousie", "TSYSTEMS->type": "value" } }, { "channelId": "JalousieState", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" } }, "value": "UNKNOWN", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "UP": { "de_DE": "Herauf", "en_US": "up" }, "DOWN": { "de_DE": "Herunter", "en_US": "down" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#JalousieState", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "false", "MESSAGE->ENABLED": "false", "Sensor.Name": "Direction", "TSYSTEMS->type": "state" } }, { "channelId": "Priority", "channelDescriptionData": { "channelTypeEnum": "SWITCH", "label": { "de_DE": "Priorität", "en_US": "priority" } }, "value": "OFF", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "ON": { "de_DE": "An", "en_US": "on" }, "OFF": { "de_DE": "Aus", "en_US": "off" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Priority", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Priority", "TSYSTEMS->type": "state" } }, { "channelId": "JalousieSlat", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie (Lamellen)", "en_US": "shutters (slats)" } }, "value": "UNKNOWN", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "UP": { "de_DE": "Herauf", "en_US": "up" }, "DOWN": { "de_DE": "Herunter", "en_US": "down" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#JalousieSlat", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "JalousieSlat", "TSYSTEMS->type": "state" } }] }], "state": "ONLINE", "parameterGroups": null, "metaInfos": { "ALEXA->ALEXA_LIVE_UPDATES": "false", "MONITORING->MONITORABLE": "true", "TEACHIN->GROUP_DISPLAYNAME": "Test", "BSC->SHORT_INFO": "FSB14", "METAINFO->id": "ADevice#b9f09ef8-3c3f-459e-841f-66bdaedff183", "TEACHIN->REFERENCE_ID": "enocean.eltako.fsb14", "EOAP->ACTIVATED": "true", "TEACHIN->TRANSMISSION_ID": "default=4291820288", "lastModified": "1636489756075", "EOAP->ALARM": "false" }}, { "id": "97229120-d93b-41c6-9bf3-5a41cfcadb38", "name": "fsr", "channelGroups": [{ "channelGroupId": "Sensor Group", "channelDescriptionData": null, "channels": [{ "channelId": "Switch", "channelDescriptionData": { "channelTypeEnum": "SWITCH", "label": { "de_DE": "Schalter", "en_US": "switch" } }, "value": "UNKNOWN", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "ON": { "de_DE": "An", "en_US": "on" }, "OFF": { "de_DE": "Aus", "en_US": "off" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#97229120-d93b-41c6-9bf3-5a41cfcadb38#Switch", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "On", "TSYSTEMS->type": "state" } }, { "channelId": "Priority", "channelDescriptionData": { "channelTypeEnum": "SWITCH", "label": { "de_DE": "Priorität", "en_US": "priority" } }, "value": "OFF", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "ON": { "de_DE": "An", "en_US": "on" }, "OFF": { "de_DE": "Aus", "en_US": "off" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#97229120-d93b-41c6-9bf3-5a41cfcadb38#Priority", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Priority", "TSYSTEMS->type": "state" } }] }], "state": "ONLINE", "parameterGroups": null, "metaInfos": { "ALEXA->ALEXA_LIVE_UPDATES": "false", "MONITORING->MONITORABLE": "true", "TEACHIN->GROUP_DISPLAYNAME": "test2", "BSC->SHORT_INFO": "fsr", "METAINFO->id": "ADevice#97229120-d93b-41c6-9bf3-5a41cfcadb38", "TEACHIN->REFERENCE_ID": "enocean.eltako.fsr14", "EOAP->ACTIVATED": "true", "TEACHIN->TRANSMISSION_ID": "default=4291820289", "lastModified": "1636489753561", "EOAP->ALARM": "false" }}]Ein einzelnes Gerät abrufen
Abschnitt betitelt „Ein einzelnes Gerät abrufen“Abrufen eines einzelnen Geräte Objektes anhand seiner ID.
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "id": "b9f09ef8-3c3f-459e-841f-66bdaedff183", "name": "FSB14", "channelGroups": [{ "channelGroupId": "Sensor Group", "channelDescriptionData": null, "channels": [{ "channelId": "Jalousie", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" } }, "value": "0.0", "valueDescriptionData": { "valueType": "NUMBER_DOUBLE", "unit": "%", "min": 0.0, "max": 100.0, "stepping": 1.0, "decimalPartDigits": 1, "possibleValues": null }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Jalousie", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Jalousie", "TSYSTEMS->type": "value" } }, { "channelId": "JalousieState", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" } }, "value": "UNKNOWN", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "UP": { "de_DE": "Herauf", "en_US": "up" }, "DOWN": { "de_DE": "Herunter", "en_US": "down" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#JalousieState", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "false", "MESSAGE->ENABLED": "false", "Sensor.Name": "Direction", "TSYSTEMS->type": "state" } }, { "channelId": "Priority", "channelDescriptionData": { "channelTypeEnum": "SWITCH", "label": { "de_DE": "Priorität", "en_US": "priority" } }, "value": "OFF", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "ON": { "de_DE": "An", "en_US": "on" }, "OFF": { "de_DE": "Aus", "en_US": "off" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Priority", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Priority", "TSYSTEMS->type": "state" } }, { "channelId": "JalousieSlat", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie (Lamellen)", "en_US": "shutters (slats)" } }, "value": "UNKNOWN", "valueDescriptionData": { "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "UP": { "de_DE": "Herauf", "en_US": "up" }, "DOWN": { "de_DE": "Herunter", "en_US": "down" } } }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#JalousieSlat", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "JalousieSlat", "TSYSTEMS->type": "state" } }] }], "state": "ONLINE", "parameterGroups": null, "metaInfos": { "ALEXA->ALEXA_LIVE_UPDATES": "false", "MONITORING->MONITORABLE": "true", "TEACHIN->GROUP_DISPLAYNAME": "Test", "BSC->SHORT_INFO": "FSB14", "METAINFO->id": "ADevice#b9f09ef8-3c3f-459e-841f-66bdaedff183", "TEACHIN->REFERENCE_ID": "enocean.eltako.fsb14", "EOAP->ACTIVATED": "true", "TEACHIN->TRANSMISSION_ID": "default=4291820288", "lastModified": "1636489756075", "EOAP->ALARM": "false" }}Gerätestatus abfragen
Abschnitt betitelt „Gerätestatus abfragen“Abrufen des aktuellen Verbindungsstatus anhand einer Geräte ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/state' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/state', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/state", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/state}"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/state")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "state":"Online"}Meta Inforamationen abfragen
Abschnitt betitelt „Meta Inforamationen abfragen“Abrufen der Meta Informationen eines Gerätes anhand seiner ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/metaInfos' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/metaInfos', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/metaInfos", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/metaInfos}"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/metaInfos")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "ALEXA->ALEXA_LIVE_UPDATES": "false", "MONITORING->MONITORABLE": "true", "TEACHIN->GROUP_DISPLAYNAME": "Test", "BSC->SHORT_INFO": "FSB14", "METAINFO->id": "ADevice#b9f09ef8-3c3f-459e-841f-66bdaedff183", "TEACHIN->REFERENCE_ID": "enocean.eltako.fsb14", "EOAP->ACTIVATED": "true", "TEACHIN->TRANSMISSION_ID": "default=4291820288", "lastModified": "1636489756075", "EOAP->ALARM": "false"}Daten Objekt eines Kanals abfragen
Abschnitt betitelt „Daten Objekt eines Kanals abfragen“Abrufen des Kanalobjektes anhand der Geräte und Kanal ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "channelId": "Jalousie", "channelDescriptionData": { "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" } }, "value": "0.0", "valueDescriptionData": { "valueType": "NUMBER_DOUBLE", "unit": "%", "min": 0.0, "max": 100.0, "stepping": 1.0, "decimalPartDigits": 1, "possibleValues": null }, "writeable": false, "metaInfos": { "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Jalousie", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Jalousie", "TSYSTEMS->type": "value" }}Aktuellen Wert eines Kanals abfragen
Abschnitt betitelt „Aktuellen Wert eines Kanals abfragen“Abrufen des aktuellen Kanal Wertes anhand der Geräte und Kanal ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "value": "0.0"}Aktuellen Wert eines Kanals setzen
Abschnitt betitelt „Aktuellen Wert eines Kanals setzen“Setzt den Wert des über die Geräte und Kanal ID angegebenen Kanals
Code examples
curl --location -g --request POST 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value/set' \--header 'Accept: application/json' \--data-raw '{newValue}'var request = require('request');var options = { 'method': 'POST', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value/set', 'headers': { 'Accept': 'application/json' }, body: '{newValue}'
};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var raw = "{newValue}";var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value/set", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value/set"payload = "{newValue}"headers = { 'Accept': 'application/json'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/value/set")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Post.new(url)request["Accept"] = "application/json"request.body = "{newValue}"
response = https.request(request)puts response.read_bodyResponses
Abschnitt betitelt „Responses“Die Meta Informationen eines Kanals abfragen
Abschnitt betitelt „Die Meta Informationen eines Kanals abfragen“Abrufen der Meta Informationen eines Kanals anhand der Geräte und Kanal ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/metaInfos' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/metaInfos', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/metaInfos", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/metaInfos"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/metaInfos")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "METAINFO->id": "ASensor#b9f09ef8-3c3f-459e-841f-66bdaedff183#Jalousie", "MESSAGE->COUNT": "0", "EOAP->CHANGEABLE": "true", "MESSAGE->ENABLED": "false", "Sensor.Name": "Jalousie", "TSYSTEMS->type": "value"}Die Wertebeschreibung eines Kanals abfragen
Abschnitt betitelt „Die Wertebeschreibung eines Kanals abfragen“Abrufen der Wertebeschreibung eines Kanals anhand der Geräte und Kanal ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/valueDescriptionData' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/valueDescriptionData', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/valueDescriptionData", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/valueDescriptionData"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/valueDescriptionData")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
// Value{ "valueType": "NUMBER_DOUBLE", "unit": "%", "min": 0.0, "max": 100.0, "stepping": 1.0, "decimalPartDigits": 1, "possibleValues": null}
// State{ "valueType": "STATE", "unit": null, "min": null, "max": null, "stepping": null, "decimalPartDigits": null, "possibleValues": { "UNKNOWN": { "de_DE": "Unbekannt", "en_US": "unknown" }, "ON": { "de_DE": "An", "en_US": "on" }, "OFF": { "de_DE": "Aus", "en_US": "off" } }}Eine Kanalbeschreibung abfragen
Abschnitt betitelt „Eine Kanalbeschreibung abfragen“Abrufen der Kanalbeschreibung anhand der Geräte und Kanal ID
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/channelDescriptionData' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/channelDescriptionData', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/channelDescriptionData", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/channelDescriptionData"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/channelDescriptionData")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "channelTypeEnum": "SHADING", "label": { "de_DE": "Jalousie", "en_US": "shutters" }}Abfragen ob ein Kanal beschreibbar ist
Abschnitt betitelt „Abfragen ob ein Kanal beschreibbar ist“Abfragen ob der Wert eines Kanals geändert werden kann
Code examples
curl --location -g --request GET 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/writable' \--header 'Accept: application/json'var request = require('request');var options = { 'method': 'GET', 'url': 'https://<ip>/iot/export/generic/things/{thingId}/{channelId}/writable', 'headers': { 'Accept': 'application/json' }};request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body);});var myHeaders = new Headers();myHeaders.append("Accept", "application/json");var requestOptions = { method: 'GET', headers: myHeaders, redirect: 'follow'};fetch("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/writable", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));import requestsurl = "https://<ip>/iot/export/generic/things/{thingId}/{channelId}/writable"payload={}headers = { 'Accept': 'application/json'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)require "uri"require "net/http"
url = URI("https://<ip>/iot/export/generic/things/{thingId}/{channelId}/writable")https = Net::HTTP.new(url.host, url.port)https.use_ssl = true
request = Net::HTTP::Get.new(url)request["Accept"] = "application/json"
response = https.request(request)puts response.read_bodyResponses
{ "writable": false}