JSON API

<< Click to Display Table of Contents >>

Navigation:  API Connectors/Client Side > Examples for sending commands > Permundo actuator PSC 234 >

JSON API

Sending Telegrams:

 

To send out a telegram to the actuator, you have to send the following commands over the API:

 

To turn the actuator on:

PUT /devices/{eepid}/state
{
  "state" : {
    "functions" : [ 
    {
      "key" : "dimValue",
      "value" : "100"
    },
    {
      "key" : "rampingMode",
      "value" : "0"
    } 
   ]
  } 

 

To turn the actuator off:

PUT /devices/{eepid}/state
{
  "state" : {
    "functions" : [ 
    {
      "key" : "dimValue",
      "value" : "0"
    },
    {
      "key" : "rampingMode",
      "value" : "0"
    } 
   ]
  } 

 

 

Sending Telegrams using the "default" option:

 

if you look at the profile D2-01-09 (JSON, PDF, html), you can see that the parameter "rampingMode" has a default value of 0/switch. If you dont´set the parameter, the default value will be used instead. A valid command to the gateway is then also:

 

PUT /devices/0191388F/state
{
  "state" : {
    "functions" : [ 
    {
      "key" : "dimValue",
      "value" : "100"
    }
   ]
  } 

 

To turn the actuator off:

PUT /devices/0191388F/state
{
  "state" : {
    "functions" : [ 
    {
      "key" : "dimValue",
      "value" : "0"
    }
   ]
  } 

 

 

Receiving Telegrams:

Telegrams sent from the device to the gateway produce a event on the API which looks like this:

 

Actutator has been switched off:

{
  "header" : {
    "content" : "telegram",
    "timestamp" : "2015-10-29T16:57:59.593+0100"
  },
  "telegram" : {
    "deviceId" : "0191388F",
    "friendlyId" : "PSC234",
    "timestamp" : "2015-10-29T16:57:59.593+0100",
    "direction" : "from",
    "functions" : [ {
      "key" : "dimValue",
      "value" : "0",
      "valueKey" : "off",
      "meaning" : "Output value 0% or OFF"
    } ],
    "telegramInfo" : {
      "data" : "046080",
      "status" : "0",
      "dbm" : -80,
      "rorg" : "D2"
    }
  }
}

 

 

Actuator has been switched on:

{
  "header" : {
    "content" : "telegram",
    "timestamp" : "2015-10-29T16:58:56.764+0100"
  },
  "telegram" : {
    "deviceId" : "0191388F",
    "friendlyId" : "PSC234",
    "timestamp" : "2015-10-29T16:58:56.764+0100",
    "direction" : "from",
    "functions" : [ {
      "key" : "dimValue",
      "value" : "100",
      "valueKey" : "on",
      "meaning" : "Output value 1% to 100% or ON",
      "unit" : "%"
    } ],
    "telegramInfo" : {
      "data" : "0460E4",
      "status" : "0",
      "dbm" : -85,
      "rorg" : "D2"
    }
  }
}