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

FeatureRequest: allow sensors to only update once and/or very rarely (Update Interval > 300s) #171

Open NODeeJay opened 2 years ago

NODeeJay commented 2 years ago

I like your HAWS very much and use it also to get some static data or less rarely changing data like BIOS version, serial number, Windows version etc. However WMI queries consume quite some CPU. Therefore after a while the WMI provider host uses ~20% CPU. HASSWKSTSVC

I tried in the UI to add sensors with 600 or 900 seconds but despite I can enter 900 it corrects it down to 300, and also in the config file ("UpdateInterval":900,) but it gets corrected to the max value of 300 as soon as I run the application UI again - what I do not know if it accepts the value when added in the config and just overwrites them when I open the UI.

Any chance to have static sensors that are only queried on startup and/or increase the max value to eg. 3600 seconds? The latter is most probably implemented quite easily.

edit: I checked the code and if I am not totally blind the only reference for the max settings I found in UserInterface/Views/AddSensorDialog.axaml. Can I assume that it will take my 600, 900 or even higher values when I do not alter them in the UI afterwards? If so, the feature in my case can be considered as implemented :-) edit2: It seems that raising most of them in the config to >300 and starting the app afterwards works and the CPU load went down tremendously. I just must not start the GUI or correct the values afterwards.