Alarms functionality


 

Benjamin Thibault

TVWBB Member
So maybe this is already possible and I just don't know.

Would it be possible to have the pit alarm be set as a deviation from the current set temp? So if say I have it set at 225 for most of the cook and then ramp it up because it's getting late, or I've wrapped after the stall, or whatever, I don't also have to change the alarms?

Something like if the pit is xx above, trigger. If pit is yy below, trigger.
 

Benjamin Thibault

TVWBB Member
Maybe also give it a setable time delay? So if it goes out of bounds briefly but the Heatermeter reals it back in a few seconds later (maybe a big gust of wind came by? Maybe it's raining?) it won't go off?
 

Steve_M

TVWBB Guru
For the first scenario, seems like it would be easier to just disable the alarms.

This could be also be accomplished via an alarm script that compares the set point to the alarm temp. If set point is greater than the alarm temp, silence the alarm as soon as it fires.

A script could also be used for a time delay that sleeps X seconds, checks the temp and alarms if it's still high.

Have a peek at the Alarm Script Recipes page.
 
Last edited:

Matt Fine

TVWBB Member
Why just disable the alarm or have the script silence it?

You should be able to have the script check the set point and then set new high and low alarm points at your selected differential. Instead of an alarm script, perhaps run it as a cron job to periodically check your set point and auto set the alarms.

You could then use an alarm script to silence any alarm right away, and then check xx seconds later to see if the current temp is still past the threshold, and if so send you an alert. That said, I am not sure how practical this would be. If your pit temp is getting far enough off to trigger an alarm, but the HM is able to recover without you, either your alarm window is too tight or you should probably adjust your PID settings.
 

Matt Fine

TVWBB Member
I have not done this as a cron job yet, but as a test I made a script for pit probe high and pit probe low that check to see if the alarm is on the wrong side of your set point and if so update the new alarms based on your set point.


For the low, I check to see if the set point is above the set point which would happen if you just lowered the set point and it caused an alarm. If so, it re sets the new alarms at +/- 25 degrees from the setpoint.

Code:
#!/bin/sh
if [ "$al_thresh" -gt "$sp" ] ; then
  al_set 0
  NEWLOW=$((sp-25))
  NEWHIGH=$((sp+25))
  lmclient LMST,al,$NEWLOW,$NEWHIGH
fi

For the high alarm, just change -gt to -lt

It seems to be working with two issues. 1) it will only update the alarms if you move your set point more than 25 degrees. Second, there is a brief alarm before it changes the alarm points so if you set up an email, sms, or push notification, you will still get it.

Also, you can make these scripts with the web interface, but it seems like you need to SSH in and manually add execute permissions.
 
Last edited:

Bryan Mayland

TVWBB Hall of Fame
For 2) You can return non-zero (with `exit 1` or whatever) and it will prevent the normal alarms/sms/email from firing.

As far as needing SSH, you need to make sure you check the box that says "Execute on alarm" above the box where you edited the script. It is -x until you check the box, which allows you to have scripts that are inactive without having to delete them entirely.

As someone else pointed out you can also make a cron job to change the alarm ranges on every temp change over 150 degrees like:
Code:
#!/bin/sh

SP_LAST=`cat /tmp/sp`
SP=`lmclient LMGT,sp`

if [ "$SP_LAST" -ne "$SP" -a "$SP" -gt 150 ] ; then
  LOW=$((SP-25))
  HIGH=$((SP+25))
  lmclient LMST,$LOW,$HIGH
  echo $SP > /tmp/sp
fi
 

Matt Fine

TVWBB Member
Hah! I didn't even see that little check box floating up there! Well, that certainly makes it easier.

Thanks for the tip on the exit 1. I didn't realize the script ran before the notification was sent, but that does make sense.
 

Matt Fine

TVWBB Member
After playing with this a bit, I found that the probe 0 temp from my thermocouples fluctuates a lot more at higher temps so I modified this to make the alarms +/- 7.5% so 15* at 200, 45* at 600. I am also resetting after a 10 degree change in SP. I am sure there is a better way to handle the floating point, but I am just working with integers and dividing by 1000. Also, in the above post by Bryan, "lmclient LMST,$LOW,$HIGH" should be "lmclient LMST,al,$LOW,$HIGH"

Code:
#!/bin/sh

SP_LAST=`cat /tmp/sp`
SP=`lmclient LMGT,sp`

if [ "$SP_LAST" -ne "$SP" -a "$SP" -gt 10 ] ; then
  SLOW=$((SP \* 925))
  SHIGH=$((SP \* 1075))
  LOW=$((SLOW/1000))
  HIGH=$((SHIGH/1000))
  lmclient LMST,al,$LOW,$HIGH
  echo $SP > /tmp/sp
else
  echo $SP > /tmp/sp
fi
 
Last edited:

Bryan Mayland

TVWBB Hall of Fame
Oops "LMST,al" that's what I get for writing a shell script without trying it myself!

Also note your code executes if the setpoint is different and the setpoint is >10 degress, not a 10 degree difference.
 

Matt Fine

TVWBB Member
Also note your code executes if the setpoint is different and the setpoint is >10 degress, not a 10 degree difference.

True. I should probably just make that execute any time they are not equal, although I don't see myself changing set points by less than 15-20 degrees very often. I tend to think about cooking temps in 25 degree increments.

Did we lose Benjamin?
 

 

Top