I'm trying to setup a better low battery notification that is both informative and less annoying that doesn't require an hour of custom rule making that has be to updated with future devices.
I have the Notifications app setup for low battery notifications but the only options I have available are Twilio SMS messages and phone notifications. I have 40 battery devices and have it set to notify at < 40%.
Having the messages go to SMS triggers them all the time especially when some of these remotes have battery values that seem to fluctuate day to day where it reads lower than actual then later it reports high enough. I don't like hopping in the car and playing music from my phone and having the stereo interrupted with SMS dings coming across and the Apple Car play reading off low battery messages to me. I just want those to go to email.
I only want critical notifications going to my phone (water leaks, smoke alarms). I want low battery notices to go to my non-phone email. Adding the option to call a URL to the notifications app would make it easy as I have my own server script setup to take a simple message string and my server handles firing that off in an email.
This call would work if I could add it into the Notifications app.
I setup a separate RM rule instead to try this, added a rule checking off all 40 devices if there is a low battery tripped, but from what I read in another thread that type of rule which is easy to create and update won't pass along the device/value variables. It only passes along %date%.
The alternative looks to have to manually add all 40 devices OR'ed together or 40 different if statements just to grab the device and battery values. Not something I want to spend that much time on especially with having to maintain that rule.
Is there an easier way to set up an email notification for any low battery that I'm missing? For now I'm just going to send a low battery notice email without the device info and I'll have to check the battery level dashboard.
Thanks, I'll try out the email driver. Having that show up as a notification device in the built-in Notifications app will cover what I'm looking for.
The notification app already is working fine checking battery levels. And I have a dashboard setup with just the devices using batteries that is a good quick check that shows them in red/green/grey just fine.
I did try it and the %device% and %value% were not being passed into the URL string but the %date% value was. I've got the SendMail installed now and just about got it setup, so I'll just use that instead in the Notifications app, which will work out better anyway.
Been tying to get this this LGK Sendmail working but no luck. I have my own web server and multiple domains on it with my own email servers. Using the same settings (mail server, outgoing email, SSL authentication password, port, etc. all match) I have in my Thunderbird profiles for SMTP outgoing emails and can't get it to send out. Debug logging says telnet is okay in the device but it won't send out.
Ah, ok. Looks like I can't use it then. When I try to send with authorization turned off and use port 587 which is the non-ssl port my web server kicks back errors that its not authorized. I seem to recall my server had all the non-ssl stuff locked down for PCI compliance scans. I can still use other RM commands to at least just fire off a script call to my server using GET and let my script send the email since I have that all working. I just couldn't get the device name to send that way.
if you have your own email server and it accepts incoming mail. it has to work without end to end encryption normally that is port 25 . does your server not accept incoming mail? is it only for outgoing.? How do you get incoming mail for your domains?
It uses POP accounts for incoming email with SSL/TLS passwords and port 995 and outgoing is SMTP on port 487. Honestly its been a few years since I touched any of the email servers and I recall it was a headache getting the servers all patched up and locked down for all the PCI compliance scans that I had to have run on it for my credit card processing. I was just replicating the same settings I'm using in my email client in the SendMail. I've already removing all the LGK Sendmail driver and code and and doing my own thing that doesn't need Hubitat to do the email sending. I have my own server side scripts I can call and they handle sending me emails.
Thanks, but I've already moved on from this. I might have not worded that right, but yea I know the difference between which direction things are going. I already have a perl script I call from a different battery check RM rule I wrote that fires me off an email. The only thing that isn't working there is that I can't get the %device% and %value% to get passed into the GET string. I do get the %date%, I also tried OR'ing the battery check condition so only a single device trips the rule and calls the script as I read that can work in another thread, but that's not working either. I get "null" passed for the device. It's really not a big deal, all I have to do is click the battery level dashboard I made to see what device showed up low.
Testing this with just 1 device in the condition passes null into the server. When I add %date% that does give me the date and %value% is blank. Someone else mentioned that something like this is supposed to work for getting the device name and value. My full rule checks about 40 battery devices so I have them all in the conditional.
I can't get it to send a URL that has spaces and even using %20 in place of spaces doesn't work. Any URL that does have a space in it seems to cause the GET to not even send it to the server. And all my device names are multi-words with spaces. I'm giving up on this and just going to call my script to send me a general purpose battery warning and I can just click the dashboard to see what is low. And I'm looking at integrating one of the device monitor apps instead that might work out better.
I am using a perl script I wrote to just pass in a variable to tell it what happened in general. If its a smoke or water alarm it fires off emails to 3rd party contacts with instructions on how to enter the building and where to look for the leak or smoke detector that tripped, etc. Longer messages than I want to put in a rule within Hubitat anway. Its fine if I can't get any variables out of Hubitat or have it convert the URL to something it can send such as if it has spaces in it. I just need to be able to fire it off with a single variable like ?action=1 or ?action=2, etc.