Aug-13-2020, 04:48 AM
(This post was last modified: Aug-13-2020, 05:30 AM by duckredbeard.)
Happy apolologies if I am not understanding your encouraging words. I don't know what you mean with the "What I meant by "initialize your rolling average", is you might want to set up your "prev_average" value. That way you don't have to special-case the first time you call it. (You've done exactly that)." statement. Or where to plug that in to my program.
I am willing to adjust the keg1scale.py to only check the (keg1) variable value every 30 seconds if it could somehow facilitate the comparison of the current keg1 value to an average of what was observed over the last 5 minutes (which would be the last 10 samples). Once I get something working with what we have available, I can adjust sample number, sample timing to get this function dialed in.
I have slowed down the keg1scale.py to be every 5 seconds instead of the 0.1 in the original code that I had shared. Willing to slow it down some more to facilitate functionality of checking variables to previously observed variables. I still believe comparing the most recent "keg1" variable to an average of recently observed variables is key to reducing false alarms and missed alarms. Since it should take about 7 to 10 seconds for the beer to be served, the average over the previous 5 minutes should be adequate.
If we now check the average every 5 seconds, we should be good, right? Willing to go to 10 to test this. Just need to incorporate the code into the "keg1scale.py" file...
I am willing to adjust the keg1scale.py to only check the (keg1) variable value every 30 seconds if it could somehow facilitate the comparison of the current keg1 value to an average of what was observed over the last 5 minutes (which would be the last 10 samples). Once I get something working with what we have available, I can adjust sample number, sample timing to get this function dialed in.
I have slowed down the keg1scale.py to be every 5 seconds instead of the 0.1 in the original code that I had shared. Willing to slow it down some more to facilitate functionality of checking variables to previously observed variables. I still believe comparing the most recent "keg1" variable to an average of recently observed variables is key to reducing false alarms and missed alarms. Since it should take about 7 to 10 seconds for the beer to be served, the average over the previous 5 minutes should be adequate.
If we now check the average every 5 seconds, we should be good, right? Willing to go to 10 to test this. Just need to incorporate the code into the "keg1scale.py" file...