Align results and substitute Units

Forums Desktop Info Align results and substitute Units

Viewing 2 reply threads
  • Author
    Posts
    • #3913
      Avatarmila007
      Participant

      Hello Glenn,

      I want to show Fan Speeds and temperatures of my HP Laptop in DesktopInfo.

      The following Powershell command:

      PS C:\windows\system32> wmic /NAMESPACE:\\root\HP\InstrumentedBIOS path HPBIOS_BIOSNumericSensor get Name,CurrentReading,BaseUnits,CurrentState

      gives me all I want:

          BaseUnits  CurrentReading  CurrentState  Name                           
          19         2101            Normal        CPU Fan                        
          19         2318            Normal        GPU Fan                        
          2          49              Normal        CPU Temperature                
          2          43              Normal        Discrete Graphics Temperature  
          2          43              Normal        Remote Temperature             
          2          43              Normal        Local Temperature              
          2          24              Normal        Battery Temperature      

      I try to make DesktopInfo present these results as follow:

          CPU Fan       			2101 RPM     Normal                                
          GPU Fan          			2318 RPM     Normal                                
          CPU Temperature  			  49 °C      Normal              
          Discrete Graphics Temperature	  43 °C      Normal         
          Remote Temperature 			  43 °C      Normal                    
          Local Temperature			  43 °C      Normal                    
          Battery Temperature			  24 °C      Normal          

      My actual DesktopInfo Configuration is:

      WMI=interval:5,text:CPU Temp,namespace:\root\HP\InstrumentedBIOS,query:HPBIOS_BIOSNumericSensor, display: %Name% %CurrentReading% %BaseUnits% %CurrentState%

      Questions:
      1. How do I replace the “BaseUnits value” by the “actual Unit”: 19 with RPM, 2 with °C ?
      2. How do I align the results as shown above?

      Many thanks in advance for your wise advises, because all my trials have failed so far.

      Kind Regards,

      Michel

      • This topic was modified 5 days, 14 hours ago by GlennGlenn.
      0
    • #3915
      GlennGlenn
      Keymaster

      1. A fixed width font will allow you to line up the columns. Possibly put %Name% in the row-text option: row-text:%name%, display:%CurrentReading% %BaseUnits% %CurrentState%

      2. If I understand this correctly, the %BaseUnits% column returns a number such as 2, 19 to represent Celsius and RPM. For this you can use a lookup table. Example:

      set=key:baseunit_2,value:°C
      set=key:baseunit_19,value:RPM
      WMI=interval:5, namespace:\root\HP\InstrumentedBIOS, query:HPBIOS_BIOSNumericSensor, row-text:%Name%, display: %CurrentReading% %baseunit_%BaseUnits%% %CurrentState%

      notice how the wmi returned column name is embedded in a user variable, first the embedded wmi column %BaseUnits% is replace by the actual numeric value then the resulting user variable, %baseunit_2% is replaced by it’s value °C etc….

      I haven’t tested this cos I don’t have a HP machine available. Good luck!

      +1
    • #3918
      Avatarmila007
      Participant

      MANY THANKS !!!

      Your proposal works perfectly:
      WMI=interval:5, namespace:\root\HP\InstrumentedBIOS, query:HPBIOS_BIOSNumericSensor, row-text:%Name%, display: %CurrentReading% %baseunit_%BaseUnits%% %CurrentState%

      Keep on good work and thank you for prompt answer.
      Michel

      +1
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
Glenn's Page