In order to send data reading information to third party servers, Hubkit provides a set of API endpoints which can be used to register and receive data readings right when they get processed by Hubkit.
For all POST request, the expected Body content is a JSON string containing the URL HubKit should try and send data to.
For Example, a request to
https://127.0.0.1:29443/readingSubscriber/subscribe should have a Body similar to
"http://127.0.0.1:5001/test" and a valid
Content-type: application/json; charset=utf-8 header
https://hubkitAddress:29443/readingSubscriber/subscribe – API endpoint to add or reactivate a reading Subscriber
https://hubkitAddress:29443/readingSubscriber/unsubscribe – API endpoint to remove a reading Subscriber
https://hubkitAddress:29443/readingSubscriber/isRunning – API endpoint to check if a reading Subscriber is active or not
Data Reading Format
Format is similar to what you can see in Gravio Studio Data Viewer and has the following structure:
string AreaName - Name of the Area, the sensor is registered in ex: "Area 1" string LayerName - Name of the Layer, the sensor is registered in ex: "Layer 3" string DeviceName - Name, custom or default, the sensor is registered as ex: "EnOcean" (default) or "Door Sensor 1" (custom) string LayerType - Name of the category that reading is ex: "Gravio-Door-JP" string DataType - Name of the data type that reading is ex: "Contact status" string SenderId - ID/MAC Address of the sensor ex: "05-00-0A-3D" object Data - Usually number or string - Parsed data ex: "Contact open" (string) or 24.408 (number) string Timestamp - ISO 8601 formatted string of the UTC time the reading was received by Hubkit at string DataId - Unique Uuid of that data reading, for database storage purposes