sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
615 stars 53 forks source link

using more windows users. #45

Open ReneTode opened 3 years ago

ReneTode commented 3 years ago

i got 2 users on my PC. i installed this service with my own administrator account. the active window sensor works great on that account.

then i switched to the other user (non administrator) and the active window sensor doesnt show anything. even making that user administrator doesnt help.

i even tried to install this service on that account also, but then it gets the same settings, as the first install.

it would be nice if i could have an active window sensor for each user, or at least a sensor that shows for all users. would also be nice to have a sensor that shows which user is active.

sleevezipper commented 3 years ago

Hi @ReneTode! Thank you for creating an issue. This is a use case I have thought about and to be honest, I assumed this would just work. I can think of a few things that could cause this but I'll have to do some more research.

ReneTode commented 3 years ago

thx for looking into it. would it also be possible to add a sensor that shows the active user?

ReneTode commented 3 years ago

i guess i would have needed to read your readme better ;) found out how to expose the user with the wmiquery sensor.

sleevezipper commented 3 years ago

Nice! How did you do that? Might be nice to post it here!

ReneTode commented 3 years ago

you already got it in your readme ;)

SELECT username FROM Win32_ComputerSystem

but i didnt check if it also showed other users, then my first install.

edit: i did check now and it gives the active user like:

PCname\username

but it uses only the first 5 characters from the account. the same way as it gives the name in c:\users