Automate something based on Microsoft Teams meeting status

Hello all -- I thought I had once read something about how to perform a home automation (turn on a light, for example) when you join a Microsoft Teams call. That's what I want to do basically...

I'm on Mac OS. When I join an MS Teams call, I'd like some monitoring app (I'm not sure if it would be third party or something built-in to Mac OS) to recognize that and then send an API call to my Hubitat hub. (And I have the Maker API part of this already setup. I just need to know the Mac OS side.)

Any thoughts if something like this is possible?

A little late, but I run a powerd script on macOS to send a rest post to webCoRE. It has been reliable for a couple of months and very fast...

#!/bin/bash
# meeting_event.sh
# Watches macOS powerd logs for New Teams meeting state changes and posts to an endpoint.

set -euo pipefail

ENDPOINT_URL="https://cloud.hubitat.com/api/xxxxxxxx/apps/165/execute/:yyyyyyyyyyyy:?access_token=zzzzzzzzzzz"

post_state () {
 local message="$1"
 local state="$2"

 curl -sS -X POST "$ENDPOINT_URL" \
  -H "Content-Type: application/json" \
  -d "{\"message\":\"${message}\",\"state\":${state}}" >/dev/null
}

log stream --style syslog --process powerd \
 --predicate 'eventMessage CONTAINS "Microsoft Teams Call in progress"' \
| while read -r line; do
  if echo "$line" | grep -Eq 'Created|Summary'; then
   echo "In meeting"
   post_state "In meeting" true
  elif echo "$line" | grep -q 'Released'; then
   echo "Not in meeting"
   post_state "Not in meeting" false
  fi
 done