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: LoggedUser does not save or work #168

Closed
3 of 4 tasks
shuntfield opened this issue Sep 20, 2022 · 13 comments
Closed
3 of 4 tasks

Bug: LoggedUser does not save or work #168

shuntfield opened this issue Sep 20, 2022 · 13 comments

Comments

@shuntfield
Copy link

shuntfield commented Sep 20, 2022

Please make sure your bug isn't already listed on HASS.Agent's issue tracker:

https://lab02research.youtrack.cloud/

There's a list of open bugs & features on the right. On the left you can see what's being worked on, what's planned and what's ready for the next release.

If you're not sure, don't worry, just go ahead and we'll discuss :)


Describe the bug
Adding the sensor "LoggedUser" in the satellite service doesn't seem to work, when I add it it generates an error in the log, and although it appears added nothing is sent via MQTT and when you exit and return to the Satellite Service Config page, the sensor is gone. Readding it results in the same.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Satellite Service Config, Sensors.
  2. Add new sensor "LoggedUser"
  3. Send and Activate Sensors
  4. Exit back to desktop
  5. Repeat step one
  6. Sensor is missing.

Expected behavior
Expect the sensor to return the value of the current logged in user, if no user is logged in "SYSTEM"
If the same sensor is added in hass agent, it saves but the output is meaningless, because the sensor does not work when a user is not logged in, and also it does not change when the user is changed.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Misc info (please complete the following information):

  • image
  • Windows' UI language: English International
  • HASS.Agent version: 2022.12.0

Please check what's applicable (multiple answers possible):

  • Installed via installer
  • Installed manually
  • Problem occurs in HASS.Agent
  • Problem occurs in Satellite Service

Additional context
Add any other context about the problem here.
log.txt

Logs
If possible, please provide the logs of HASS.Agent and - if applicable - the Satellite Service. You can find HASS.Agent's logs by going to the main window, then Configuration -> Logging -> open logs folder. The Satellite Service's logs are in the same window, but the Satellite Service tab -> open service logs folder. If you want, you can mail them to lab02research@outlook.com

@shuntfield
Copy link
Author

Please hold...
I just found the latest Beta and I am testing, it may be fixed!

@LAB02-Admin
Copy link
Member

Did it work, problem solved?

@shuntfield
Copy link
Author

shuntfield commented Sep 22, 2022

Thanks for coming back to me!

I'm not sure, at the moment, only because I'm not certain that the "loggeduser" returns the user thats logged in. I'm looking to
use HASSagent as a replacement for IOT Link, and the features that I use are not exactly replicated in HASSagent.

Namely, I want to know what user is signed on, I have automations based on the user logged in, and SYSTEM which appears in IOT Link when the log on screen is displayed, and also IOT link has immediate shutdown, hibernate and restart scripts with when run immediately perform the action requested. I've done the immediate shutdown with a custom command shutdown /p /f the others I cannot replicate.

Logged user just shows this:
Just the name of the machine.
image

and not the user, and loggedusers shows this:
image

If someone else logs on then it adds them to the list.

I explictly want to know the user, that is logged in and using the machine, so I don't know if thats possible.

It seems to work better on the beta though, although I'm getting a few exception errors and its crashed a couple of times.

Thanks!

@LAB02-Admin
Copy link
Member

Can you send me the exceptions?

I agree that it's useful to know who's actually using the machine, might need to make a seperate sensor for that.

@shuntfield
Copy link
Author

Its only done it a couple of times after I installed the beta, I will try and find them and send them along.

@LAB02-Admin
Copy link
Member

Hey @shuntfield, is this still an issue with the latest release?

@shuntfield
Copy link
Author

@LAB02-Admin I haven't had chance to check yet, I don't know if I am configuring the satellite sensor right.
I want it to show the current user, it shows all users that are logged on but not the current user, is that correct?

@shuntfield
Copy link
Author

I'm not sure that I am configuring the sensor correctly or if HASS Agent does what I want it to do:

image

The Top one is the Satellite service, it shows what users are actually logged into the machine, the bottom one is IOT Link.

What IOT Link shows is the user that is currently using the machine, if its on the login screen then it shows "system" so if you look at the coloured bands, you see on IOT link Purple which is "system" and Magenta which is "Home User" and "graha" when I am logged in on HASS satellite as I am logged in and also home user I get both, not just one.

It might be useful in another context but I only want to see what actual user is using the computer.

If that makes sense!

The Exception error hasn't appeared since the first time I got one.

Hope this helps!

@blair287
Copy link

Yea I'm getting same behaviour shows pc name not the user when used at satellite sensor.

The local sensor works OK but only works for who installed hassagent

If another user logs in the locals show nothing.

@LAB02-Admin
Copy link
Member

You're right @shuntfield, I forgot the actual-logged-on part, created a ticket so I won't forget: hassagent-166

Thanks @blair287, I'll look into that as well

@shuntfield
Copy link
Author

You're right @shuntfield, I forgot the actual-logged-on part, created a ticket so I won't forget: hassagent-166

Thanks @blair287, I'll look into that as well

Great stuff 👍🏻

@LAB02-Admin
Copy link
Member

Should be fixed in the latest beta if you want to test:
https://github.com/LAB02-Research/HASS.Agent/releases/tag/2022.14.0-beta1

@shuntfield
Copy link
Author

shuntfield commented Nov 9, 2022

@LAB02-Admin yup just tested it, "LoggedUser" and it works fine, it swaps to "None" when no user is logged in, but that is fine, I can use that - great stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants