ezeio2:apiref:subscribe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ezeio2:apiref:subscribe [2021-01-28 20:45] andrehezeio2:apiref:subscribe [2021-01-28 23:49] (current) andreh
Line 11: Line 11:
  
 Subsequent calls using the subscribe command are used to manage the data stream. Subsequent calls using the subscribe command are used to manage the data stream.
 +
 +<WRAP center round important 60%>
 +This functionality requires firmware 21012701 or later in the device.
 +</WRAP>
 +
  
 === Parameters === === Parameters ===
Line 114: Line 119:
 <code javascript> <code javascript>
 { {
-  "channel": "export:2",+  "channel": "export:123",
   "data": {   "data": {
     "type": "STATUS",     "type": "STATUS",
Line 130: Line 135:
 } }
 </code> </code>
 +Note that the fields array will include all configured fields for this unit - regardless of their log setting. All fields are always logged every 10 minutes.
  
 A ''LOGDATA'' update has the following format (whitespace added for readability): A ''LOGDATA'' update has the following format (whitespace added for readability):
 <code javascript> <code javascript>
 { {
-  "channel": "export:2",+  "channel": "export:123",
   "data": {   "data": {
     "type": "LOGDATA",     "type": "LOGDATA",
Line 141: Line 147:
     "timeout": 0,     "timeout": 0,
     "fields": [     "fields": [
-      { 
-        "1": 73.3 
-      }, 
       {       {
         "2": 9.021         "2": 9.021
Line 151: Line 154:
 } }
 </code> </code>
 +Note that this message only includes the fields that are configured for fast logging (interval less than 10 minutes). Please see below for the meaning of the ''timeout'' property.
  
 **Step 3 : Request subscription changes** **Step 3 : Request subscription changes**
Line 167: Line 171:
 Up to 50 devices can be included in the same command Up to 50 devices can be included in the same command
  
-=== Example code (PHP) ===+=== Example code to set up the websocket channel and receive data (PHP) ===
 <code php> <code php>
 <?php <?php
  • ezeio2/apiref/subscribe.1611866734.txt.gz
  • Last modified: 2021-01-28 20:45
  • by andreh