Reflect device connectivity status in thing

At the Connections/Integrations tab you get an overview of the connections configured for your service instance so far.

If you want to reflect the device connectivity status - which can be derived from header information of devices connected via Bosch IoT Hub - in your things, proceed as follows:

  • Select your connection - this must be of type Bosch IoT Hub
  • Click Edit
  • Check the box to Enable persisting the connection status of the device reported by Bosch IoT Hub at the thing
  • Click Save to close the dialog

connection status thing

By activating this checkbox, the Things service will create and update a new feature for all things using this connection.

The feature is named by default ConnectionStatus and follows the Eclipse Vorto definition org.eclipse.ditto:ConnectionStatus:1.0.0 (see https://vorto.eclipse.org/#/details/org.eclipse.ditto:ConnectionStatus:1.0.0).

The device connectivity status is derived from the Bosch IoT Hub headers creation-time - for readySince - and ttd (time ‘til disconnect) - for readyUntil.

Example

This is an example of a device, which is connected for 10 seconds:

{
  "thingId": "com.acme:coffee-brewer",
  "policyId": "com.acme:coffee-brewer",
  "attributes": {
    "manufacturer": "ACME demo corp."
  },
  "features": {
    "ConnectionStatus": {
      "definition": ["org.eclipse.ditto:ConnectionStatus:1.0.0"],
      "properties": {
        "status": {
          "readySince": "2019-11-05T12:29:30Z",
          "readyUntil": "2019-11-05T12:29:40Z"
        }
      }
    }
  }
}

Short connection periods

If your device is capable of receiving commands only for a short period (e.g. when communicating with the Bosch IoT Hub via HTTP), the readySince and readyUntil values will probably be very close together.

In case you need to send a command to the device during that short time interval, you should subscribe to events e.g. defining a filter which matches changes to the ConnectionStatus: exists(features/ConnectionStatus)
Whenever your application gets notified about such a change, it can determine whether a device is now connected and able to receive commands.

Long connection periods

In case your device communicates via MQTT and gives the signal to be ready for retrieving messages, the readySince value is set to the current time, when the Things service received the event or telemetry, and the readyUntil value is set to a distant future date: 9999-12-31T23:59:59Z.

Once such a device disconnects or loses its connection, the readyUntil value will be set to the date when the disconnection happened. So, you will be able to see when the device was last connected.

Imprint Legal info Privacy statement