24.09.2022, 11:14
Hello
That's what I thought, but it's the same script as the one proposed but with my variables and addresses.
This is the script
That's what I thought, but it's the same script as the one proposed but with my variables and addresses.
This is the script
Code:
require("user.Telegram") -- Requiere la librería de usuario
local valor_actual_viento = grp.getvalue('1/0/3')
local valor_umbral_viento = grp.getvalue('32/1/7')
local alarma = grp.getvalue('32/2/25')
if ( (valor_actual_viento >= valor_umbral_viento) and not alarma ) then
grp.write('32/2/25', true) -- set alarm true
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)
else
saltado = "saltado"
log(saltado)
end