Automate lighting in your homeoffice for video calls (webcam as a trigger)

Hi there,

during the pandemic I am working from home a lot and therefore communicating with my team via video calls. Recently I bought a keylight for my desk to improve the lighting during video calls. Because the light I bought is allready integreated in Homeassistant I figured it would be cool if it switches on for video calls automatically.

First I tried using IOT Link with ProcessMonitor to check if I am in a Meeting but I could not get it to work reliably with MS Teams (that we use).

I decided to write a little script for myself that uses the windows registry to determine which process uses my webcam and publishes this information to my mqtt network. This way I can switch the light if I am joining a meeting (i.e. if my webcam is active) and I do also send a little notification for my family so they know when they can enter my offiice without being recorded.

Because I did not find a lot on the topic online and it works pretty well for me, I thought Iā€™d share it here: