Working from home requires a bit of synchronization between occupants. Especially if one member of family spends a lot of time on calls. Quite early into the work-at-home adventure, my wife found a solution. She bought a lighted "On Air" sign.
Idea was good. Whenever I am in conference call, I just light up the sign and everybody knows to keep quiet as our words are not private anymore. In reality most of the time I would either leave sign on longer than needed or forger to turn it off when I'm done speaking.
And pretty much all issues could be traced to the position of the sign. While it was visible to everybody else in the room, it wasn't directly visible to me. And to make it more annoying, turning it off and on required me to get off the chair. Excellent for physical activity but annoying to do if I need to turn it on/off multiple times in a call.
So I decided to automatize this a bit.
I first repurposed one of the Wyze Plug devices I had around and went about looking for API. Unfortunately, Wyze doesn't offer public API at this time but other people already reverse-engineered it. But alas, all those ports were outdated. Until I found a gem in comments. With those changes it was easy enough to make my own mini application.
While this would be enough for turning on/off the light, I was after something a bit more fine-grained. In quite a few conference calls I might not speak a lot. For them I just usually hit Mute Mic button on my Lenovo P70 and unmute only when I need to actually speak. So it seemed like a good compromise to only light up the sign when I am unmuted. If I'm muted, other family members can have their conversations without impacting my call.
And the following script was the last piece of the puzzle:
while (true); do
CURR_MIC_STATUS=`/usr/bin/amixer get Capture | grep -q '\[off\]' && echo 0 || echo 1`
if [[ "$LAST_MIC_STATUS" != "$CURR_MIC_STATUS" ]]; then
if [[ "$CURR_MIC_STATUS" -ne 0 ]]; then NEW_STATE=true; else NEW_STATE=false; fi
WyzePlugControl 2CAA8E6616D2 $NEW_STATE
It will essentially just check for the status of my mute button and adjust Wyze Plug accordingly. At least until Wyze changes API again.