Alarm Script Recipes


 
Oh dangit you figured it out. I did too! I used this and it worked great:
Code:
account default
host smtp.gmail.com
port 465
auth on
from c@gmail.com
user c@gmail.com
password password
tls on
tls_certcheck off
tls_starttls off

The echo line is broken because "-ash: syntax error: unexpected "("". This is fixed by either putting the whole thing in quotes or escaping the parens:
Code:
echo "$PN Alert -- $PCUR ($al_type)"
or
echo $PN Alert -- $PCUR \($al_type\)

I was worried gmail wouldn't forward the SMS but it worked. Took about a minute for it to get to the phone though.
 
Another thing to try could be to use prowl to send push notifs to an iOS device.
I have done this before with other shell scripts on OSX, I just can't remember if I wrote a cli tool which helped post the prowl notif and then called that from the script.

Keep in mind, I just rediscovered this project after a long hiatus, and still trying to wrap my head around it all. :) Bryan, your work is really amazing!! But yeah, I might be out of touch with what's possible at this point until I get caught up.
 
Bryan
This is all great, I will get my hands dirty over the weekend with push notification to ios devices, well small app with push capability
 
LinkMeter package version 3 now supports editing and enabling alarm scripts from the web interface as well as some new convenience features for setting new alarms, and getting the ringing probename and value. See the Alarm Script Recipes wiki page for details.



EDIT: Oops looks like the package doesn't have the model file. I'll have to fix that later though, big game time!
 
Last edited:
What would the name be for a low temp alarm on a probe ? i have tried alarm-1L is that correct for probe 1 ? i cant seem to get the low alarm to sms/email me it is defaulting to the generic alarm.
 
It should be alarm-1L for the first non-pit probe, yes. Are you on the latest LinkMeter package? If so you can just edit it from the website. It also pipes the output to the system log (Status -> System Log) which helps diagnose problems with msmtprc.

If you're not on that version, make sure your script is executable and starts with the #!/bin/sh line.
 
Bryan,

Just a friendly reminder. Can this be done manually?

Thanks!

LinkMeter package version 3 now supports editing and enabling alarm scripts from the web interface
...
EDIT: Oops looks like the package doesn't have the model file. I'll have to fix that later though, big game time!
 
Here is what I did:

1) SSH to your HeaterMeter. If you don't understand that, then do a google search for "ssh" and your operating system of choice. For windows I use a client called "Putty".
2) login using the root as username and the same password you use for your HeaterMeter configuration page.
3) At the "root@OpenWrt:~# " prompt type,
Code:
wget http://capnbry.net/linkmeter/snapshots/bcm2708/packages/linkmeter_4_brcm2708.ipk
4) Once that completes, at the "root@OpenWrt:~# " prompt type,
Code:
opkg install linkmeter_4_brcm2708.ipk
5) Login in your HeaterMeter configuration via the web interface.
6) Click on the Alarm Scripts tab and it should now work.
 
You can also just paste the url in System -> Software -> Download and install package or if you're more manual, you can do the above procedure. opkg can also take a url so you can just
Code:
opkg install http://capnbry.net/linkmeter/snapshots/bcm2708/packages/linkmeter_4_brcm2708.ipk
 
The first way you describes sounds really simple. Didn't realize that was an option. I think I like OpenWRT. I got the alarms setup earlier today with emails and sms messages configured and tested. Started another smoke just a few minutes ago to try everything out.

Thanks again Bryan!
 
Bryan,

According to wiki

MSMTP Configuration

The mail transfer agent "msmtp" must be configured before any of the sendmail (email/SMS) commands will work. Edit /etc/msmtprc with the information appropriate for your mail server.

How Do I edit this.

HOW to set this up for Hotmail
SMTP over SSL / Gmail

Using putty logged into but get Permission denied when I type /etc/msmtprc
 
Last edited:
Dale,

You will need to use a text editor to edit the msmtprc file which is located in the /etc folder. The only editor that I believe is included with the HM is vi (a stripped down version at that). I am not going to try to give you a vi tutorial. Check out this one http://floppix.ccai.com/vi.html.

Once you figure it out you can type:

Code:
vi /etc/msmtprc

If you are in vi and you just want to bail out:
Code:
<ESC>:q!

Escape key, colon, letter q, exclamation mark.

As far as the settings, I have no idea for Hotmail. The absolute simplest thing to do would be to go create an gmail account and use the settings provided in wiki with your new gmail address and password. That is what I did, as I didn't want to use my existing gmail account/password for the HM.
 
Yeah considering msmtp is the preferred email solution for OpenWrt across all their platforms, I am shocked there isn't a web-based configuration editor for it. Somebody should totally write one for it.
 
Bryan,
HOW to set this up for Hotmail
I've added this to the wiki, but here's Hotmail / Windows Live Mail's configuration
Code:
account default
host smtp.live.com
port 587
tls on
tls_certcheck off
auth on
from yourname@hotmail.com
user yourname@hotmail.com
password password
 
Bryan,

Under the current alarm script setup (which is great by the way, thanks), are they backed up when you backup from LuCi? I realized that my previous scripts got blasted the last time I upgraded, probably because they live in /usr and not /etc or something.
 
They are not backed up, but this is on my relatively important todo list right after finishing the msmtprc editor.
 
Hah, you are a monster. I love how quickly you go from "Someone should write an msmtprc editor" to "BRB, finishing up the msmtprc editor".
 

 

Back
Top