Release Notes v1.4

Create Rule, List Rules, View Rule, New Events Decoding

B
Written by Ben Mills
Updated over a week ago

This document outlines the changes to the BitBrew platform and management APIs that will be released July 21, 2017. Changes to existing endpoints and new endpoints should be carefully read and understood.

BitBrew's API documentation will be updated when the release has been successfully deployed to our production environment.

Table of Contents

  • Create Rule Response

  • List Rules Response

  • View Rule Response

  • Support for Decoding New Events

  • Improved Decoding Support for Known Events

Create Rule Response

After creating a rule, the API will now include the created entity in the response body.

[POST] /v1/tenants/{tenantId}/rules 

Updated Response

    {
+      "createdAt": "2017-06-30T14:43:45.6Z",
+      "enabled": false,
+      "text": "create rule AllEvents using...",
+      "name": "AllEvents"
    }

List Rules Response

The response body of this call has been updated to reflect the new response to the Create Rule method, and to provide more relevant information.

[GET] /v1/tenants/{tenantId}/rules

Updated Response

+  {
+    "rules":
                   [
                     {
-                       "lastUpdated": "2017-06-22T14:43:45.6Z",
+                       "createdAt": "2017-06-22T14:43:45.6Z",
                          "enabled": false,
-                         "rule": "create rule AllEvents...",
+                         "text": "create rule AllEvents...",
-                          "tenantId": "bitbrew",
-                          "ruleId": "AllEvents"
+                         "name": "AllEvents"
                           }
                     ]
+   }

View Rule Response

The response body of this call has been updated to reflect the new response to the Create Rule method, and to provide more relevant information.

[GET] /v1/tenants/{tenantId}/rules/{ruleId}

+   {
+       "createdAt": "2017-06-22T14:43:45.6Z",
+       "enabled": false,
-        create rule AllEvents using...
+       "text": "create rule AllEvents...",
+       "name": "AllEvents"
+    }

Support for Decoding New Events

The Danlaw device has a new device parameter that provides a smoother version of vehicle PID 47 (fuel level). BitBrew has added support for this parameter in the Trip Data events collected by a Danlaw TCP Relative Time configuration.

Example Event

{
    "header": {
        "tags": [],
        "messageId": "4440b830-f226-11e6-a9ef-19403a4f36d6",
        "brokerType": "DanlawTcp",
        "ingestionTimestamp": "2017-06-26T16:55:25Z",
        "tenantId": "bitbrew",
        "deviceId": "6020981915"
    },
    "body": {
        "type": "TripData",
        "timestamp": "2017-06-26T12:51:22-04:00",
        "tripNumber": 621,
        "pidData": {
            "FuelLevelInputSmoothed": 51
        }
    }
}

Improved Decoding Support for Known Events

We have made significant improvements to the decoding of accelerometer events, especially as regards the reporting of the accelerometer readings.

Events Affected

Trip Data Events:

Example Trip Data Event

{
    "header": {...},
    "body": {
        "type": "TripData",
        "timestamp": "2017-06-06T12:51:22-04:00",
        "tripNumber": 423,
        "pidData": {
            "RawAccelerometer": [
           { "x": -16.0, "y": 94.0, "z": 980.0 },
          { "x": -31.0, "y": 94.0, "z": 1000.0 },
          { "x": -31.0, "y": 110.0, "z": 1000.0 },
          { "x": -31.0, "y": 110.0, "z": 970.0 }
             ]
    }
}

Example Trip Event (Accelerometer)

{
  "body": {
    "eventData": {
      "relativeSecond": 0,
      "accelerometerData": {
        "type": "triggered",
        "triggeredAxis": "positive-x-axis",
        "accelerometerSamples": [
          { "x": -16.0, "y": 94.0, "z": 980.0 },
          { "x": -31.0, "y": 94.0, "z": 1000.0 },
          { "x": -31.0, "y": 110.0, "z": 1000.0 },
          { "x": -31.0, "y": 110.0, "z": 970.0 }
        ]
      },
      "type": "AccelerometerEvent"
    },
    "timestamp": "2017-06-24T13:27:35-05:00",
    "type": "TripEventRelativeTime",
    "tripNumber": 312
  },
  "header": {
    "tags": [],
    "messageId": "01adf721-590b-11e7-8ecd-a3a2ebefb7c6",
    "brokerType": "DanlawTcp",
    "ingestionTimestamp": "2017-06-24T18:29:06.578Z",
    "tenantId": "bb8",
    "deviceId": "5032778596",
    "deliveryTimestamp": "2017-06-26T05:05:25.391Z"
  }
}
Did this answer your question?