Historian

The Bosch IoT Things - Example Data Historian collects Things property values, stores them in a separate database, and presents them in a time series chart.

Start at https://demos.s-apps.de1.bosch-iot-cloud.com/inventory-browser/ > select a Thing > see the Details at the right side > select a Property value.

Authentication

Basic Authentication is required.
Please log in with your tenant, username and password.

The Inventory Browser application provides only two fields for authentication.
Therefore, you will need to set the tenant name in the same field as the username separated by a backslash:
E.g. YourTenantName\YourUserName .

In case you have no credentials, just create some as described at Register Evaluation User.

Display property values

  • Click the Thing listed in the first column to see its details.
  • The details are presented at the right section.
  • Click one of the linked values to see how they changed over time.
    Example

Adjust Authorization

If you create a Thing using the Inventory Browser's Create button, the Historian will be implicitly assigned read permission for the Thing.

However, by default, the Historian is not permitted to collect data related to your Thing. This is indicated by following message:

Property is not accessible or history data has not been collected
Please ensure that you have access on this Thing and you have included permissions for the Example Historian application to enable history collection.

In case your Thing was not created in line with this demo, you need to explicitly authorize the Historian application by adding its ID to the list of authorized subjects in your Thing.

Example: Use the HTTP API version 2

  • GET the Thing by its ID to find out its policy ID.
    By default, i.e. in case you have not explicitly set other values at the POST request the IDs will be similar:
     {
        "thingId": "my.domain:myFirstThing",
        "policyId": "my.domain:myFirstThing"
      }
  • Add a new entry to the current policy
  • Go to section PUT /policies/{policyId}/entries/{label}.
    • Set the policyId according to the response of your GET request
    • Set the label to historian
    • Set the policyEntry to grant write permission on the thing (don't forget to replace the authorization subject)
       {
            "subjects": {
              "iot-things:b7778cac-e89d-40e8-b5c2-2716c4031cf3:historian": {
                    "type": "iot-things-clientid"
              }
            },
            "resources": {
              "thing:/": {
                "grant": [
                  "READ"
                ],
                "revoke": [
                ]
              }
            }
          }

Upon success, the Historian application is allowed to collect data changes regarding for example the orientation of your Thing.

Developers can find the full code at https://github.com/bsinno/iot-things-examples/tree/master/historian.

Bosch associates can read the blog post in our Internet of Things community.