How to send notifications to Microsoft Teams

In this tutorial you will learn how to send notifications to Microsoft Teams

In this tutorial, you will learn how to set up a rule to send notifications to Microsoft Teams. We make use of the device simulator, to test your rule set up right away. So just make sure, that you have your HTTP device created and available on your Asset Inventory.

Find out more about how to use the device simulator here.

The following steps are explained in more detail:

1. Create a rule

Select as a Rule Input your created HTTP device. Add a logic connector to your rule by selecting the Logic Block Comparison. Connect the dots from your device to the comparison block. All available data sources from your device will appear on the dropdown of Data source 1. In this example, we have the following available data sources from the device simulator:

  • Occupancy

  • Temperature

  • CO2

We choose Temperature as a data source, as we want to send a notification to Microsoft Teams if a temperature threshold is reached.

In Condition field 1 of your comparison block, you are free to choose the individual condition of your rule. In this example, we want to trigger an alert, if the temperature is bigger than 25 degrees.

Proceed now with adding the action connector Microsoft Teams to your rule.

All Microsoft Teams connectors which were already created in your organization are displayed as available connectors. For now, we create a new one. Choose New Microsoft Teams connector and type in your specific information:

Optional: Add payload data to your text by using such a syntax: {{myPropertyName}}. By adding payload data to your text, you will get informed about the actual measured value of your device. Use also the preview function, to preview your text content before you set it live.

Once your connector is filled out, select Save connector. Make sure, that you connect your connector to the comparison block. Proceed by selecting Save Rule and choose an appropriate name for your rule.

Your notification rule is now saved and displayed on the Rule Overview Page.

2. Create a webhook connector on your Teams channel

Following steps are required to create your incoming webhook connector on your Teams channel:

  1. Go to the channel where you want to add the webhook and select ••• More options from the top navigation bar

  2. Select Connectors from the dropdown menu

3. Search for Incoming Webhook and select Add

4. Select Configure, provide a name, and upload an image for your webhook if desired

5. The dialog window presents a unique URL that maps to the channel. Copy and save the webhook URL, to send information to Microsoft Teams and select Save. Paste the Webhook URL on the Microsoft Teams Output Connector on akenza in the field Notification URL.

Learn more about here, how to create your incoming webhook connector on Microsoft Teams.

3. Test your notification service

To test your notification service, you now can send test data from the device simulator to your HTTP device. By selecting a temperature value above the set 25 degrees on your rule, you will receive a notification on your Microsoft Teams channel.

To send test data from the device simulator to your HTTP device, you need to copy the Uplink URL from your HTTP device. Go to Asset Inventory, select your HTTP device, and open API-Configuration.

Copy the Uplink URL and insert this URL on the Uplink URL field on the device simulator.

In this example, we choose a temperature value of 31 degrees, that the rule gets triggered. Proceed by selecting Send Message.

Check if you receive the notification on your Microsoft Teams channel.

Congratulations, you have successfully created a Microsoft Teams notification service on akenza.

Last updated