Use your raspberry pi to fetch your current presence in Teams and show it with a Trådfri RGB smart light from IKEA.
More details in my blog post:
- Raspberry Pi Zero W with Raspberry Pi OS Light Buster (although, other client will work)
- python3 and pip3
- Trådfri Gateway, Remote and an RGB Light
- coap-client and a new preshared key for communication with the Trådfri Gateway.
- O365 python module
- Microsoft Graph API and consent to the used app (or your own)
- Teams (where the presence is set)
Install O365:
pip3 install O365
Copy and update the config.cfg
cp config-sample.cfg config.cfg
Start the main.py
and keep it running:
nohup python3 main.py &
On the first run it will ask you to paste an URL into your browser and paste the redirect url. After that the tokens are saved in the file my_token.txt
(listed in the .gitignore
)
Find the process id and kill it:
ps -aux | grep main.py #e.g. 10380
kill 10380