Jump to content

As a follow up to: 

I ordered a smart outlet and set it up in my homeassistant. I created a webhook to turn it off/on and made a powershell script to call it. I now need to figure out how to setup Windows so it calls the script when it's inactive and turn it back on when there's activity. There don't seem to be any event that covers that in task scheduler. How can I achieve that?

Link to comment
https://linustechtips.com/topic/1444490-screen-sleep-event/
Share on other sites

Link to post
Share on other sites

I don't know if there's an event for screen off, but tasks can be scheduled for "On Idle", and that could be configured to be effectively equivalent to the screen off event, since that's also triggered by idle time. Returning from idle might be harder. I think there's a way to trigger tasks off of events from Event Viewer, so you could see what the "return from sleep" event is in Event Viewer, probably under "System", and trigger off that.

¯\_(ツ)_/¯

 

 

Desktop:

Intel Core i7-11700K | Noctua NH-D15S chromax.black | ASUS ROG Strix Z590-E Gaming WiFi  | 32 GB G.SKILL TridentZ 3200 MHz | ASUS TUF Gaming RTX 3080 | 1TB Samsung 980 Pro M.2 PCIe 4.0 SSD | 2TB WD Blue M.2 SATA SSD | Seasonic Focus GX-850 Fractal Design Meshify C Windows 10 Pro

 

Laptop:

HP Omen 15 | AMD Ryzen 7 5800H | 16 GB 3200 MHz | Nvidia RTX 3060 | 1 TB WD Black PCIe 3.0 SSD | 512 GB Micron PCIe 3.0 SSD | Windows 11

Link to comment
https://linustechtips.com/topic/1444490-screen-sleep-event/#findComment-15489343
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×