Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan interval #120

Open
TonyM1958 opened this issue Apr 5, 2023 · 2 comments
Open

Scan interval #120

TonyM1958 opened this issue Apr 5, 2023 · 2 comments

Comments

@TonyM1958
Copy link

Just put a vote in for a review of scan interval settings?

I use 30 seconds for most sensors, with 5 seconds for power sensors.

For example, do we need to scan BMS cell mV high / low every 5 seconds, would 30 seconds suffice?

Should there be !secret scan_interval setting so people can make a global change up or down to the default 30 seconds if they wish?

@TonyM1958
Copy link
Author

TonyM1958 commented Apr 5, 2023

For info, here's an example of what I use to allow the scan_interval to be customised more easily:

In secrets.yaml:

# sensor scans - high = 10 seconds, medium = 1 minute, low = 5 minutes
scan_interval_high: 10
scan_interval_medium: 60
scan_interval_low: 300

In modbusUSB.yaml:

    - name: "PV1 Voltage"
      scan_interval: !secret scan_interval_medium
      slave: 247
      address: 11000
...

I've used the settings as follows:

  • high: power sensors (kw) that drive key dashboard updates. 5 seconds to 30 second updates
  • medium: voltage and current sensors. 1 or 2 minute updates
  • low: temperatures, soc, energy (kwh) and any other that move slowly. 5 to 10 minute updates

You can always over-ride an individual sensor by putting a fixed value directly in the file.

Motivations for this were a) reducing system load and improved reliability for LAN connection b) reduced disk space consumed by database size over time

@canton7
Copy link
Contributor

canton7 commented Apr 16, 2023

Be very very careful here.

If you're using th W610 (and a lot of people are), that's only capable of reading one register every 700ms or so. However, even the default scan_intervals add up to more than this, which means that read tasks just back up inside home assistant (there's no logic to say "Am I trying to do a read already? OK, I won't try again until this is complete").

The moment you start using scan_intervals of 1 or so, you really run up against the limits of the W610. If you even have two sensors with a scan_interval of 1, and no other sensors, that's beyond what the W610 can handle, and tasks are jut going to be backing up in home assistant. You can have ~6 sensors with a scan_interval of 5, and no other sensors at all. And so on.

Unfortunately there's no logging by default to tell you what's happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants