Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help merging/embedding
#11
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...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Embedding a python file online Dreary35 0 195 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  Embedding return in a print statement Tapster 3 870 Oct-07-2019, 03:10 PM
Last Post: Tapster
  More Python Embedding Trouble jibarra 3 1,135 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 1,335 Jul-11-2019, 03:25 PM
Last Post: jibarra
  Embedding Python into a simulator siggi 0 1,071 Apr-24-2019, 07:42 PM
Last Post: siggi
  Embedding, windows, and virtual environments mariofutire 0 1,488 Sep-14-2018, 10:30 AM
Last Post: mariofutire
  [CPP] Embedding Python and use GDB Razazel 4 2,927 Nov-12-2017, 05:59 PM
Last Post: Razazel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020