GET /devices/states

<< Click to Display Table of Contents >>

Navigation:  The API > JSON API > REST Resources > Devices > GET >

GET /devices/states

Overview

Get last saved states of known devices, depending on transmit settings in webinterface

 

 

Last function states of all known devices

Client to Gateway:

Resource Path

HTTP method

/devices/states

GET

 

response Gateway to Client:

parameter

datatype

value / formatting

description

header

object

{}

 

states

array of objects

[{}]

 

 

deviceId

string

4 byte hex value

SenderID of Enocean device, EnOcean modules usually send telegrams with their unique 32-bit Chip ID. In the other case, these are the Base ID of the EnOcean device.

 

friendlyId

string

 

User-assigned name of EnOcean device. Must be unique.

 

physicalDevice

(optional)

string

 

User-assigned name to group actuators and sensors.

 

functions

array of objects

[{}]

 

 

key

string

 

Technical key of function.

 

channel
(optional)

integer

 

Channel if supported by this device.

 

value

string / integer 

 

Value of the function.

 

unit
(optional)

string

[unit]

Unit ISO.

 

meaning
(optional)

string

 

Description of value in English.

 

timestamp

string

yyyy-mm-ddT hh:mm:ss.sss+ hhmm

Timestamp function value was received in case of last state functions.

 

age

integer

 

Age of function value in case of last state functions in milli seconds.

 

Example:

Here we see the actual state of our example device. As you can see, the gateway stored all function states received in different telegrams. Because of that, the age of the functions are varying.

Basic structure of gateway response:

 

http://hostname:api_port/devices/states
 
{
  "header" : {
    "httpStatus" : 200,
    "content" : "states",
    "gateway" : "DC-GW/EO-IP v0.99.0",
    "timestamp" : "2016-05-04T09:54:48.651+0200"
  },
  "states" : [ {
    "deviceId" : "0190A078",
    "friendlyId" : "multiFuncAlphaEos",
    "physicalDevice" : "sense-tfh",
    "functions" : [ {
      "key" : "humidity",
      "value" : 29.20,
      "unit" : "%",
      "timestamp" : "2016-05-04T09:53:55.365+0200",
      "age" : 53286
    }, {
      "key" : "illumination",
      "value" : 1411.76,
      "unit" : "lx",
      "timestamp" : "2016-05-04T09:53:55.365+0200",
      "age" : 53286
    }, {
      "key" : "temperature",
      "value" : 25.28,
      "unit" : "°C",
      "timestamp" : "2016-05-04T09:53:55.365+0200",
      "age" : 53286
    } ]
  }, {
    "deviceId" : "01842329",
    "friendlyId" : "WeatherStation",
    "functions" : [ {
      "key" : "dawnSensor",
      "value" : 999.00,
      "unit" : "lx",
      "timestamp" : "2016-05-04T09:46:05.929+0200",
      "age" : 522722
    }, {
      "key" : "dayNight",
      "value" : "day",
      "meaning" : "Day",
      "timestamp" : "2016-05-04T09:46:05.929+0200",
      "age" : 522722
    }, {
      "key" : "hemisphere",
      "value" : "north",
      "meaning" : "North",
      "timestamp" : "2016-05-04T09:46:05.730+0200",
      "age" : 522921
    }, {
      "key" : "rainIndication",
      "value" : "noRain",
      "meaning" : "No rain",
      "timestamp" : "2016-05-04T09:46:05.929+0200",
      "age" : 522722
    }, {
      "key" : "sunEast",
      "value" : 1764.71,
      "unit" : "lx",
      "timestamp" : "2016-05-04T09:46:05.730+0200",
      "age" : 522921
    }, {
      "key" : "sunSouth",
      "value" : 1764.71,
      "unit" : "lx",
      "timestamp" : "2016-05-04T09:46:05.730+0200",
      "age" : 522921
    }, {
      "key" : "sunWest",
      "value" : 588.24,
      "unit" : "lx",
      "timestamp" : "2016-05-04T09:46:05.730+0200",
      "age" : 522922
    }, {
      "key" : "temperature",
      "value" : 24.94,
      "unit" : "°C",
      "timestamp" : "2016-05-04T09:46:05.929+0200",
      "age" : 522723
    }, {
      "key" : "windSpeed",
      "value" : 0.00,
      "unit" : "m/s",
      "timestamp" : "2016-05-04T09:46:05.929+0200",
      "age" : 522723
    } ]
  }, {
    "deviceId" : "FFC5B701",
    "friendlyId" : "peha2ChannelActuator",
    "functions" : [ {
      "key" : "errorLevel",
      "value" : "notSupported",
      "meaning" : "Error level not supported",
      "timestamp" : "2016-05-04T09:41:35.672+0200",
      "age" : 792980
    }, {
      "key" : "localControl",
      "value" : "on",
      "meaning" : "Local control enabled",
      "timestamp" : "2016-05-04T09:41:35.672+0200",
      "age" : 792980
    }, {
      "key" : "overcurrentSwitchOff",
      "value" : "false",
      "meaning" : "Over current switch off: ready / not supported",
      "timestamp" : "2016-05-04T09:41:35.672+0200",
      "age" : 792980
    }, {
      "key" : "switch",
      "value" : "on",
      "meaning" : "Output value ON",
      "timestamp" : "2016-05-04T09:41:35.672+0200",
      "age" : 792980
    } ]
  } ]
}