Sync Microsoft Teams/work PC status to Home Assistant

I wanted info such as whether I am in a meeting or not, what my status is on Microsoft Teams, if my monitor is on, if the computer is locked, etc.

So I created this powershell script to handle pushing the data. Here is an example of what gets sent:

{
  "teams_status": "Busy",
  "call_status": "In A Call",
  "mute_status": true,
  "in_call": true,
  "pc_locked": false,
  "display_on": true,
  "timestamp": "2025-02-18T16:27:21.569411-07:00"
}

Also instead of interfacing with HA directly or using MQTT I instead have it send the data to Node-RED as the middle man. That way if you don’t have Home Assistant installed you can still build automations in Node-RED directly (or send the data wherever you want!)

This works by monitoring the log files of the Microsoft Teams process. This way no authentication is necessary and all you have to do is configure and run the script.