docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License

    • Unity Live Systems Data
      • Installation
      • What's new
      • Upgrade guide
    • Get started
      • Take it further
    • Basic concepts
    • Configure your service
      • Add and configure user-supplied secrets
      • Associate 3D objects with source devices
      • Configure a facility device simulator
      • Configure data connectors
        • Device connectors
          • Azure IoT Hub device connector
          • Facility Simulator device connector
          • HTTP device connector
        • Telemetry connectors
          • Azure EventHub telemetry connector
    • Develop your application
      • Create environment settings
      • Create a services controller
      • Implement a telemetry history controller
    • Troubleshooting
    • Glossary
    • REST APIs

    Azure IoT Hub device connector

    Use the Azure IoT Hub device connector (Unity.Connector.Device.Azure.IotHub) when loading device definitions from an Azure IoT Hub.

    Behavior

    When invoked, the Azure IoT Hub device connector enumerates devices on the Azure IoT Hub using the connection string specified in the IotHubConnectionStringSecretName user secret. The device connector uses the default query (select * from devices) to enumerate devices unless otherwise specified in the Query property.

    Prerequisites

    Before you configure an Azure IoT Hub device connector, you must first create and configure an Azure IoT Hub. Devices created in the Azure IoT Hub are imported into Live Systems Data services if the default query or a query specified in the connector's Query property match the devices to the services.

    Devices must have the following tags applied to their Device Twin in the Azure IoT Hub:

    {
      "tags": {
        "type": "DeviceType",
        "telemetry": [
          "TelemetryNameA",
          "TelemetryNameB",
          "TelemetryNameC",
          "TelemetryNameD"
        ]
      }
    }
    
    Tag Name Type Description
    type string Identifier representing the type of the device (such as, Wind Turbine, Appliance, and Light Fixture).
    The Live Systems Data services use the device type to filter and categorize device definitions.
    telemetry array [string] Names of the possible telemetry events generated by the device.
    Telemetry names are used to match incoming telemetry events with device definitions in Live Systems Data services.

    Copy the IoT Hub connection string from the shared access policies:

    HostName=my-iot-hub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxxxx=
    

    Use the user secret endpoints in the Live Systems Data API to create user secrets that represent the IoT Hub connection strings.

    Configuration

    You configure the Azure IoT Hub device connector using the Live Systems Data API.

    {
      "implementation": "Unity.Connector.Device.Azure.IotHub",
      "properties": {
        "IotHubConnectionStringSecretName": "user-secret_a1ba1815-246f-4eef-87e5-a0aa75235a62_My-IotHub-ConnectionString"
      }
    }
    

    Properties

    Property Required Description
    IotHubConnectionStringSecretName Yes User secret ID representing the shared access policy connection string of the Azure IoT Hub.
    Query No Optional query to use for enumerating devices from the Azure IoT Hub (default: select * from devices)
    Back to top Generated by DocFX
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023