An open source python script to display your Microsoft Teams presence to an RGB LED panel. This project uses an Unicorn pHAT for Raspberry Pi Zero combined with the latest version of the Microsoft Graph API. It supports a variety of presence types, eg.
- Available = Green
- Busy = Red
- Away = Yellow
- Out of office = Purple
- and a lot more!
The Python script pulls the Microsoft Teams presence by using the Microsoft Graph API every 30 seconds and prints the result to console. The presence object will then be converted to a color, which is displayed with the pHAT.
FeaturesThe script includes the checked features, while others are planned:
- Display the current Microsoft Teams presence as RGB
- Update the status every 30 seconds
- Turn off LEDs at night
- Start script with arguments
- Check for version number
- Check for weekdays
The difference of this solution in comparison to my original inspiration is that my app
- has no heavy web servers running in the background
- no need for installing homebridge
- no need for writing custom plugins
- has a simple download and registration process.
Optionally use a diffuser to make the result more attractive
- Get Rasbian running with the latest version of Python3
- Solder your Unicorn pHAT with your Raspberry Pi
- Download the repo from GitHub
To get the code, please head over to GitHub and read through the detailed instructions and wiki here.
To install the script and all the according libraries, clone the repository and run the sudo ./install.sh
command. This will install the UNICORN library, install python-dev
and update your packages. Also, you will need to create your own Azure AD app. You will probably need permissions from your Azure administrator. As an alternative use the ids from the original project.
To run the script, simply execute the main file with sudo python3 teams-presency.py
. If you start the script the first time, it will ask you for your Azure Tenant ID and Azure Client ID. Next it will ask you to register the app with your Azure Active Directory by following the displayed URL and logging in with your Microsoft work credentials. These will be stored in a cache file.
Note: The script requires sudo, elsewise it will fail to run.
Note: The script requires sudo, elsewise it will fail to run.Original project
This project is inspired by the original project back from April 2020 by Elio Struyf. He did an awesome job with his project, but it felt strange on how complicated everything was by setting up a local webserver and adding homebridge to update a presence light. Therefore I took the idea from pulling the presence status, but removing all the web service and homebridge parts. My version of the Teams presence status indicator simply pulls the Microsoft Graph API every 30 seconds and converts the result into a color, which will be displayed by the RGBs.
Comments