@ -26,6 +26,8 @@ Note: You'll get a Windows Smartscreen warning because the code was self signed.
### Standalone
### Standalone
You'll need [.NET 5 Runtime](https://dotnet.microsoft.com/download/dotnet/current/runtime) installed.
If you don't want to use the installer, you can find the standalone version releases on GitHub [here](https://github.com/sleevezipper/hass-workstation-service/releases). Unpack all files to a folder and run `hass-workstation-service.exe`. This is the background service and you can use `UserInterface.exe` to configure the service. There is no automatic (or prompted) updating in the standalone version.
If you don't want to use the installer, you can find the standalone version releases on GitHub [here](https://github.com/sleevezipper/hass-workstation-service/releases). Unpack all files to a folder and run `hass-workstation-service.exe`. This is the background service and you can use `UserInterface.exe` to configure the service. There is no automatic (or prompted) updating in the standalone version.
### Updating
### Updating
@ -58,14 +60,11 @@ This sensor exposes the name of the currently focused window.
### WebcamActive
### WebcamActive
This sensor shows if the webcam is currently being used. It has two detection modes:
This sensor shows if the webcam is currently being used. It uses the Windows registry to check will work from Windows 10 version 1903 and higher.
- Registry - this is the preferred method. This will work from Windows 10 version 1903 and higher.
- OpenCV - this method tries to access the webcam and if that fails, it assumes it is currently in use. This will flash the webcam activity light at every update interval. It also uses more CPU cycles and memory.
### MicrophoneActive
### MicrophoneActive
This sensor shows if the microphone is currently being used. It uses the Windows registry to check and wil work from Windows 10 version 1903 and higher.
This sensor shows if the microphone is currently being used. It uses the Windows registry to check and will work from Windows 10 version 1903 and higher.
### CPULoad
### CPULoad
@ -103,6 +102,10 @@ which results in `4008` for my PC.
You can use [WMI Explorer](https://github.com/vinaypamnani/wmie2/tree/v2.0.0.2) to find see what data is available.
You can use [WMI Explorer](https://github.com/vinaypamnani/wmie2/tree/v2.0.0.2) to find see what data is available.
### IdleTime
This sensor returns the amount of seconds the workstation has been idle for. It starts counting the moment you stop typing or moving your mouse.
### Dummy
### Dummy
This sensor spits out a random number every second. Useful for testing, maybe you'll find some other use for it.
This sensor spits out a random number every second. Useful for testing, maybe you'll find some other use for it.
<TextBlock TextWrapping="Wrap" MaxWidth="300" FontStyle="Italic" IsVisible="{Binding ShowWindowNameInput}" Margin="0 0 0 10">This is case-insensitive and loosely matched. A window called "Spotify Premium" will match "spotify" or "premium".</TextBlock>
<TextBlock TextWrapping="Wrap" MaxWidth="300" FontStyle="Italic" IsVisible="{Binding ShowWindowNameInput}" Margin="0 0 0 10">This is case-insensitive and loosely matched. A window called "Spotify Premium" will match "spotify" or "premium".</TextBlock>
<TextBox IsVisible="{Binding ShowWindowNameInput}" Text="{Binding WindowName}" Watermark="Visual Studio Code" HorizontalAlignment="Left" MinWidth="300"/>
<TextBox IsVisible="{Binding ShowWindowNameInput}" Text="{Binding WindowName}" Watermark="Visual Studio Code" HorizontalAlignment="Left" MinWidth="300"/>
#pragma warning disable CA1416 // Validate platform compatibility. We ignore it here because this would never happen. A cleaner solution may be implemented later.
/// Enable or disable autostarting the background service. It does this by adding the application shortcut (appref-ms) to the registry run key for the current user
/// Enable or disable autostarting the background service. It does this by adding the application shortcut (appref-ms) to the registry run key for the current user
@ -4,10 +4,13 @@ using System.Collections.Generic;
usingSystem.Globalization;
usingSystem.Globalization;
usingSystem.Linq;
usingSystem.Linq;
usingSystem.Management;
usingSystem.Management;
usingSystem.Runtime.Versioning;
usingSystem.Text;
usingSystem.Text;
namespacehass_workstation_service.Domain.Sensors
namespacehass_workstation_service.Domain.Sensors
{
{
[SupportedOSPlatform("windows")]
publicclassCPULoadSensor:WMIQuerySensor
publicclassCPULoadSensor:WMIQuerySensor
{
{
publicCPULoadSensor(MqttPublisherpublisher,int?updateInterval=null,stringname="CPULoadSensor",Guidid=default):base(publisher,"SELECT PercentProcessorTime FROM Win32_PerfFormattedData_PerfOS_Processor",updateInterval??10,name??"CPULoadSensor",id)
publicCPULoadSensor(MqttPublisherpublisher,int?updateInterval=null,stringname="CPULoadSensor",Guidid=default):base(publisher,"SELECT PercentProcessorTime FROM Win32_PerfFormattedData_PerfOS_Processor",updateInterval??10,name??"CPULoadSensor",id)
publicMemoryUsageSensor(MqttPublisherpublisher,int?updateInterval=null,stringname="WMIQuerySensor",Guidid=default):base(publisher,"SELECT FreePhysicalMemory,TotalVisibleMemorySize FROM Win32_OperatingSystem",updateInterval??10,name,id)
publicMemoryUsageSensor(MqttPublisherpublisher,int?updateInterval=null,stringname="WMIQuerySensor",Guidid=default):base(publisher,"SELECT FreePhysicalMemory,TotalVisibleMemorySize FROM Win32_OperatingSystem",updateInterval??10,name,id)