Turn your Home into a Smart Home with Azure IoT – Part 2

Deploy the Bridge and Connect to the Cloud

In this post, I’ll be blogging about deploying the custom application in your home environment and setting it up with an Azure IoT hub to send the telemetry data. The following diagram shows the components.

clip_image001

First let’s create the Azure IoT hub required for the solution. This post assumes that you have an active Azure Subscription.

First of all, you will need to create a Resource Group to contain all the resources you create for this solution. I will call this Resource Group as “VERA-IOT-DEMO1”

clip_image002

Then you create the IoT Hub, you can choose the free version of the IoT Hub.

clip_image004

clip_image006

clip_image008

Once the IoT hub is created, add a device to the IoT hub.

clip_image010

Once the device is successfully provisioned, click on the device to get the access keys and the connection strings.

clip_image012

Now let’s go and download the custom application to integrate Vera and the IoT Hub created. The source code and the binaries for the custom application can be found in the following repository.

https://github.com/sameeraman/VeraAzureIoTIntegration

If you don’t want to modify the code, then you can use the existing pre-compiled version of the application. It can be found under the /bin/debug folder.

clip_image014

Before you run the application, you need prepare some files.

  1. The application configuration file (consists of some parameters such as the IoT hub details)
  2. The devices.csv file (this files lists the definition of the devices you have connected to Vera)

First, let’s go and modify the application configuration file.

Open up the /bin/Debug/VeraIoTIntegration.exe.config

clip_image016

Then modify the following parameters.

image

Enter the IoTHubUri from the IoT hub you just created. Also the Device Name and the Devicekey. The VeraIP should the local IP address of the Vera controller. DevicesFile is a CSV file which defines the list of devices to read information from. Frequency defines the frequency to send IoT messages to the hub in milliseconds. After populating these information open the devices.csv file.

An Example file can be found in the repository. It looks as below, populate it with the devices you have in your environment.

clip_image019

Once your devices file is done, you are ready to run the application. Double click on the VeraIoTIntegration.exe. Then if everything works well, you will see something like below.

clip_image020

After a few minutes, you will see the message count going up as well in the IoT hub.

clip_image022

Now you have successfully configured the Vera integration to IoT hub. In the next post we will be looking at how you configure the Stream Analytics and PowerBI integration.

About sameeraman
I'm a proactive and enthusiastic Microsoft Azure and Identity Consultant working in Perth Australia. My aim is to resolve customer problems and provide them with the best IT systems that satisfy their requirements while maintaining the minimum cost.

Leave a comment