colinodell/python-qnapstats

Feature Request: Polling frequency

oywino opened this issue · 3 comments

Device Model Number:
QTS Version: <4.4.1.1101>

This platform is excellent, but I wish for a config/parameter setting to control the polling frequency. As it is now, I have a feeling that the home-assistant_v2.db file is growing to unnecessary propotions with too much data over time. My questions are;

  1. How often are data polled (pushed) from this platform?
  2. Are all histrotic data really stored in the DB?
  3. Is there a way to reduce the polling frequency? If not, may I request this to be added as a user configurable setting?

Many thanks in advance.

Those are all excellent questions, but this repository doesn't handle those things 🙃 All of the polling and data storage stuff is actually handled by Home Assistant as part of the qnap component. This particular library here only knows how to make a single request for QNAP data when asked - it's up to HA to figure out when to "ask" for that information and what to do with that.

That being said, I did write the corresponding QNAP component a long time ago, but I didn't add any polling functionality myself, which makes me suspect that polling settings are part of the core platform.

As I Googled around to try and find you an answer, I noticed that several components have a interval_seconds setting. I wasn't able to find this setting within the individual components which leads me to believe this is a generic setting that can be applied to any component. This is just a guess, but try adding something like interval_seconds: 60 to your qnap settings in HA and see if that works.

I hope that helps you! Please let me know if it does - if so, I might have to update my configs as well :)

Cheers!

@colinodell, I tried inserting interval_seconds: 60 in various places in-and around the QNAP sensor section, and with various indents, with and without leading dash, but to no avail. Most of the time I got the following error message when testing the config:
Invalid config for [sensor.qnap]: [interval_seconds] is an invalid option for [sensor.qnap]. Check: sensor.qnap->interval_seconds. (See ?, line ?). Please check the docs at https://home-assistant.io/integrations/sensor.qnap/

Any other ideas?

Unfortunately I do not have any other ideas :-/ You may want to reach out to the HASS community directly as this is a bit beyond my experience (and the scope of this repository).

I'm going to close this issue, but if you do find an answer please feel free to drop that info here for others who might also be searching for that solution :)