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.

Comparing values over time
#1
I´m looking to debug some issues with floor heating, and was thinking a script comparing two values and notifying me if the value difference is over 2 degrees over a period of 4 hours.

Does anyone have such a script or example? I´m not sure how to store, compare and overwrite the values over time...
Reply
#2
(02.03.2016, 12:36)FatMax Wrote: I´m looking to debug some issues with floor heating, and was thinking a script comparing two values and notifying me if the value difference is over 2 degrees over a period of 4 hours.

Does anyone have such a script or example? I´m not sure how to store, compare and overwrite the values over time...

You can do it in this way:

1. Event-script for both GA's

Code:
delta_status = '1/2/3'
delta = t1-t2
if delta > 2 then
grp.write(delta_status, true)
else
grp.write(delta_status, false)
end


2. Resident-script or Scheduled-script

Code:
delta_status = 1/2/3
delta_table = grp.find(delta_status)

now = os.microtime()
time_max = 4*60*60 -- 4 hours
if (delta_table.updatetime - now) > time_max then
 -- alert function
end
Reply
#3
Thanks! I'll try this out with some testing.
Reply


Forum Jump: