How Have You Automated Your Computer / Laptop?

I am not limiting comments to Windows PC's, if you have automated your Mac, don't feel shy... You are welcome here... (we will eventually convert you :wink: )

There are a couple of options for Windows PC, typically centered around EventGhost, which has limited / no support nowadays, but enough support amongst those that use it to warrant a mention.

I'll admit my knowledge of automations on a Mac or similar device are limited and open to hearing what people are using.

My only integration between my desktop PC and my home automation system to date has been via Wake on LAN. I have a pressure sensor under my desk chair seat cushion, which is connected to a Zigbee contact sensor. When the sensor is 'closed', a WOL packet is sent to my PC, which turns it on (or wakes it up if sleeping). Thus, it is ready a few seconds sooner then if I had to manually wake it up. First world problems, I know! :wink:

This same sensor is used to make sure that the office lighting stays on, as long as I am sitting in the chair.

4 Likes

Pressure sensors are so 2023... you need to get an mmWave sensor... :wink: Says the guy who has one sitting on the desk but has not integrated it into his "Study" automations... :slight_smile:

3 Likes

Use a shell command from a linux box to wake up and lock my Mac when i turn on/off the lights.

Basically I have a shell script on my server Rasperry Pi tied to a webhook, and hubitat calls this webhook to wake / lock the mac.

2 Likes

I’m on a mac, and i convert http calls from hubitat to applescript commands to play music and change the airplay destination of music from the podcast app.

I also use my mac to convert http calls from hubitat to applescript commands to download the latest hubitat backup and back it up via time machine.

I start and stop services based on presence ie openvpn, no need to leave it running while i’m home.

Finally i use hubitat to trigger apple shortcuts on my mac via http calls… right now it’s to pull in and display apple weather, but any app i can automate via shortcuts, i can automate via hubitat through my mac.

as much as @sburke781 would love to convert me over…. the power of apple shortcuts on a mac will make that conversion a VERY hard sell. :wink:

4 Likes

I ran across this the other day.. I have not tried this.

4 Likes

I use a fibaro smart implant to turn on/off my computer. I also use a dropdown menu to control different devices on Hubitat.

1 Like

I'm setting this up now, actually. Small world.

I cba with event ghost etc. Instead I've spliced into the power button on the front of the PC and hooked this up to a 3c relay and button.

Means that a seperate push button or automation can be used to power the pc on or off, either remotely or in person.

I did require a way to determine the current state of the PC in terms of power. I found a fairly clever hillbilly way of doing this was to chop into a USB cable, allowing the gnd/5v lines to connect to another relay and contact sensor combo. Power on? That'll mean there's power to the USB plug and thus the relay is live, the contact opens. Power down, the USB power is cut, the contact sensor closes.

Gives a perfect way to do various auto tasks...

Workshop PC powers on (contact sensor changes to open), the aux socket gets power, soundbar powers up along with my phone charger, wled lighting kicks in, alexa plays a welcome with various info and my soldering iron (etc) powers trip becomes live (although I do still have to manually flick its toggle switch). Alexa starts playing music. And my childish iron man helmet lights up on the wall.

When my 12v pir sensor determines the workshop has been abandoned for a preset length of time, the button is automatically flicked (provided the pc is still showing as being powered up) which suspends the pc and disables various sockets, kills the lighting, stops the alexa music, says 'bye' and so on.

This relies on altering some of the default windows prefs to ensure that pressing the power button hibernates (not sleeps, as this won't cut usb power), and the PC itself is prevented from shutting down itself on inactivity.

2 Likes

If you have MQTT, I have found that IOTLink is useful for when the computer is on, with WOL used if it's not.

I disable all of the metrics because that's just too much, but you can run commands through the Command Addon

I don't think it's maintained anymore, but it has proven its worth (free). That said, you do need to create a scheduled task to restart the service upon wake. It doesn't want to reconnect from that state.

1 Like

I do have a custom StreamDeck keypad for my media PC to control it, but it's all based on StreamDeck and Companion.

Speaking of that, if there was a Companion integration for Hubitat, I could actually automate all of this.... Huh..

I use a handy little app that @Cobra wrote. It runs on my windows PC and translates any mouse or keyboard activity to a Hubitat motion sensor event. Super helpful for when our home office is occupied by someone that’s stationary in front of the computer.

2 Likes

Funny you mention that. Do you have the driver code? I was looking for it the other day. Don’t think Cobra’s site is up and running any longer.

Ha!
I had forgotten about this, it just runs in the background on my pc
I have been using a modified version (For a Node-Red server or Hubitat) since I created it a number of years ago. (Around 5 years ago now, I think.)
I don't have motion sensors in my office any more.
I found when sitting reading the web etc. that I don't move enough to constantly keep my PC, lights/Monitors etc. running using motion sensors
I just use the app as I'm always scrolling or typing.

Hopefully, @marktheknife has not given you a copy of my code as it is not open source

My web pages no longer exist on the internet and I don't support any apps/drivers that people have anymore.

However; if you send me a PM then I'll dig a copy out for you

Andy

5 Likes

I did not, precisely for that reason :slightly_smiling_face:.

1 Like

Thanks Mark :slight_smile:

2 Likes

@Cobra

I would very much like it if you could be kind enough to send the code to me too. Sounds like an awesome idea... I'll pm you.

Ta!

@Cobra

Perfect. Thank you very much indeed.

@Cobra
Hey Andrew, not to inundate you with another request, but I was wondering about use case scenarios. Could I use this to monitor when my kid is on or off his laptop? I already have good parental controls in play, such as restrictions, logs and the ability to VNC into it to see what he is doing live, but I'm not always sure when he is actually on it or "doing homework", etc.

Thinking it might be cool to get a notification when he is active and the ability to know in real time he is actually "doing homework" instead of going back later to look...

I understand if you don't want to spend too much time passing out your stuff, but I was reading this and thought it might be a cool little integration.

The app and driver will act as a motion sensor in HE (Or in my case node-red)
If the PC mouse or keyboard is used, as everything is currently configured, this makes the simulated motion sensor ‘active’ or ‘inactive’
You could easily create a program to monitor this motion sensor to log when the machine is being used or it is idle.
The way I use it is to set it to about 15 seconds for ‘active’ with an additional delay before lights/monitor are turned off.
Since I wrote it, I have used nothing else :slight_smile:

PM me if you want a copy to try

Andy

1 Like

Did you get yours to work in Windows 11? I thought I had read the source, at least the one I have used in the past, was no longer available in Win 11, but I could be misremembering or thinking of something else...