This is an old revision of the document!


IoT API

You can send measured data to Mervis via several APIs. The IoT API is the most flexible one - you can define custom Levels and Tags to be used for later data processing and Mervis SCADA project generation.

{
 "controllers": [{
   "id": "AAABBBCCCDDDDDDAAAABBBSFSDFSFSFSDFSDFS",
   "name": "Mervis Av., Building A",
   "timestamp": "2019-04-18T15:58:59Z",
   "period": "PT5M",
   "variables": [{
     "id": "temperature_1",
     "name": "Temperature",
     "dataType": "float64",
     "unit": "°C",
     "values": [{
       "value": 23.0
      }
     ],
     "level_1_txt": "Area 52",
     "level_2_txt": "Building A",
     "level_3_txt": "AHU 89",
     "level_4_txt": "Floor 7",
     "level_5_txt": "Room 12"
    }, {
     "id": "relative_humidity_25",
     "name": "RelativeHumidity",
     "dataType": "float64",
     "unit": "%",
     "values": [{
       "value": 80.0
      }
     ],
     "level_1_txt": "Area 52",
     "level_2_txt": "Building A",
     "level_3_txt": "AHU 89",
     "level_4_txt": "Floor 7",
     "level_5_txt": "Room 12"
    }
   ]
  }
 ]
}
{
 "controllers": [{
   "id": "AAABBBCCCDDDDDDAAAABBBSFSDFSF",  //Unique ID that you can get from sales@mervis.info
   "name": "Mervis Av., Building A",       //User description of the site or controller
   "timestamp": "2019-04-18T15:58:59Z",    //Default timestamp of the values. May be overridden in the "Values" section
   "period": "PT5M",                       //Default sample interval. May be overridden in the "Values" section. https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
   "levels": [{                            //Levels are used to further identify data
     "id": 1,                              //Here is a list of "known" Levels that can be later
     "name": "AHU 89"                      //referenced from each variable.
    }, {
     "id": 2,
     "name": "Building A"
    }, {
     "id": 3,
     "name": "Area 52"
    }
   ],
   "variables": [{
     "id": "xxxxxxxzzzzzzz",               //Inique ID of the variable within this controller ID
     "name": "Outside temperature",        //User description of the variable
     "dataType": "float64",                //float64, string, int64, uint64, bool, datetime
     "unit": "°C",
     "values": [{                          //One or more measured value records
       "timestamp": "2019-04-18T15:55:59Z",//Overrides default timestamp
       "period": "PT10M",                  //Overrides default interval
       "value": 23.0                       //measured value of "dataType" type
      }, {
       "timestamp": "2019-04-18T15:58:59Z",
       "value": 23.2
      }
     ],
     "level_1_idx": 3,                      //you can either use Level index to previously defined Levels
     "level_2_idx": 2,
     "level_X_idx": 1,
     "level_1_txt": "Area 52",              //or directly define the Level name
     "level_2_txt": "AHU 89",               
     "level_X_txt": "Building A",
     "tags": [{                            //arbitrary array of tags
       "name": "technology_id",            //tag name - string
       "value": "VZT1",                    //tag value - string
       "type": "string"                    //string, bool
      }, {
       "name": "area",
       "value": "256",
       "type": "number"
      }
     ]
    }
   ]
  }
 ]
}
  • © Energocentrum Plus, s.r.o. 2017 - 2024