15.09.2022, 11:33
hello
I need to send a notification to telegram that a certain wind speed threshold has been exceeded.
To get started, create the following script as a proof of principle
The problem is that while the wind alarm signal is above the threshold, notifications are sent continuously, I only want it to be sent once and require user action to dismiss the alarm.
How could I do it?
Thank you
I need to send a notification to telegram that a certain wind speed threshold has been exceeded.
To get started, create the following script as a proof of principle
Code:
require("user.Telegram") -- Requiere la librería de usuario
valor_actual_viento = grp.getvalue('1/0/3')
valor_umbral_viento = grp.getvalue('32/1/7')
if valor_actual_viento >= valor_umbral_viento then
message = 'Alarma de viento ' ..valor_actual_viento.. 'm/s' -- Texto del mensaje a enviar
telegram(message) -- Se pasa a la biblioteca de usuario el mensaje
log(message)
end
The problem is that while the wind alarm signal is above the threshold, notifications are sent continuously, I only want it to be sent once and require user action to dismiss the alarm.
How could I do it?
Thank you