Skip to content

Use the Teams Presence API to automate events based on user status. This demonstration shows how you can connect Teams Presence to your Smart Home

License

Notifications You must be signed in to change notification settings

M365-DenzilFernandes/TeamsPresenceAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeamsPresenceAPI

💡 Use the Teams Presence API to flow events based on user status. This demonstration shows how you can connect Teams Presence to your Smart Home 🏬

M365 Tenant & 3rd Party Requirements

  1. IFTTT
  2. Azure AD App Registration
  3. Power Automate with Premium Connectors ( HTTPS Request / When a HTTP Request is received)
  4. Microsoft Teams

IFTTT

Important This solution uses a 3rd party Webhook. If This Then That is a web-based service that allows users to create chains of conditional statements triggered by changes that occur within other web services. Use a Webhook as a Trigger and set an action to control the lights or devices you want to connect and control.

  1. Get your IFTTT Key by clicking on the "Documentation" link on the page here https://ifttt.com/maker_webhooks
  2. Use IFTTT to create a Webhook Trigger with an action to control the smart devices. (https://ifttt.com/create/if-maker-webhooks)
  3. Copy the Webhook Url from IFTTT (Example: https://maker.ifttt.com/trigger/activate_kidsroom_busy/with/key/k12345678ABCDEx)

IFTT Webhook FAQ Check out (https://help.ifttt.com/hc/en-us/articles/115010230347-Webhooks-service-FAQ)

Azure AD App Registration

  1. Register Azure AD Application and Grant the application Delegated permission to the Teams Presence API.
  2. Gather the Tenant ID, Application ID And Create a Secret ID which will be used in the flows below.

Power Automate

  1. Get the ObjectID from Azure AD for the User Account that we need to subscribe for Teams Presence Changes.

  1. Import Get Teams Presence Subscription
  • Copy the HTTP Post URL to be used later in Step 3

  • Update the HTTP Post URL to IFTTT Webhooks

  1. Import Create Subscription for Teams Presence Subscriptions expire every hour and must be renewed. By using a scheduled flow of every hour we can keep subscribing to the Teams Presence API.
  • Update the Tenant ID, Application ID and Secret.

  • Update the username password. Note: If you have MFA on your account, you can use another account in the same tenant without MFA enabled.

  • Update the NotificationURL - This URL is the HTTP Request Received from the Get Teams Presence Subscription
  • Update the Resource - This is the ObjecId is of the User Account that the subscription will monitor for Teams Presence Changes.

Microsoft Teams

  1. Test Changing the Presence Status of the User Account (i.e. Account that is setup for teams subscription)

About

Use the Teams Presence API to automate events based on user status. This demonstration shows how you can connect Teams Presence to your Smart Home

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published