H
HASS.Agent•7mo ago
koshi

Getting wake lock status into HA

Hi! I am so glad to see someone has adopted this, since the project itself has been a life-saver in so many situations. I am trying to get my wake lock state into home assistant to have one more thing to check to make a decision if the system should be suspended or not - and I did see a powershell sensor has been integrated, which is really helpful for that, because now I just could do an "powercfg -requests | Select-String -Pattern "PROCESS"" or something as a quick hack - unfortunately powercfg requires admin rights and before I break my fingers to work around it: has anyone a better idea how to do it?
Solution:
you can also right click -> properties -> compatibility -> tick run as admin
Jump to solution
16 Replies
HASS.Agent Helper
HASS.Agent Helper•7mo ago
Help us Help Others!
To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution
From An unknown user
HASS.Agent Helper
HASS.Agent Helper•7mo ago
Help us Help You!
Please don't delete messages or posts because it makes it impossible to understand what happened. If you don't want your messages to be seen then don't post here. Please provide us with the version number of your client.
You can find it in the HA device info page after 'Firmware'.
HASS.Agent Helper
HASS.Agent Helper•7mo ago
@Amadeo @DrR0x
barrelltitor
barrelltitor•7mo ago
pretty sure the satellite service has admin privileges? have you tried that? i could be wrong though
Solution
barrelltitor
barrelltitor•7mo ago
you can also right click -> properties -> compatibility -> tick run as admin
DrR0x
DrR0x•7mo ago
the only way to do admin commands is through the task scheduler, i think. Im pretty sure although the sattellite is installed system wide it does no have the ability to run admin commands for security reasons
barrelltitor
barrelltitor•7mo ago
Nope, my way works fine
No description
barrelltitor
barrelltitor•7mo ago
if you run the program as admin it is admin I assumed, and it seems to have the privileges for this at least (This is not satellite, it is via right click -> Properties -> compat -> run as admin )
DrR0x
DrR0x•7mo ago
oh thats good to know ill archive this thread because it doesnt mention this on the old docs
barrelltitor
barrelltitor•7mo ago
wait for koshi to see it, or does it stay here as a notification? I don't know discord very well
DrR0x
DrR0x•7mo ago
oh no, i'll just add it to my list of resources on a separate app 🤣 i wish discord had the ability to do that though
koshi
koshi•7mo ago
I have seen it and can confirm it works - just running the whole hass.agent as admin. Though in an ideal world it could be configured on a case-by-case basis like its done in the windows task scheduler. However, there are probably more important things to implement, since this way is working nicely 🙂 thanks a lot @DrR0x @barrelltitor !
barrelltitor
barrelltitor•7mo ago
I don't know if that's really possible without having hass agent have admin permissions as it would need someone else to escalate If you use software to remote control your computer I'd say that's trust enough to give it admin perms, just be careful not to remotely delete stuff
koshi
koshi•7mo ago
yeah - its either running as admin all the time and dropping the privileges internally for most of the stuff - or requiring the user to give credentials for the specific sensor/command. Which then would need to be saved leading to other problems... another idea would be to integrate an internal sensor for the wake lock without - without the powershell requirement. However, it seems that this information isn't exposed over any documented API...
DrR0x
DrR0x•7mo ago
@Amadeo What's your opinion?
Amadeo
Amadeo•7mo ago
I'll take a look if this can be somehow obtained in userland level On the second topic (service/client and user/admin/system) perms - I've already thought about this (at least moving from system to admin user but that definetly won't happen with 2.X, maybe with 3.X )
Want results from more Discord servers?
Add your server