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 whether you accept or reject these cookies being set.

Alert message function
#1
Dear All,
I would like to write an alert everytime temperature is >= a setpoint.

I can use event base script or resident script but in both case alert message will appear everytime the temperature change or every base time set as resident script.

I would like to log alert only when temperature surpasses set point for the first time and not going on to send alert message. If temperature remains above set point for 1 day alert must be only 1.

What do you suggest?

Thanks.
Reply
#2
You can compare current temperature with setpoint in temperature event-based script, but you must keep last value(or threshold) in storage. And when the temperature exceed the threshold then you can send some alert.
Reply
#3
Map event script to temperature value, change 1/1/1 to setpoint object address:

Code:
temperature = event.getvalue()
setpoint = grp.getvalue('1/1/1')

alerted = storage.get('alerted')
if temperature >= setpoint then
  if not alerted then
    alert('temperature is above setpoint')
    storage.set('alerted', true)
  end
else
  storage.set('alerted', false)
end
Reply
#4
Thanks.
Reply
#5
How can I activate a sound on the screen with an object = 1 and deactivate with an object = 0
Reply
#6
Hi,

You can use custom JS like this sample: https://forum.logicmachine.net/showthrea...20#pid7920

Or you the alert manager app.

BR,

Erwin
Reply


Forum Jump: