H2 detect if computer is unlocked for presence detection?

I would like to automatically turn on my digital thermostat in my office while working at the computer. No need to detect typing. When the screen is unlocked, it should count as “I am here”.

What would be the best way to detect this?

I’m using uptime kuma to detect is my laptop on. If it is on than my bedroom lamp is on if brightness level is lower that x.
I don’t know can you detect screen lock or unlock. Maybe if you have some program on comp that will detect this and send data to home assistant.

1 Like

Thanks, Daniel. I have macOS, which doesn’t seem to be supported by Uptime Kuma, unfortunately, but the app looks quite cool.

I could link the screen to a smart plug and measure the energy consumption, I guess, but a software solution would be preferable.

No, you got me wrong. Uptime kuma is ha addon or container what ever and its installed in home assistant. Once you set it up it creates entities for tracking what ever you wanna track. In it you can set up various trackers. One of the usage is to check is my laptop is online.

1 Like

Ah, alright, thanks for the clarification. I just installed it and now I guess have to figure out how it can figure out if my screen is on or off.

In the meantime, I configured a smart plug that I had lying around and that has an inbuilt power meter. When the power is low, that means it’s off and vice versa. This then triggers an automation to turn off the heater. Work beautifully but would love to do it without hardware, of course.

Uptime kuma can track mqtt topics. If you can find somewhere program that detects if the screen is on or off with mqtt capability you probably can integrated this as mqtt device and use those topics for detection and automation.
But I’m not sure for the process or will this work. Theoretically probably it will.

1 Like

Ok, maybe someone here sees this thread and can share his experience doing this.