Working out when to send or not send alerts is quite complex and still being tweaked. It is never perfect.

The Buerau of Meteorology publishes current height data which I download and maniplate. This done every 15 minutes to match their updates, the data is stored in the database.

Every 3 minutes the FloodWatch page refreshes and looks at the last 5 height readings to get an average height. If the average is lower than the current height the creek is rising, if higher, it is falling. Does that make sense so far?

Also stored in the database are some important values to make a decision on how to treat the most recent reading: the height at which to send out alerts, the height at which it is clear, the maximum height this event and whether an alert has been sent.

In short, if the creek is rising and reaches the warning level, alerts are sent out and that fact is saved. As the creek continues to rise the system checks "has an alert been sent yet?" if so, it does nothing except update the maximum height for this flood event, if it has increased. It also compares the height to the record height and if it is a new record it updates the height, date and time

When the weather event is over, everything is reset to wait for next time.

That's it.

Has FloodWatch helped you out? A lot of time has been spent getting it right and it costs for every SMS sent.