Logic Machine Forum
Alert message function - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Alert message function (/showthread.php?tid=1116)



Alert message function - Domoticatorino - 28.11.2017

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.


RE: Alert message function - buuuudzik - 28.11.2017

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.


RE: Alert message function - admin - 29.11.2017

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



RE: Alert message function - Domoticatorino - 29.11.2017

Thanks.


RE: Alert message function - davidchispas - 08.06.2019

How can I activate a sound on the screen with an object = 1 and deactivate with an object = 0


RE: Alert message function - Erwin van der Zwart - 09.06.2019

Hi,

You can use custom JS like this sample: https://forum.logicmachine.net/showthread.php?tid=1314&pid=7920#pid7920

Or you the alert manager app.

BR,

Erwin