Controlling IoT devices using a Voice Assistant

Solution Idea

If you'd like to see us expand this article with more information (implementation details, pricing guidance, code examples, etc), let us know with GitHub Feedback!

Create seamless conversational interfaces with all of your internet-accessible devices-from your connected television or fridge to devices in a connected power plant. By combining Azure Speech Service, Language Understanding Service (LUIS) and Azure Bot Framework, developers can create natural, human-like conversational interfaces to control smart devices using Azure IoT Hub.

Architecture

Architecture diagram

Data Flow

  1. Using voice, the user asks the voice assistant app to turn on the exterior house lights.
  2. Using the Speech SDK, the app connects to Direct Line Speech. If keywords are confirmed by Keyword Verification, the speech is transcribed to text and sent to the Bot Service.
  3. The Bot Service connects to Language Understanding service (LUIS). LUIS allows an application to understand what a person wants in their own words. The intent of the user's request (example: TurnOnLight) is returned to the Bot Service.
  4. The request is relayed to the device.
    • If the device is connected to Azure IoT Hub, Bot Service connects to Azure IoT Hub Service API and sends the command to the device using either a Direct Method, an update to the device twin's Desired Property, or a Cloud to Device message.
    • If the device is connected to a third party IoT cloud, Bot Service connects to the third-party service API and sends a command to the device.
  5. The Bot returns the results of the command to the user by generating a response that includes the text to speak.
  6. The response is turned into audio using the Text-to-speech service and passed back to the voice assistant app by Direct Line Speech.
  7. Application Insights gathers runtime telemetry to help development with bot performance and usage
  8. Azure App Service hosts the Bot Service application.

Components

  1. Voice assistants documentation
  2. Tutorial: Voice-enable your bot using the Speech SDK
  3. What is Direct Line Speech
  4. Azure Bot Service
  5. Speech to Text
  6. Text to Speech
  7. Custom Keywords
  8. Language Understanding Service (LUIS)
  9. Azure IoT Hub