AFK or Vacancy Sensor for MacOS?

I’m trying to solve a problem with lights automation in my wife’s office. We have a motion sensor installed so the lights come on when she enters and go off when there is no more motion (after 10 minutes).

The challenge we are running into is that she often sits at her computer working or watching movies and doesn’t move enough to trip the motion sensor.

I’ve tried using a power monitor on the computer as a virtual presence sensor (i.e., when the computer monitor is drawing > 5W power, assume she is sitting at the computer). This works somewhat but we find scenarios when the computer monitor is off that the outlet draws significant power (such as if the backup process is running and turning the hard drives), so I’m looking for an alternative.

I’m curious if anyone knows of an application for MacOS that monitors Away From Keyboard (AFK) or Sleep activity on the computer and can then report an event out to ST, either directly or via IFTTT or Stringify type integration. I’ve looked at some of the motion detector apps like iSentry but they only seem to be able to detection motion (not lack of motion) and only seem to send email or audible alerts.

My final alternative is try and build a multi-sensor detector zone but was hoping to find a solution directly on the Mac rather than adding more hardware to her office.

I was going to suggest the pressure pad but that might be overkill lol

What are you using for a pressure pad. I have another application that would work for.

Here’s a thread about it and I believe there are a few more. The basic principle is you attach the wires to a contact sensor that has a secondary terminal.

I haven’t done it myself, but I believe you can use a webcam as a motion detector, assuming there’s one on (or on top of) the monitor.

On PC I believe Yawcam can do it, will have to look up what’s available for Mac.

I’ve looked at a couple motion detector apps (like iSentry) but they seem to have two limitations:
a) The only send alerts on motion, not lack of motion
b) They send emails, don’t trigger IFTTT or Stringify or other Home Automation activities

Don’t know about iSentry, I thought yawcam can execute other program, but I am not sure. Regardless, you can use email as a trigger in IFTTT.

I’d imagine you can use email as a trigger in IFTTT to turn on a virtual switch in smartthings, and use CoRE to turn itself off, then you can use CoRE to turn lights off if the virtual switch doesn’t turn on again within the time you specify.

Real motion detector works the same way, they become active only when there’s a motion, not when there’s a lack of motion.

I believe I have something working that controls a virtual switch based off of when the display wakes up / turns off. This seems like the best option since it’ll stay awake when a movie is playing or the computer is actually being used, instead using the the actual computer wake/sleep which the backup process would create a false event. There’s also options for an idle timer, but I haven’t tested that out.

I’m assuming by computer monitor you mean the laptop screen, but if you are using an actual external monitor, a power meter on the actual monitor would help filter out a ‘display on/off’ event.

I’ll post the code soon once I get everything cleaned up.

Cool @mattw . In my case I’m talking about an iMac (integrated monitor and CPU). Because of this, it’s possible that the monitor goes off but the CPU is still drawing significant power to not trip the threshold on my Aeon Smart Switch power monitor, hence the search for something different.

Look forward to see what you are putting together.