💡 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 🏬
- Source: LinkedIn
- IFTTT
- Azure AD App Registration
- Power Automate with Premium Connectors ( HTTPS Request / When a HTTP Request is received)
- Microsoft Teams
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.
- Get your IFTTT Key by clicking on the "Documentation" link on the page here https://ifttt.com/maker_webhooks
- Use IFTTT to create a Webhook Trigger with an action to control the smart devices. (https://ifttt.com/create/if-maker-webhooks)
- 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)
- Register Azure AD Application and Grant the application Delegated permission to the Teams Presence API.
- Gather the Tenant ID, Application ID And Create a Secret ID which will be used in the flows below.
- Get the ObjectID from Azure AD for the User Account that we need to subscribe for Teams Presence Changes.
- Copy the HTTP Post URL to be used later in Step 3
- Update the HTTP Post URL to IFTTT Webhooks
- 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.
- Test Changing the Presence Status of the User Account (i.e. Account that is setup for teams subscription)