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 that you accept these cookies being set.

Notification of exceeding wind speed threshold
#2
Hello JRP!

You can make a script for current wind speed object. You will have three objects 1.)current wind speed, 2.)wind speed threshold 3.)alarm (boolean object)

Code:
local wind_current = grp.getvalue('34/1/57')
local wind_treshold = grp.getvalue('34/1/59')
local alarm = grp.getvalue('34/1/60') -- if alarm was already running do not send new telegram

if ( (wind_current >= wind_treshold) and not alarm ) then
  grp.write('34/1/60', true) -- set alarm true
  message = 'Alarm wind speed is ' .. wind_current .. ' m/s'
  log(message)
end

Every time when wind speed changes, script will check the value of wind speed, if it is above threshold value (and alarm was off) it sets alarm object value to true and sends log. Next time if alarm was on (alarm object value was true) it will not send any log (till you unset the alarm object).
Reply


Messages In This Thread
RE: Notification of exceeding wind speed threshold - by RomansP - 15.09.2022, 12:39

Forum Jump: