TL;DR: How can I most reliably determine whether I've logged in to my Mac?
Context:
Since updating from Catalina to Monterey my Mac won't stay asleep. I've spent hours on the phone to AppleCare and been through every troubleshooting step I can think of. I have a suspicion that it may be related to either my Caldigit TS3 Plus hub or the external drives attached to it, but I'm still uncertain. In the meantime, I thought perhaps KM could help me out...
I have a smart plug set to turn on with a KM Wake Trigger, and whenever my Mac wakes of its own accord, the plug has turned on. This tells me that KM runs its wake routine without requiring me to log in, so I figured perhaps I could do something like this:
Put my Mac to sleep again IF I don't log in within 20sec.
At least that would mean my Mac would be asleep most of the night. Any advice would be very welcome.
Sorry, I don't know the English word. I used something like this. So everything can stay plugged in. But the power is gone. Ah, and yes so far that is the only solution I have found.
What I can add, since I am on 12.3.1, the problem occurs much less often. I'm not switching to 12.4 for now because I don't know if it's better or worse. Sorry, I do not know a solution either.
In my case the mac reawakens by itself after a certain time. And I do not have a Caldigit TS3 Plus hub or external drives. This leads me to believe that it has to do with macos. Are you on 12.4?
Yup, 12.4. I did notice the problem didn't occur for a while when I disconnected the hub, but that may have been coincidence. I need to take the time to do a bit more testing.
Meanwhile, I just tried using the Unlock Trigger like this:
Mac → Thunderbolt 3 to hub → HDMI → Monitor 1
Mac → USB-C to HDMI adapter → HDMI to DVI adapter → Monitor 2
This is good to know and might help me narrow down the cause of the issue. I'd like to find a solution that doesn't involve unplugging any hardware, but I'll have to see how I get on.
Do an image detect on the top-left corner of the main screen -- if there's an Apple logo then you've unlocked, if there isn't then put the computer back to sleep.
I'm assuming if you unlock it you then do something, not go straight to screensaver!
You've probably been through all this, but does the timestamp on your wake events not give you any clue as to what's causing it? Have you tried turning Power Nap off? Does this happen every night, or just occasionally?
Yes, I know. You don't even imagine all the things I've done to find the culprit. Take it easy. And don't forget, if you just press this red button before you go to bed, you'll save electricity, money and help the climate.
Yep, but then go the next step and use the timestamps from that to search for events around the wake events. Many can be disregarded -- waking up will result in a network event, a calendar sync, etc -- but you might see something that stands out.