Mini-project: “On Air” During Zoom Calls

My Setup

Detecting if Video is Turned On/Off

% log show — last 2m — predicate ‘(sender == “VDCAssistant”)’ | grep kCameraStream2021–10–07 10:40:54.892531–0400 0xe7dcf2 Default 0x0 48943 0 VDCAssistant: [] [guid:0x1130000046d0892] Post event kCameraStreamStart2021–10–07 10:40:54.892540–0400 0xe7dcf2 Default 0x0 48943 0 VDCAssistant: [] [guid:0x1130000046d0892] Init -> Streaming on event kCameraStreamStart2021–10–07 10:40:57.851867–0400 0xe7dcf2 Default 0x1f8015d 48943 0 VDCAssistant: [] [guid:0x1130000046d0892] Post event kCameraStreamStop2021–10–07 10:40:57.851874–0400 0xe7dcf2 Default 0x1f8015d 48943 0 VDCAssistant: [] [guid:0x1130000046d0892] Streaming -> Init on event kCameraStreamStop

Controlling Lights From a Script

 % pip install phue
% python>>> from phue import Bridge
>>> b = Bridge(‘’)
>>> b.connect()
# Turn on
b.set_light('OnAir', 'on', True)
# Turn off
b.set_light('OnAir', 'on', False)

Putting it Together

#/bin/zshwhile true
log show --last 5m --predicate '(sender == "VDCAssistant")' | grep kCameraStream > camera.log
sleep 5
import subprocess
from phue import Bridge
import time
# Find your IP from your Hue app
# Light is named using the Hue app ahead of time
# Log file dumped from the shell script
LOG = "./camera.log"
# isCameraOn returns True if we think the camera is currently
# on, False if not. We're trying to find if the last line was
# kCameraStreamStart (True) or kCameraStreamStop (False); no match
# is False.
def isCameraOn():
camera_is_on = False
with open(LOG, "r") as a_file:
for line in a_file:
if 'kCameraStreamStart' in line:
camera_is_on = True
elif 'kCameraStreamStop' in line:
camera_is_on = False
return camera_is_on
def setLight(bridge, is_on):
bridge.set_light(LIGHT_NAME, 'on', is_on)
# Note that the first time you run this, you'll
# need to first press the button on the hue bridge
# before running this application
b = Bridge(BRIDGE_IP)
camera_on = isCameraOn()
setLight(b, camera_on)



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store