@ -90,6 +90,14 @@ This sensor shows if the microphone is currently being used. It uses the Windows
This sensor checks the current CPU load. It averages the load on all logical cores every second and rounds the output to two decimals.
### GPULoad
This sensor returns the current GPU load. This should work for both NVidia and AMD GPU's.
### GPUTemperature
This sensor returns the current temperature of the GPU in °C. This should work for both NVidia and AMD GPU's.
### UsedMemory
This sensor calculates the percentage of used memory.
@ -149,13 +157,24 @@ This sensor returns the current session state. It has the following possible sta
|InUse|A user is currently logged in.|
|Unknown|Something went wrong while getting the status.|
### CurrentVolume
This sensor returns the volume of the currently playing audio. So if you're listening to music and you pause, this sensor will return 0 (or at least a very low value).
|State|Explanation|
|---|---|
|Locked|All user sessions are locked.|
|LoggedOff|No users are logged in.|
|InUse|A user is currently logged in.|
|Unknown|Something went wrong while getting the status.|
### Dummy
This sensor spits out a random number every second. Useful for testing, maybe you'll find some other use for it.
## Commands
Commands can be used to trigger certain things on the client. For each command, a switch will be available in Home Assistant. Turning on the switch fires the command on the client and it will turn the switch off when it's done. Turning it off will cancel thje running command.
Commands can be used to trigger certain things on the client. For each command, a switch will be available in Home Assistant. Turning on the switch fires the command on the client and it will turn the switch off when it's done. Turning it off will cancel the running command.
### ShutdownCommand
@ -178,3 +197,30 @@ This command allows you to run any Windows Commands. The command will be run in
|Rundll32.exe user32.dll,LockWorkStation|This locks the current session.|
|shutdown /s /t 300|Shuts the PC down after 5 minutes (300 seconds).|
|C:\path\to\your\batchfile.bat|Run the specified batch file.|
### KeyCommand
Sends a keystroke with the specified key. You can pick [any of these](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) key codes.
### Media Commands
There's several media commands available which are very self exlanatory.
- Play/Pause
- Next
- Previous
- Volume up
- Volume down
- Mute (toggle)
## Credits
This project depends on work done by others and they should at least get a mention. Please note that this list is not complete yet.
// this can fail sometimes, that's why we set numberOfUserDesktops to 1
try
{
using(varmanagementObjectSearcher=newManagementObjectSearcher(scope,newSelectQuery("select * from win32_Perfrawdata_TermService_TerminalServicesSession")))
{
numberOfUserDesktops=managementObjectSearcher.Get().Count-1;// don't count Service desktop
}
}
catch
{
}
varnumberOfLogonSessionsWithExplorer=newManagementObjectSearcher(scope,newSelectQuery("SELECT * FROM Win32_SessionProcess")).Get()
varnumberOfUserDesktops=newManagementObjectSearcher(scope,newSelectQuery("select * from win32_Perfrawdata_TermService_TerminalServicesSession")).Get().Count-1;// don't count Service desktop