sleevezipper / hass-workstation-service

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

WMI Query is blank #117

Closed firestrife23 closed 2 years ago

firestrife23 commented 2 years ago

Here's two WMI Queries I ran in powershell is returning value but when I added those to Sensors list and it's returning blank.

C: Drive's Free Space Get-WmiObject -Class Win32_logicaldisk -Filter "DeviceID = 'C:'" | Select-Object @{L='FreeSpaceGB';E={"{0:N2}" -f ($_.FreeSpace /1GB)}}

C: Drive's Capacity Get-WmiObject -Class Win32_logicaldisk -Filter "DeviceID = 'C:'" | Select-Object @{L="Capacity";E={"{0:N2}" -f ($_.Size/1GB)}}

SecretiveShell commented 2 years ago

Can you test these commands in an external app such as WMI explorer to confirm they are valid?

firestrife23 commented 2 years ago

WMI Explorer? I'll give it a try and let you know. I'm certain it's valid because I ran this command in PowerShell and it came back with a value.

pKuEDhVxaGFYBTRz commented 2 years ago

also look at https://github.com/sleevezipper/hass-workstation-service/blob/develop/documentation/WMIQuery.md#wmiquerysensor

sleevezipper commented 2 years ago

You can find an example for free disk space here. Let me know if you can't get it to work!