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.

Multiple Value true
#8
(25.01.2019, 08:58)admin Wrote: You need to use storage to save current fault state so message is sent only once on status change:
Code:
FAULT1 = grp.getvalue('14/1/34') -- Status FAULT1
FAULT2 = grp.getvalue('13/1/34') -- Status FAULT2

fault_status = storage.get('fault_status', false)

subject = 'FAULT'
message = 'FAULT'

subject1 = 'OK'
message1 = 'OK'

if FAULT1 == 10 or FAULT2 == 10 then
 if not fault_status then
   mail('@', subject, message)
   storage.set('fault_status', true)
 end
else
 if fault_status then
   mail('@', subject1, message1)
   storage.set('fault_status', false)
 end
end

Perfect as always.
Thank you so much.
B.R.
Reply


Messages In This Thread
Multiple Value true - by Gadjoken - 24.01.2019, 14:20
RE: Multiple Value true - by demeur - 24.01.2019, 14:43
RE: Multiple Value true - by admin - 24.01.2019, 15:11
RE: Multiple Value true - by Daniel - 24.01.2019, 15:14
RE: Multiple Value true - by Gadjoken - 24.01.2019, 15:27
RE: Multiple Value true - by Gadjoken - 25.01.2019, 08:40
RE: Multiple Value true - by admin - 25.01.2019, 08:58
RE: Multiple Value true - by Gadjoken - 25.01.2019, 09:19

Forum Jump: