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
#3
(11.09.2020, 08:40)admin Wrote: 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
Was first put in event based. My mistake. Now put into scheduled, but lowest number under minutes seems to be in scheduled script */2, */1 gives error.

It change into alarm. But booleon values written into the heartbeat device dont seem to change the alarm. It just continues to say "True".
Device writes cyclical every 30 sec. And i changed the script down to 1 minutes and the multiplier down to * 1.
Maybe this is to tight.
Log shows this.:
   
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: