This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Get last 20 minutes average value of object
#5
(24.06.2020, 13:53)Daniel Wrote: I updated the script to work with 2 byte float, You have to write value to the object after you start to log it.

I've tried to make this script to calculate average within the current hour, but is unable to make it work.

Have tried to substitute  time= os.time() - pastTime  with  time= os.time() - os.time("%H") and a couple of other formats
but get the following error 
User script:5: bad argument #1 to 'time' (table expected, got string)
stack traceback:
[C]: in function 'time'
User script:5: in main chunk

Also tried to use a GA as a local reference for this where the value at is updated at every new hour.

How can it calculate values from say when time is 22:48, back towards 22:00
Reply


Messages In This Thread
RE: Get last 20 minutes average value of object - by Odd Egil Aasheim - 13.06.2022, 22:03

Forum Jump: