Microsoft Teams integration with ALSO IoT Ground

Data presented and visualised in the ALSO IoT Ground are graphically awesome, but you can improve the solution by sending notifications directly to your Teams channel!

Introduction

You can have your IoT solution accelerator set up rather nicely in your workplace or any other area of your choice. Monitoring the environment behaviour in the real time is a key enabler of IoT value demonstration when it comes to the informative dashboards and actionable information. Making a desired area clean, fresh and cosy is essential to help you work on the peak performance.
In this case, we will show you how to monitor the CO2 level in the meeting room by posting a message directly in the Microsoft Teams channel. 

Create a new webhook integration in MS Teams

For this step, you need to have to be a member of a team in the MS Teams application and to have a dedicated channel where the notifications (i.e. informative messages from the ALSO IoT Ground) will come into. So, let's explain this integration in a few steps:
    1. If you are already a member of the Team, you'll need dedicated channel for incoming messages,
    2. Go to that channel and click on the three dots "•••"  in the upper right > click on Connectors,
    3. Write "webhook" in the search bar and click on the Configure next to the "Incoming Webhook" result,
    4. Write the Channel name, Description (if wanted) and Privacy settings for the incoming webhook and click on the Create button,
    5. Once you've created the Webhook, you'll get the URL to use it as a destination point when sending the messages to this channel. Copy-paste this URL as you'll need it afterwards,
    6. The setup for webhooks in MS Teams is done. Now go to the ALSO IoT Platform.

Create a Rule in ALSO IoT Ground

For the other part of the setup process, you have to create a Rule in the ALSO IoT Platform within your Ground, which will send the notifications (i.e. messages) to the previously created MS Teams channel. 
To do that, follow these steps:
  1. Click on RULES  sidebar on the left side in your Ground,
  2. Click on the + NEW RULE button on the top of the page,
  3. Drag one of your Devices into the TRIGGERS  block and select the asset (one or more) you want to monitor and do actions with,
  4. Under the "COMPONENTS" , drag the "Webhook" block to the ACTIONS  block
    1. Next to the "POST" section, paste the Incoming Webhook URL given in the previous configuration process within MS Teams,
    2. In the "BODY" section, paste the code similar to the one below. 
      { "@context": "https://schema.org/extensions",
      "@type": "MessageCard",
      "themeColor": "c6002b",
      "title": "CO2 level warning!",
      "text": "CO2 concentration is TOO HIGH {insert the asset value herein}!",
      }
    3. You have to add the actual state of the CO2 sensor after the "text:" line and under the following quotes mark by clicking on the "+" button within the BODY section and then choosing the related asset. The code will look similar to the one below

     5.   Click on SAVE RULE.
 
That's it! 👏 Now the warnings from your Ground should arrive in the MS Teams channel when the Device's asset value exceeds the threshold level(s) once set up in the Rule engine.

Use-case: CO2 monitoring

The image below shows the use-case of the Environmental device within the Workplace+ Solution Accelerator. Environmental device is an advanced indoor climate sensor that measures CO2 levels, temperature, humidity, light intensity, and detects motion. 

Using our Rule engine, integration with MS teams made the meeting room monitoring far easier when it comes to notify the responsible staff to take actions upon received data (e.g. to open the window or turn on the air conditioning if the workplace humidity is too low). Also, if using the MS Teams mobile app, these notifications will be immediately received in dedicated channel and thus the meeting room (or any other area) can be prepared better for the incoming meetings. 

Get more info about the Workplace+ Solution Accelerator on our official page