Ideas for how to sense what source a PC monitor is on?

I have my work laptop and my personal PC connected to my PC monitor. I'm thinking up an automation to detect when I'm working, i.e.there's motion on my desk and the monitor is displaying HDMI 1 for my work machine and not HDMI 2 for my personal machine. Without this distinction my rule will treat working and playing Elden Ring identically.

I used to use a KVM to switch sources. It could have made this work because there's an LED on each channel, i could have rigged a nodemcu to report which led was on, but that KVM has been giving me issues so I'm back to square one on that idea.

Additional challenges that may thwart your ideas: 1) my work laptop is issued by a law firm with incredible security, i cannot install anything or change any configuration on that machine. However my PC is all mine so if there's a script that could send an http request to makerapi when the computer is NOT displaying to a monitor, i could install it there and that would mostly work because their are only the two binary options, assuming i don't shut down the PC. 2) my work laptop remains active even when I'm not working. It does not sleep, shut down, lock or log off when I'm switched to the other source.


Perhaps a power monitoring plug on the personal PC and monitor. A Zooz power strip maybe. If the monitor is active but PC is not, you are working, otherwise it's personal time.

1 Like

As already suggested, putting a power monitoring outlet on the power supply cords might work. The response time should be pretty quick, but adjusting setpoint for the trigger might be difficult unless you shut down at least one of the computers completely when they are not in use.

One thing you might consider is using a temperature sensor on the case of your personal computer. When you are using that computer, especially if you are playing a video game likke Elden Ring that puts a load on your CPU and GPU, the temperature will increase. I do not know how responsive that might be if you were doing email, reading forum posts or surfing the web. Also, it can take a while for the temperature to drop after reducing load.

Since you did not specify the types of actions you are trying to trigger when you go from work to personal mode, it is hard to know how responsive you need the sensor to be.