Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: LoggedUserSensor sensor shows wrong value if logged in as another user #38

Closed
bverkron opened this issue Mar 9, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bverkron
Copy link

bverkron commented Mar 9, 2022

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.

@bverkron bverkron 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 Mar 9, 2022
@LAB02-Admin
Copy link
Member

LAB02-Admin commented 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

@LAB02-Admin LAB02-Admin self-assigned this Mar 9, 2022
@LAB02-Admin LAB02-Admin added the bug Something isn't working label Mar 9, 2022
@LAB02-Admin LAB02-Admin 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 Mar 9, 2022
@bverkron
Copy link
Author

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
Copy link
Member

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 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.

Let me know what you think!

@LAB02-Admin
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants