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

Adding thresholds between levels #1

Open
ArielAlmog opened this issue Dec 6, 2021 · 3 comments
Open

Adding thresholds between levels #1

ArielAlmog opened this issue Dec 6, 2021 · 3 comments

Comments

@ArielAlmog
Copy link

Hi Avi

First of all, let me thank you for this project. Really nice and useful.

I have an idea to add a thresholds check which will disable toggle between close states, if the avg compared to last_avg is less than some value, e.g. 10%

For example, if reading records are 10,11,10 current code will return Good, Fair, Good
if threshold are used, since 11 is close to 10 it will remain Good

The code change will require keeping old_avg and comparison somewhere near line #70

Ariel

@avimak
Copy link
Owner

avimak commented Dec 7, 2021

hey @ArielAlmog , tnx for the feedback. I see your point.

On one hand, sure - a threshold will lead to less states toggling, but on the other hand it will make the broadcasted channel less accurate, and for some users (i.e. heavily asthmatic people) the difference between states - even a close one - could be meaningful.

Please note that messages within the last "dangerous" state range are being sent silently (line 91, line 97), so the user isn't interrupted by incoming notifications unless crossing the "dangerous"/"not dangerous" threshold (avg = 21) .
Could this be a satisfying mitigation for keeping interruption low while the channel is still accurate? let me know what you think.

@ArielAlmog
Copy link
Author

Good morning Avi

Thanks for the reply. current solution is satisfying. no need for a change.

I don't see the raw data and hence cannot tell whether the updates contains close results which toggle the states or not. I guess that you can log it and check it.
It will be interesting to see the real measurement for two hours starting at 18:38 last evening

Ariel

@avimak
Copy link
Owner

avimak commented Dec 7, 2021

You can see the data (+ history) over PurpleAir map, i.e. here

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