Skip to main content

Plugin - simple-api

Api

Git: https://github.com/ioBroker/plugin-sentry#plugin-sentry

Einstellungen

image2021-3-20_9-5-49.png

Hilfe

Abfrage der Hilfe der API

curl http://localhost:8087/help
 
Ergebnis:
{
  "getPlainValue": "http://localhost:8087/getPlainValue/stateID",
  "get": "http://localhost:8087/get/stateID/?prettyPrint",
  "getBulk": "http://localhost:8087/getBulk/stateID1,stateID2/?prettyPrint",
  "set": "http://localhost:8087/set/stateID?value=1&prettyPrint",
  "toggle": "http://localhost:8087/toggle/stateID&prettyPrint",
  "setBulk": "http://localhost:8087/setBulk?stateID1=0.7&stateID2=0&prettyPrint",
  "setValueFromBody": "http://localhost:8087/setValueFromBody?stateID1",
  "objects": "http://localhost:8087/objects?pattern=system.adapter.admin.0*&prettyPrint",
  "states": "http://localhost:8087/states?pattern=system.adapter.admin.0*&prettyPrint",
  "search": "http://localhost:8087/search?pattern=system.adapter.admin.0*&prettyPrint",
  "query": "http://localhost:8087/query/stateID1,stateID2/?dateFrom=2019-06-06T12:00:00.000Z&dateTo=2019-06-06T12:00:00.000Z&noHistory=false&prettyPrint"
}

getPlainValue

curl http://localhost:8087/getPlainValue/deconz.0.Sensors.15.temperature
 
Ergebnis:
20.59

get - prettyPrint

curl http://localhost:8087/get/deconz.0.Sensors.15.temperature/?prettyPrint
 
Ergebnis:
{
  "val": 20.59,
  "ack": true,
  "ts": 1613737541321,
  "q": 0,
  "from": "system.adapter.deconz.0",
  "user": "system.user.admin",
  "lc": 1616225858957,
  "type": "state",
  "common": {
    "name": "Temperature 15 temperature",
    "type": "number",
    "role": "value.temperature",
    "read": true,
    "write": false,
    "unit": "°C",
    "def": 0,
    "custom": {
      "influxdb.0": {
        "enabled": true,
        "changesOnly": true,
        "debounce": "1000",
        "retention": "31536000",
        "changesRelogInterval": 0,
        "changesMinDelta": 0,
        "storageType": "",
        "aliasId": ""
      }
    }
  },
  "native": {},
  "_id": "deconz.0.Sensors.15.temperature",
  "acl": {
    "object": 1636,
    "state": 1636,
    "owner": "system.user.admin",
    "ownerGroup": "system.group.administrator"
  }
}