I have a home office with an IP phone powered over PoE via a 48 port Unifi switch. I also have a 3 year old that likes to play telephone. To prevent my 3 year old from making business calls I want HA to turn off the phone when my computer is locked. I know I can turn it off with my Unifi integration but I haven’t found a way to tell if my Windows 10 machine (separate from my HA server) is locked. I did try IoTLink and, while it works well, it doesn’t include a lock sensor. It can tell me what user is signed in, but I’d have to log out of my Windows 10 machine in order to get the state to change. Logging out closes all my apps on the Windows machine, so that’s not an option.
Does anyone know how I can get my Windows 10 desktop lock/unlock state in HA?
This sensor watches the UserNotificationState. This is normally used in applications to determine if it is appropriate to send a notification but we can use it to expose this state. Notice that this status does not watch Focus Assist. It has the following possible states:
State
Explanation
NotPresent
A screen saver is displayed, the machine is locked, or a nonactive Fast User Switching session is in progress.
and
SessionState
This sensor returns the current session state. It has the following possible states: