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
  Embedding python script into html via pyscript pyscript_dude 7 1,451 Apr-16-2023, 11:17 PM
Last Post: pyscript_dude
  C++ python embedding comarius 0 803 Aug-26-2022, 02:01 AM
Last Post: comarius
Question Embedding a python file online Dreary35 0 1,476 Jun-10-2021, 05:05 PM
Last Post: Dreary35
  Embedding return in a print statement Tapster 3 2,232 Oct-07-2019, 03:10 PM
Last Post: Tapster
  Calling Extended Embedding Python as shared library jibarra 0 2,185 Jul-19-2019, 05:22 PM
Last Post: jibarra
  More Python Embedding Trouble jibarra 3 2,871 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Python Embedding jibarra 4 2,959 Jul-11-2019, 03:25 PM
Last Post: jibarra
  Embedding or adding IDE like "repl" inside Flask app sray 1 2,191 Jul-03-2019, 03:13 PM
Last Post: nilamo
  Embedding Python into a simulator siggi 0 2,166 Apr-24-2019, 07:42 PM
Last Post: siggi
  Embedding, windows, and virtual environments mariofutire 0 2,996 Sep-14-2018, 10:30 AM
Last Post: mariofutire

Forum Jump:

User Panel Messages

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