You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: LoggedUserSensor sensor shows wrong value if logged in as another user #38
If HASS.Agent is installed under user account A which is signed-in in the background but user B is currently logged in and has an active desktop session the LoggedUserSensor reports the name of user A, not user B.
Based on that behaviour I believe that LoggedUserSensor would only ever show the name of the user HASS.Agent is installed under.
I assume this is a side effect of HASS.Agent currently being installed under / tied to a specific user. This will likely be solvable once the 'satellite service' is implemented.
changed the title [-]LoggedUserSensor sensor shows wrong value if another user is logged in.[/-][+]LoggedUserSensor sensor shows wrong value if logged in as another user[/+]on Mar 9, 2022
changed the title [-]LoggedUserSensor sensor shows wrong value if logged in as another user[/-][+]Bug: LoggedUserSensor sensor shows wrong value if logged in as another user[/+]on Mar 9, 2022
Related but slightly different issue with this sensor is that the value of the sensor remains set to the username even when the PC is locked. It's debatable whether this should be the case or not because technically the user is still "logged in" but the intent of this sensor IMO is to show which user has an active desktop session (i.e. is logged into the desktop session and is actively using the PC).
Thinking about the future where we have a "satellite service" and multiple users are supported and multiple users are logged in what should this value be? For example when more than one user is logged in but the PC is locked should it show the username of the last user to have an active desktop session? Should it show something like "system" or "locked"? Hmmmm 🤔
I've been thinking about this as well, and this is what I've come up with so far:
I'm going to make the LoggedUsersSensor more strict: only users with an active session will be listed. Locked means not active, so not listed.
The LoggedUserSensor will be based on the same code, but will always just show one user: if more are logged, it'll take the first.
It's up to the user to decide what they need, I don't think Windows 10/11 even support multiple active (remote desktop) users out of the box, so usually the LoggedUserSensor will do.
The SessionStateSensor can be used to show whether a specific user's session is locked or not.
Activity
[-]LoggedUserSensor sensor shows wrong value if another user is logged in.[/-][+]LoggedUserSensor sensor shows wrong value if logged in as another user[/+]LAB02-Admin commentedon Mar 9, 2022
You're right, that can be fixed with the satellite service. Thanks for posting this though, otherwise I hadn't known :)
hassagent-3
[-]LoggedUserSensor sensor shows wrong value if logged in as another user[/-][+]Bug: LoggedUserSensor sensor shows wrong value if logged in as another user[/+]bverkron commentedon Mar 12, 2022
Related but slightly different issue with this sensor is that the value of the sensor remains set to the username even when the PC is locked. It's debatable whether this should be the case or not because technically the user is still "logged in" but the intent of this sensor IMO is to show which user has an active desktop session (i.e. is logged into the desktop session and is actively using the PC).
Thinking about the future where we have a "satellite service" and multiple users are supported and multiple users are logged in what should this value be? For example when more than one user is logged in but the PC is locked should it show the username of the last user to have an active desktop session? Should it show something like "system" or "locked"? Hmmmm 🤔
LAB02-Admin commentedon Mar 13, 2022
Hey @bverkron,
I've been thinking about this as well, and this is what I've come up with so far:
I'm going to make the
LoggedUsersSensormore strict: only users with an active session will be listed. Locked means not active, so not listed.The
LoggedUserSensorwill be based on the same code, but will always just show one user: if more are logged, it'll take the first.It's up to the user to decide what they need, I don't think Windows 10/11 even support multiple active (remote desktop) users out of the box, so usually the
LoggedUserSensorwill do.The
SessionStateSensorcan be used to show whether a specific user's session is locked or not.Let me know what you think!
LAB02-Admin commentedon Jun 26, 2022
Fixed in the latest beta: https://github.com/LAB02-Research/HASS.Agent/releases/tag/2022.13.0-beta1