Skip to main content

Configuration

Update the HVAC configuration file

  1. With your favorite text editor, open the DotnetClient/hvac.env file.
  2. Update the ID_SCOPE key with the Azure DPS ID Scope value from the deployment output.
  3. Leave the configuration file open, you will need to update it again in the next step.

Create a Azure DPS enrolment group

  1. From your browser, navigate to the Azure Portal.
  2. Select the Azure DPS resource created for the Predictive Maintenance solution.
  3. Select Manage enrollments.
  4. Select Add enrollment group.
  5. Name the group HVAC_Simulator.
  6. Select Symmetric key for the Authentication type.
  7. Select Save.
  8. Don't close the browser window, you will need the enrollment group Primary key in the next step.

Create an Azure DPS derived device key

  1. Select the newly created HVAC_Simulator enrollment group.

  2. Copy the Primary key to the clipboard.

  3. Select the Cloud Shell button in the Azure Portal to open a command-line window in the browser. The image shows the location of the Azure Cloud shell start button

  4. Run the following command in the cloud shell to create a derived device key:

    az iot dps enrollment-group compute-device-key --rid hvac_simulator --key <your-primary-key> 
  5. Update the DotnetClient/hvac.env file with the derived device key.

Create an Open Weather Map API key

Open Weather Map is a weather data provider. The HVAC simulator app uses Open Weather Map to get the current weather conditions. You must create a free Open Weather Map API key to use the app.

Follow these steps to create a free Open Weather Map API key:

  1. From your web browser navigate to https://openweathermap.org/api
  2. Sign in to Open Weather Map
  3. Select API from the Open Weather Map main menu.
  4. Subscribe to the Current Weather Data. Select the Free option, and select Get API key.
  5. Repeat and subscribe to the Air Pollution API. Select the Free option, and select Get API key.
  6. Select API Keys from the Open Weather Map site.
  7. Update the DotnetClient/hvac.env file with the API key value.
  8. Save the DotnetClient/hvac.env file.