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.

Alarm missing grp update
#2
Scripts looks ok. How is it set up, as a scheduled script which runs every minute?

It can be written a bit shorter like this, logs might help you to find out why it's not working.
Code:
heartbeat_time = 60 -- Minutes
heartbeat_device_object = '32/1/1' -- Change address to your heartbeat device
heartbeat_alarm_object = '32/1/2' -- Change address to a alarm address

obj = grp.find(heartbeat_device_object)

if obj then
  delta = os.time() - obj.updatetime
  alarm = delta >= heartbeat_time * 60
  log(delta, alarm)
  grp.checkwrite(heartbeat_alarm_object, alarm)
end
Reply


Messages In This Thread
Alarm missing grp update - by Tokatubs - 10.09.2020, 20:49
RE: Alarm missing grp update - by admin - 11.09.2020, 08:40
RE: Alarm missing grp update - by Tokatubs - 11.09.2020, 09:33
RE: Alarm missing grp update - by admin - 11.09.2020, 09:35

Forum Jump: