Hi!
You could use FOSHKplugin and/or Weewx to feed MQTT broker with events
Although FOSHKplugin cannot (yet) handle user-specific push notifications (I'm still thinking about how to implement a configuration option), any data manipulation is possible with the
Exec function.
So you could just start a small script that checks the output data of the weather station for exceeding/falling below threshold values before the actual transmission and then sends a push notification if necessary.
However, it probably makes more sense to use the individual queries (getvalue) straight away.
If I wanted to be warned when the temperature falls below a certain limit (I use FOSHKplugin), I would simply install a cron job that queries the corresponding temperature at intervals and warns if the temperature falls below it with email, SMS, push notification or Alexa voice output.
Here is an example for the outside temperature:
cron:
*/5 * * * * root /usr/local/bin/checkTemp.sh
And the actual bash script, which is started every 5 minutes via cron. Of course, you can change the interval as you like.
checkTemp.sh:
#!/bin/bash
# generate a push notification via Pushover when the outside temperature is undershot or exceeded (demo)
# Pushover settings
po_token='YOURPUSHOVERTOKEN' # Pushover API token
po_user='YOURPUSHOVERUSER' # Pushover user name
po_title='checkTemp.sh-Warning' # Pushover message title
po_message='' # Pushover message - will be filled later
# thresholds
temp_min_thrs=5.5 # temperature min threshold
temp_max_thrs=25.5 # temperature max threshold
# main
tempc=`curl -s http://192.168.15.236:8080/getvalue?key=tempc` # retrieve temperature in °C (use tempf for °F)
if [[ ! -z "$tempc" ]]; then # make sure of value
if (( $(echo "$tempc < $temp_min_thrs" |bc -l) )); then # if current temp < min threshold do:
# outdoor temperature min
po_message="outdoor temperature (${tempc}°C) is below ${temp_min_thrs}°C!"
#echo $po_message # remove for cron
curl -s -o /dev/null --form-string "token=${po_token}" --form-string "user=${po_user}" --form-string "title=${po_title}" --form-string "message=$po_message" https://api.pushover.net/1/messages.json
elif (( $(echo "$tempc > $temp_max_thrs" |bc -l) )); then # if current temp > max threshold do:
# outdoor temperature max
po_message="outdoor temperature (${tempc}°C) is higer than ${temp_max_thrs}°C!"
#echo $po_message # remove for cron
curl -s -o /dev/null --form-string "token=${po_token}" --form-string "user=${po_user}" --form-string "title=${po_title}" --form-string "message=$po_message" https://api.pushover.net/1/messages.json
fi
fi
What is still missing here is a routine to avoid permanent push notifications - otherwise a corresponding message would be issued every 5 minutes if the temperature value is outside the threshold values.
Oliver