02.03.2016, 15:14
(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