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

Throttle update interval of pulse meter and total/daily consumption #269

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

naofireblade
Copy link
Contributor

@naofireblade naofireblade commented Jan 25, 2023

This PR does 2 things:

  1. It throttles the update interval of the power pulse meter. On power meters with e.g. 10000 pulses/kWh you will get permanent sub second sensor updates that are pushed to home assistant and add a strain to the history recorder. In this solution the average pulse meter result of the last 10s is calculated and sent to home assistant. If no update occurs nothing is send (filter_out: nan).

  2. It throttles the update of the daily and total consumption sensors to 60s. Here not via average but via heartbeat filter (last sensor value is sent). That interval should be more then enough for a total consumption sensor.

@naofireblade naofireblade changed the title Throttled update interval of power sensors Throttle update interval of pulse meter and total/daily consumption Jan 25, 2023
@klaasnicolaas klaasnicolaas added the enhancement Enhancement of the code, not introducing new features. label Jan 25, 2023
@klaasnicolaas
Copy link
Owner

Looks good, I'll test it on one of my glows first to see how much it might affect a pulse rate of 1000.

After the previous change the led would flash only when a value is sent to home assistant (max. every 10s). Now the led will flash every time a power meter flash is registered.
@github-actions
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Feb 26, 2023
@klaasnicolaas klaasnicolaas added no-stale This issue or PR is exempted from the stable bot. and removed stale There has not been activity on this issue or PR for quite some time. labels Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features. no-stale This issue or PR is exempted from the stable bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants