I always recommend a standalone external program called occasionally by
cron as the simplest way to do these kinds of things.
Here's a quickie script in bash as an example
#!/bin/bash
# max time since last record in seconds
maxDifference=3600
# timestamp of the last record in the db
lastTimestamp=`echo "select dateTime from archive order by dateTime desc
limit 1;" | sqlite3 weewx.sdb`
# current timestamp
now=`date +%s`
# difference in timestamps
declare -i delta=${now}-${lastTimestamp}
# print it out
echo "lastTimestamp=${lastRecord} now=${now} delta=${delta}"
if test ${delta} -gt ${maxDifference}
then
echo "too long since last record"
# put something here to syslog and/or email
else
echo "last record check within limits"
fi
On Friday, May 12, 2023 at 7:42:35 PM UTC-7 Ryan Stasel wrote:
> Hey All,
>
> Is there a way to have WeeWX send email alerts for when it hasn’t received
> data from the station after X amount of time? My Weatherlink seems to have
> gone offline a few days ago (network dropped, but kept logging data
> thankfully), but I didn’t notice until now.
>
> Is there an option to have it alert? I see alarming for weather conditions
> here: https://github.com/weewx/weewx/blob/master/examples/alarm.py but
> not really anything for “I haven’t gotten any data for X time, or “station
> has gone offline””
>
> Thanks!
>
> -Ryan Stasel
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/d6f7fd3a-066c-442d-90ea-b43020d2bf46n%40googlegroups.com.