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
#1
Hi 

I am looking for a solution that i need an alarm if a group address is not updated within a certain time. 
Received a script from another user that was working in beginning. But when i tried to change the time down it dont seem to work anymore. 
Any thoughts? Original script below

Code:
heartbeat_time = 60 -- Minutes
heartbeat_device_object = '32/1/2' -- Change address to your heartbeat device
heartbeat_alarm_object = '32/1/3' -- Change address to a alarm address


hb_d_obj = grp.find(heartbeat_device_object)
hb_a_obj = grp.find(heartbeat_alarm_object)

if hb_d_obj then
  local delta = os.time() - hb_d_obj.updatetime
  if delta >= heartbeat_time * 60 and hb_a_obj.value == false then
    grp.write(heartbeat_alarm_object, true)
  elseif delta < heartbeat_time * 60 and hb_a_obj.value == true then
    grp.write(heartbeat_alarm_object, false)
  end
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: