Thing Types


Introduction

A Thing Type is a class of a device (or other data source) that a user can connect to Geeny. It contains meta information about the data source and what type of data it can send and receive.

As an example, if you wanted to register your Raspberry Pi on Geeny, you would register it as a Thing with the “Raspberry Pi” Thing Type.

How Thing Types are used

When you define a Thing Type for a type of device, then you can register Things of that type and use them to transmit data to the platform. If you publish your Thing Type, then application providers—i.e., individuals or organizations with applications connected to the platform—can add your Thing Type to their applications. This allows them to implement an authorization flow to access data from Things of your Thing Type over our Application Broker API.

Resources

Data that can be sent or received by a Thing Type is stored as a set of resources. Each resource corresponds with a Message Type. Resources can be pub or sub implementations of Message Types (following a typical publish/subscribe pattern).

The key difference between Message Types and resources is that Message Types tell the platform what data to expect from a message, while resources tell the platform how the data specified in the Message Type will be transmitted.

See the JSON model below for more information.

How to create a Thing Type

You can add your Thing Type to the platform using the Developers Dashboard, the easier method, or you can use the Thing Manager API.

Once you add your Thing Type to Geeny, you can find it in the Data Explorer.

See the Onboarding Guide for instructions on how to create a Thing Type.

Thing Type model

Geeny stores Thing Types as JSON objects with the following structure:

{
  "id": "024d804b-1267-4483-aab8-f25f22441062",
  "name": "BRAND Temperature Sensor",
  "created": "2017-07-18T09:38:16.164Z",
  "public": true
}
  • id: (string (uuid)) Unique ID of the Thing Type.
  • name: (string) Name of the Thing Type.
  • created: (string (date-time)) Date and time when the Thing Type was created.
  • public: (string (boolean)) Enables other users to register Things of this Thing Type.

Resources model

{
  "meta": {
    "offset": 0,
    "limit": 50
  },
  "data": [
    {
      "id": "908fc6f8-edd6-4263-8cf3-1e1f817ca134",
      "uri": "fuel_level",
      "method": "pub",
      "message_type": "ce8c86cc-d6b6-4811-af2e-bf73b3337fec"
    },
    {
      "id": "abd820e4-4ab8-4219-943d-caf620529971",
      "uri": "human_message",
      "method": "pub",
      "message_type": "369c0532-6977-4e87-b98a-6d1eff2d0b98"
    },
    {
      "id": "d7581ef2-a985-4e12-99ba-b9e86c5120fa",
      "uri": "speed",
      "method": "sub",
      "message_type": "64389084-b528-4e40-ac71-b3cc7b64f29e"
    },
    {
      "id": "eb48da43-5cc6-4bde-b9d7-7e0f30737739",
      "uri": "shield_status",
      "method": "sub",
      "message_type": "7eae1c09-0e04-4b4c-929a-96a867b5d78b"
    }
  ]
}
  • id: (string(UUID)) ID of the resource.
  • uri: (string) URI where the Message Type is to be published or consumed via subscription.
  • method: (string) Specifies whether this resource will be published by a Thing (pub) or whether a Thing will subscribe to receiving the message at the given URI (sub).
  • message_type: (string(UUID)) ID of the Message Type that corresponds with the resource’s payload.