Run flow when computer is active or not. (Mac)

Hey. I want lights, heating etc to be turned on when I’m in my office. I’ve tried presence detector but as I’m sitting still by my computer it fails to detect me after a while.

So I was thinking: is there a way to run a flow when my computer (Mac) wakes up from sleep and vice versa? Any ideas here? I could run a http-request or maybe there are better ideas?

The thinking is to turn on lights and what not as long as I’m sitting in front of my computer…

You can try a smart plug for checking the power use of the Mac.

IF power is more then … W,
THEN …

IF powers less then … W.
THEN …

Similar to Mike’s idea, without extra hardware:
NetScan app. Monitor the IP of the mac

When mac is online
Then light on
When mac is offline
Then light off

A mmWave sensor should do the trick.
I use a FP2 to do the same (integrated via HA)

Another cheap way is to use an app called Shortery running on the Mac. This allows you to automate the running of Apple shortcuts on the Mac in response to various events including for example the computer waking or sleeping.

You can then use this to trigger an Apple shortcut which in turn triggers a Homey flow (I do this using the Local API app on Homey but you could just use a standard webhook).

I have had this working for quite a while now and it’s very reliable.

Was looking for this as well and found this: Computer | Homey

That only seems to work on Linux since it requires SSH server which is AFAIK Linux-only, not available for Windows or macOS.

According to Gemini Windows has a built in SSH client

Yes, but the app you mentioned needs an SSH Server on the computer

macOS supports ssh out of the box, you just need to turn it on in the system settings.

Which is in a lot of cases installed by default and if not you can easily do that

That’s an SSH Client, it’s installed on Windows by default. Not SSH server. I’m not sure about macOS, @robertklep mentions that it’s possible but I don’t use macOS so I don’t know

Well, I just switched off my son’s Windows computer using Homey :slight_smile:

Guess it is indeed a SSH server