Hub to Things connection - deprecated 2020-09
The Hub to Things connection changed. This page describes the version valid from December 2019 to September 2020.
This section describes the default pre-configured connection, which is established automatically by subscribing the Bosch IoT Suite for Asset Communication package.
In case you need to adjust it, find here some details of how it should be configured.
Bosch IoT Hub
Your instance is automatically pre-configured to be allowed to send messages to our cloud infrastructure.
Bosch IoT Hub does not have a UI on its own, thus all relevant information is accessible via Bosch IoT Things Dashboard.By default, the automatically created connection is named "Devices via Bosch IoT Hub".
The connection is visible at the Bosch IoT Things Dashboard, see below.
Bosch IoT Things
Your instance is pre-configured to allow all messages from Hub to be routed and processed at Bosch IoT Things.
Open the Connections tab to see the entries created automatically during the package booking process.
Click the default connection to see its details.
The Coordinates section is filled with the Hub credentials received at booking.
In section Sources you will find the pre-configured topics:
Source 1
event/{{your-hub-service-tenant-ID}} and
telemetry/{{your-hub-service-tenant-ID}}
The authorization subject: integration:{{your-things-service-solution-ID}}:hub
This entry can also be found in the default policy, which we create for you.The option to Enable Bosch IoT Hub/Things ID convention is checked by default and a strong prerequisite for the successful and secure communication between the two service layers.
Thus, keep in mind that the device ID at the Hub will be identical with the thing ID at the Things service by default.Header mappings
content-type ⇾ {{ header:content-type }}
incoming-device-id ⇾ {{ header:device_id }}
Send replies
Address: {{ header:reply-to }}
Replies header mappingscontent-type ⇾ {{ header:content-type | fn:default('application/vnd.eclipse.ditto+json') }}
correlation-id ⇾ {{ header:correlation-id }}
subject ⇾ {{ header:subject | fn:default(topic:action-subject) | fn:default(topic:criterion) }}-response
to ⇾ command/td0fb1c120a79428ba57cc6a4f9758f28_hub/{{ header:incoming-device-id }}
Source 2
command_response/{{your-hub-service-tenant-ID}}/replies
The authorization subject: integration:{{your-things-service-solution-ID}}:hub
This entry can also be found in the default policy, which we create for you.Header mappings.
content-type ⇾ {{ header:content-type }}
correlation-id ⇾ {{ header:correlation-id }}
status ⇾ {{ header:status }}
In section Targets you will find two sections with the pre-configured topics
first target
command//{{your-hub-service-tenant-ID}}
Topics to publish on address
Live messages
Live commands
The authorization subject: integration:{{your-things-service-solution-ID}}:hub
This entry you will also find in the default policy, which we create for you.Header mappings.
content-type ⇾ {{ header:content-type | fn:default('application/vnd.eclipse.ditto+json') }}
to ⇾ command/your-hub-service-tenant-ID/{{ thing:namespace }}:{{ thing:name | fn:substring-before(':') | fn:default(thing:name) }}
reply-to ⇾ command_response/your-hub-service-tenant-ID/replies
subject ⇾ {{ header:subject | fn:default(topic:action-subject) }}
correlation-id ⇾ {{ header:correlation-id }}
The default expression for the to header mapping (at 5.iv) was composed in a manner to support gateway scenarios based on Bosch IoT Gateway Software, where the thing ID is structured by several colon characters,
e.g. namespace:gateway-name:edge-device-name.However, in case your device does not reside behind a gateway, but your thing name itself needs to contain a colon character (additionally to the one separating the namespace from the name), you will need to simplify the address expression to
control/{{your-hub-service-tenant-ID}}/{{ thingId }}If your device is not connected via gateway, and still uses additional colon characters, and you do not consider this adjustment, your communication from the cloud to the devices will not be successful, and will be dropped because of incorrect addresses.
second target
command//{{your-hub-service-tenant-ID}}
Topics to publish on address
Twin events
Live events
The authorization subject: integration:{{your-things-service-solution-ID}}:hub
This entry you will also find in the default policy, which we create for you.Header mappings.
content-type ⇾ {{ header:content-type | fn:default('application/vnd.eclipse.ditto+json') }}
to ⇾ command/your-hub-service-tenant-ID/{{ thing:namespace }}:{{ thing:name | fn:substring-before(':') | fn:default(thing:name) }}
reply-to ⇾ command_response/your-hub-service-tenant-ID/replies
subject ⇾ {{ header:subject | fn:default(topic:action-subject) }}
correlation-id ⇾ {{ header:correlation-id }}
Further reading
You can configure additional connections with the Bosch IoT Hub as well as generic endpoints using AMQP 1.0, AMQP 0.9.1 (e.g. RabbitMQ), MQTT or Apache Kafka (outgoing only).
Bosch IoT Things is based on, and powered by Eclipse Ditto.
See https://www.eclipse.org/ditto/basic-connections.htmlDetails on placeholders and functions are available in the Things documentation.
Example for using the Metrics and Log entries view.
Check your connectivity and successful digital twin updates