Control device by waking computer

I’m not sure if this is possible at all. But thought would be cool if it was.

I have my desk lights next to my computer, and was wondering if there was a way that when I moved my mouse and the computer was active that they could turn on. And when inactive for so long they turned off?

The lights are controlled by a paired zigbee plug already, just didn’t know if the active computer part was possible?

Currently just using a motion sensor, but thought using activity on the computer would be even better!

If you using Windows, you can use PC Virtual Motion sensor by @sburke781

3 Likes

Forgot to say I am using a Mac.

In general it looks like it is possible to detect keyboard activity on a mac, but I don't own one, so can't help too much unfortunately.

Can you post a couple links - I couldn’t find one easily.

Thanks!

What about a pressure sensor under the chair mat.

Articles like this one seem to suggest there are things that can be used, but not sure how to take this and make it do what is required here... And it's a few years old now...

That's not a bad idea..... I remember a conversation about this and my driver where others talked about a few options such as motion sensors like was mentioned in the OP, not sure about pressure sensors. It could be an option if the activity cannot be detected on the mac.

1 Like

I also have a thread related to the driver, sorry @jmo3112, I know it's not relevant for your mac setup, but there may be something useful. I would like to change the way I set it up, removing the need for Maker API and use the MAC address to receive unsolicited HTTP data, or whatever the right term is.

What if you put a smart plug that monitors power usage of the computer? If the computer power is >x, then turn on lights? Probably work best if you monitor the screen, but if it is an all in one or iMac, you may have to track power usage at idle vs. normal.

2 Likes

Could always buy a cheap ESP8266 board and power it by the computers USB power. Using the Hubduino libraries it will either be present or not present based on heartbeats and this interval is configurable in the driver.

3 Likes

In terms of local detection on the Mac, if keyboard and mouse activity isn't an option, maybe initiating something when the screensaver comes on or the computer is locked might be worth investigating.

Can you program commands to run on the computer for the "on wake up" event if there is one? Then that command could maybe ping an end point trigger on the hub.