Posted by quacky_batak 5 days ago
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/B09NJ8ZCHFI've had a similar problem in the past. It turns out that most routers have a way to assign an IP address statically based on the MAC address of the requesting device without affecting the other DHCP devices on the network.
I do this for my pi-hole, my NAS and my gaming PC.
I thought that step one of geekdom was assigning a few static IPs.
Ruining the home network while ‘optimising’ has happened a few too many times.
Let's assume the LAN is 10.0.0/24, so addresses of devices on the LAN are 10.0.0.1-10.0.0.254. In the following I'll omit the 10.0.0. part of an address, so will just refer to addresses 1-254.
Find the range DHCP manages, which should be somewhere in the router settings. If it is 1-254 reduce it. Let's say it is 1-200 (either by default or after you have reduced it).
Then you can simply go the settings on your server or other device that you want to have a static address and configure it to use a hard coded address outside that range, such as 201.
A possible downside of that is that on some devices if you want to give it a hard coded address you also have to hard code the gateway address and the name servers.
Some devices though have an option to use a hard coded address but still get the gateway and name servers from DHCP.
In summary, there are three ways to manage address for a given device on most home routers.
1. DHCP assigns the address. It can choose any address in its pool. Each time the device needs an IP address, such as after a boot or when its lease expires, it could get a different IP address.
2. DHCP assigns the address, but you can tell it to give a specific address from the pool to a given device identified by the device's MAC address.
3. Tell the device to use an address outside the router's DHCP pool. It's up to you to decide how to assign these address and how to make sure no conflicts arise.
For #2 if you want some device to have a fixed IP address but you don't actually care what that address is, many routers have an easy way to do that. Connect the device under #1, so DHCP picks the address.
Then go find the table in the router's web interface that shows all currently connected devices and find your device. Many routers will have a toggle in there to tell it to switch to #2 for that device. From then on the device's current address will be reserved for it.
That's a little easier than going through their "assign an IP" dialog, because that usually makes you enter the MAC address. If you go through the connection table details it doesn't have to ask you for the MAC address.
But as it turns out, since my spouse & I both work from home, separated by an entire floor of a house, there ain't that much need for it, so it sits on my shelf.
What you need is a sensor right near the green dot that detects whether it's turned on or not. Could use a full-blown camera, but probably a simpler sensor would work too.
Only half-kidding.
? OverSight [1] seems to work just fine. It pops up whenever something uses the mic or camera (the usage for this tool is to "monitor" for unwanted access from rogue apps). Since it's open source it should be possible to check how they get the status?
The only issue with my setup- I work from home. My wife does not. No one is there to care if they can come in or not. It was building something fun to solve a problem I never had.
Would do again.