HASS.Agent icon indicating copy to clipboard operation
HASS.Agent copied to clipboard

Bug: LoggedUser does not save or work

Open shuntfield opened this issue 2 years ago • 1 comments

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):

  • [x] Installed via installer
  • [ ] Installed manually
  • [x] Problem occurs in HASS.Agent
  • [x] 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 [email protected]

shuntfield avatar Sep 20 '22 15:09 shuntfield

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

shuntfield avatar Sep 20 '22 15:09 shuntfield

Did it work, problem solved?

LAB02-Admin avatar Sep 22 '22 07:09 LAB02-Admin

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!

shuntfield avatar Sep 22 '22 10:09 shuntfield

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.

LAB02-Admin avatar Sep 29 '22 08:09 LAB02-Admin

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

shuntfield avatar Sep 29 '22 12:09 shuntfield

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

LAB02-Admin avatar Oct 27 '22 11:10 LAB02-Admin

@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 avatar Oct 27 '22 11:10 shuntfield

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!

shuntfield avatar Oct 27 '22 13:10 shuntfield

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.

blair287 avatar Oct 30 '22 01:10 blair287

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

LAB02-Admin avatar Nov 01 '22 12:11 LAB02-Admin

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 👍🏻

shuntfield avatar Nov 01 '22 13:11 shuntfield

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

LAB02-Admin avatar Nov 09 '22 16:11 LAB02-Admin

@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!

shuntfield avatar Nov 09 '22 17:11 shuntfield