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
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?

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.
Map event script to temperature value, change 1/1/1 to setpoint object address:

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)
  storage.set('alerted', false)
How can I activate a sound on the screen with an object = 1 and deactivate with an object = 0

You can use custom JS like this sample:

Or you the alert manager app.



Forum Jump: