Define a Device (your lamp)

Altair IoT Studio AnythingDB enables you to create digital models of the assets that define your smart connected ecosystem.

AnythingDB follows the Web of Things (WoT) standards defined by the World Wide Web Consortium (W3C) for the interoperability of different IoT platforms and application domains.

AnythingDB contains following features:

  1. Things: enables you to define the entities in the smart connected ecosystem
  2. Models: templates to ease the process of defining new Things
  3. Categories: group your Assets (Things) in a logical way and define relations between them
  4. Custom Queries: perform custom queries in your database

In this tutorial we are defining a single device, so just the Things section will be used.

Things represent the entities in the smart connected ecosystem and store information about them. One of the key components specified by the WoT is the Thing Description. A Thing Description describes a virtual or a physical device (Thing) through JSON formatting by using Properties, Actions, and Events.

Properties
Describe the Thing's attributes (such as, state of the Lamp)
Actions
Determine how you can interact with your Thing (such as, turn the Lamp on/off)
Events
Events main function is to monitor the changes that cause a change in a Thing's property (e.g., lamp reaches a critical temperature)

AnythingDB is a database designed to store anything from a connected product. Inside AnythingDB, Categories enable you to group Things in a logical way.

In this tutorial, we are creating the virtual digital representation of a lamp with the following attributes:
  1. Properties:

    state [type:string]

  2. Actions:

    toggle

  3. Events:

    overheating

  1. Create a Thing by clicking AnythingDB > Things and clicking New Thing.
  2. In the New Thing dialog, click Skip to Schema.
  3. Add the following Thing description provided by the W3C and click Save:
    {
        "@context": "https://www.w3.org/2019/wot/td/v1", 
        "@type" : "ThingTemplate",
        "title": "Lamp Thing Description Template",
        "description" : "Lamp Thing Description Template",
        "properties": {
            "state": {
                "description" : "current state of the lamp on|off",
                "type": "string"
            }
        },
        "actions": {
            "toggle": {
                "description" : "Turn the lamp on or off"
            }
        },
        "events": {
            "overheating": {
                "description" : "Lamp reaches a critical temperature",
                "data": {"type": "string"}
            }
        }
    }
    The Lamp is correctly defined with the attributes defined by the WoT.


    Figure 1.