Everything is a Thing
Overview
This page introduces the Web of Things API. All functions of the IoTHub can be accessed via a RESTful API based on Web Thing Description. It will also briefly explain what things, properties and actions are and how to create things and how to change properties and actions.
Things
Things are the abstraction of a physical or virtual entity in the (I)IoT context. This can be a device like a RFID scanner, a controller like a PLC from a supported vendor or standardized protocol (like OPC UA), a database, a file or any other collection of properties. A thing must have an (unique) name and a type. Without any connectors the IoTHub supports the type "virtual" from the group with the same name, but can be extended as shown in the following table:
Group | Type | Type for Developers | Description |
---|---|---|---|
ELCO Devices | Spider67 Mobile | elco.spider67mobile | Customized control for Spider67 Mobile devices produced by Elco Industrial Automation |
Pick-To-Light (PTL) | elco.ptl | Customized control for Pick-To-Light (PTL) devices produced by Elco Industrial Automation | |
RFID Q-Series Scanner | elco.rfid | Customized control for RFID Q-Series Scanners produced by ELCO Industrial Automation | |
Edge Box | elco.edgebox | Customized control for Edge Box software produced by ELCO Industrial Automation | |
Common Protocols | OPC Unified Architecture (OPC UA) | opc.ua | Full support for devices operating under OPC UA protocol |
Modbus TCP | modbus.tcp | Full support for devices operating under Modbus TCP protocol | |
Generic MQTT | mqtt.generic | Full support for devices operating under MQTT protocol | |
Constrained Application Protocol (CoAP) | coap | Full support for devices operating under CoAP protocol | |
Exclusive Technologies | Siemens Simatic S7 | siemens.s7 | Full support for Siemens Simatic S7 devices |
Additional Devices | Virtual Thing | virtual.virtual | Virtual devices which do not match with the previous types. These kind of devices can be fully controlled and customized by you! |
There are different thing states which indicate the running status of a thing as below:
Icon in thing list | Description |
---|---|
Thing is created and not connected yet. | |
Thing is connected without errors. | |
Thing is working, but there are warnings | |
There is an error and the thing is not working | |
The thing is regularly not connected to its physical device and does not work |
Note
Undefined states are very unlikely to appear in the IoTHub, however, if a new state is received, that is not defined, then it will be represented by a unknown state icon.
Properties
A property represents a specific value of a thing. Some properties may be read-only and some may be writable. A property must have a name and a datatype. The allowed datatypes are
Datatype | Minimal Value | Maximal Value | Description |
---|---|---|---|
integer | -9223372036854775808 | 9223372036854775807 | |
number | ≈-1.7*10308 | +1.7*10308 | |
boolean | false | true | true/false Value → „Checkbox“ |
string | Number or Text with any Sign |
Note
There are two additional datatypes
- object/struct: contains elements with one of the datatypes (inclusive object itself) and a name
- array: a list of elements of one of the datatypes
Actions
An action is a special command for a thing and comes along the thing type. It is not possible to create a new action. An action can have parameters and always has a result. Actions are executed asynchronously, between triggering the action and receiving the action result the action has the state "pending".
Events
An event can provide information about changes of a thing or currently ongoing processes. E.g. an event that informs the user about the state of a thing which has switched from offline to online or an event that provides the information that a thing is currently rebooting. Events are only for informational purposes, there is no interaction with them.
Alarms
Alarms can be set for properties of a thing and will be triggered if there values are not compatible with the set threshold. Active alarms can automatically trigger custom reactions and get acknowledged by users. More detailed information about alarms can be found in the Alarms section.