A powershell script to grab your Microsoft Teams presence and change a Philips Hue light to its colour.
- Inside
hue-bridge.json
, fill in your bridge's values:
{
"id": "<BRIDGE_ID_HERE>",
"internalipaddress": "<BRIDGE_IP_HERE>",
"port": 443,
"username": "<AUTH_USERNAME_HERE>",
"selectedLight": {
"id": "<LIGHT_ID_HERE>",
"name": "<LIGHT_NAME_HERE>"
}
}
- Inside
Hue-Teams-Presence.ps1
, find and set the following variable values for the refresh time (default = 5 seconds), the credentials of your registered app in Azure Portal and the User Id for the presence status you are trying to retrieve (how to register an app):
$refreshTime = <REFRESH_TIME_HERE>
<TENANT_ID_HERE>
<CLIENT_ID_HERE>
<CLIENT_SECRET_HERE>
<INSERT_USER_ID_HERE>
- Make sure your registered app has
User.Read.All
andPresence.Read
permissions enabled or else the script will be unable to retrieve any user's presence - In some cases you may receive an
UnauthorizedAccess
error when attempting to run, to avoid this you must sign the script with a certificate. Information on how to do this can be found here