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 
Guess it is indeed a SSH server
So, this worked for a few weeks and now I cannot control my son’s computer anymore using the “Computer” app.
The SSH server is running on his computer, everything is setup correctly in the app, it is just not connecting.
Unfortunately there is no community post on this app, the only way to get support is to E-mail the person who built it and he doesn’t respond to it.
Has the IP address of the Mac changed?
No, it is the first thing that I checked. Would be nice to have some sort of connectivity check other than the fact that it doesn’t work.
You can install a Net Scan community app device to see if the PC is reachable by Homey;
Use the “TCP Port” device to check on any preferred port number
(the “IP Address” device only checks on port 80)
Example:
Thanks! I installed the app and then thought that I also have the UniFi app. In the Net Scan community app it indeed is “offline” to Homey. Which is weird, because in the UniFi site manager I see the computer, I also see the computer in the Homey UniFi app as online.
I double checked if the SSH server is running, which is the case.
Edit: it seems that port 22 is unreachable
Edit 2: Had to set the network to “private” rather than “public”. Fixed! Thanks for thinking along!
And again: this is a good way to control a PC…even if it is a Windows PC
Yes, some PCs stay connected to the network for f.e. Wake on LAN when they’re turned off. This means it’s not fully offline, but not pingable.
It can also take a while for states to be updated in some network managers. In my Zyxel Nebula AP, I have to wait a few minutes before the state is updated on the Nebula cloud portal.
See my to edits. It was a “me” problem 