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.

Trends average by Schedule (month,year)
#2
Create a virtual object with the same data type as the object you want to log. Then attach an event script to the source object that will write the real value between 7:00 and 19:59, and 0 otherwise. Trend log must be attached to the virtual object.

Event script, change virtual object address (32/1/1) as needed:
Code:
hour = os.date('*t').hour
if hour >= 7 and hour < 20 then
  value = event.getvalue()
else
  value = 0
end

grp.checkupdate('32/1/1', value)
Reply


Messages In This Thread
RE: Trends average by Schedule (month,year) - by admin - 12.04.2021, 08:25

Forum Jump: