ux4iot
  • Introduction
  • Quickstart
  • Concepts
  • How Ux4iot works
  • REST API Reference
  • Configuration Options
  • Create your ux4iot Instance
  • EventHub / IoTHub
    • Configure your existing IoT Hub
    • Create IoT Hub and linked ux4iot
    • Using a separate Event Hub
  • ux4iot-react
    • Initialization
    • Hooks
    • Grant Request Function
    • Tutorial using create-react-app
  • Implementing your custom security backend
    • Introduction
    • Security Backend
    • Security Backend Example - Azure Function
    • ux4iot-admin-node
  • Resources
    • Pricing
    • Performance
    • Limitations
    • Known Bugs & Nice to know's
    • Changelog
  • Made with ❤️ at Device Insight
Powered by GitBook
On this page
  • Device Twin Changed Events
  • Connection State Events

Was this helpful?

  1. EventHub / IoTHub

Configure your existing IoT Hub

PreviousCreate your ux4iot InstanceNextCreate IoT Hub and linked ux4iot

Last updated 1 year ago

Was this helpful?

We recommend using a separate EventHub for the iotHubEventHubConnectionString to subscribe to messages. Your IoTHub should forward the messages to this EventHub or be consumed by an azure function that then sends the messages to this EventHub. This is because of a bug (appearantly in the built-in EventHub of the IoTHub) that causes messages to get lost.

In order to use your IoTHub you can still provide the Shared Access Key of the IoTHub with Registry Read and Service Connect priviledges, to get access to the direct method, device twin and desired property features of ux4iot.

In order to use the following hooks, you need to perform additional setup steps:

In both cases, the IoT Hub routing must be configured.

Device Twin Changed Events

For 'Device Twin Changed Events', which are required for the hook, a routing rule must be added as follows:

If you want to use Azure CLI, you can accomplish the same in the following way:

az iot hub route create \
  --route-name ux4iot-twinchanges  \
  --hub-name IOT_HUB_NAME \
  --resource-group RESOURCE_GROUP_OF_IOT_HUB \
  --condition true \
  --endpoint events \
  --source twinchangeevents

Connection State Events

If you want to use Azure CLI, you can accomplish the same in the following way:

az iot hub route create \
  --route-name ux4iot-connectionevents  \
  --hub-name IOT_HUB_NAME\
  --resource-group RESOURCE_GROUP_OF_IOT_HUB \
  --condition true \
  --endpoint events \
  --source deviceconnectionstateevents

For 'Connection State Events', which are required for the hook, a routing rule must be added as follows:

useConnectionState
useConnectionState
useDeviceTwin
useDeviceTwin