Like all the other commenters here, I also devised my own solution—but AFAICT, it's the only other solution that's automated!
Requirements:
* macOS
* Zoom
* Home Assistant
* A signal light/sign on a smart switch (like [0])
The Procedure:
First, create a script that checks whether you're currently on a Zoom call, and then turns your signal light on or off accordingly. Remember to chmod +x!
#!/bin/sh
if [ $(lsof -i 4UDP | grep zoom 2>/dev/null | wc -l) -gt 1 ]; then
curl \
-H "Authorization: Bearer ${HOME_ASSISTANT_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"entity_id": "${ENTITY_ID}"}' \
https://${HOME_ASSISTANT_DOMAIN}/api/services/switch/turn_on
else
curl \
-H "Authorization: Bearer ${HOME_ASSISTANT_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"entity_id": "${ENTITY_ID}"}' \
https://${HOME_ASSISTANT_DOMAIN}/api/services/switch/turn_off
fi
Then, create a LaunchAgent that monitors your Zoom Application Support directory for filesystem changes at ~/Library/LaunchAgents/local.${USER}.on-air.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.${USER}.on-air</string>
<key>ProgramArguments</key>
<array>
<string>${PATH_TO_SCRIPT}</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Users/${USER}/Library/Application Support/zoom.us/data</string>
</array>
</dict>
</plist>
Finally, load 'er up:
$ launchctl load ../Library/LaunchAgents/local.${USER}.on-air.plist
[0]:
https://www.amazon.com/dp/B09NJ8ZCHF