<< Click to Display Table of Contents >> Navigation: The API > JSON API > Real Time Communication > From Gateway to Client: Streaming API > Streaming message types |
Overview
There are for the moment (V 1.0) two types of messages that will be sent over the streaming API
States
When connecting to the streaming API, the gateway will deliver at first the states of all the devices that have the flag "TransmitOnConnect" activated. This flag can be found in the administration User Interface when editing the devices.
{
"header" : {
"httpStatus" : 200,
"content" : "states",
"timestamp" : "2015-09-25T17:02:33.967+0200"
},
"states" : [ {
"deviceId" : "01872C13",
"friendlyId" : "Afriso_CO2_Messer_A5-09-08",
"physicalDevice" : "Afriso_CO2_Messer_A5-09-08",
"functions" : [ {
"key" : "co2",
"value" : "643.14",
"unit" : "ppm",
"timestamp" : "2015-09-25T17:00:16.036+0200",
"age" : "137932"
} ]
}, ]
}
Telegrams
After the states, the connection will be held open and depending on the direction parameter, the subsequent telegrams will be transmitted over the stream.
{
"header" : {
"content" : "telegram",
"timestamp" : "2015-10-12T16:25:27.220+0200"
},
"telegram" : {
"deviceId" : "FEFC8ED5",
"friendlyId" : "TESTIOFI",
"timestamp" : "2015-10-12T16:25:27.220+0200",
"direction" : "from",
"functions" : [ {
"key" : "buttonBI",
"value" : "1",
"valueKey" : "pressed",
"meaning" : "Button pressed"
} ],
"telegramInfo" : {
"data" : "50",
"status" : "30",
"dbm" : -88,
"rorg" : "F6"
}
}
}