For a couple of years now I’ve been using the Hubitat Elevation C7 home automation hub. I was doing some tweaking this weekend, and I wanted to setup SMTP and SMS notification channels. I had been using Twilio for SMS, but it wasn’t a free service. And I also wanted email alerts, so I was in search of a new solution.
Unfortunately the community SMTP apps for Hubitat don’t support secure authentication via TLS, so I couldn’t use them with my commercial SMTP provider (Fastmail). However, I do have a Synology NAS and it has a SMTP relay feature, which does support strong authentication.
This blog post will walk you through the setup of the SMTP relay on a Synology NAS, then configuring a Hubitat SMTP app (LGK Sendmail V3) for e-mail alerting. And, if your mobile provider supports e-mail to SMS. you can send emails from Hubitat that automagically get translated to SMS messages to your phone!
Synology SMTP Relay Configuration
- Login to your Synology NAS and launch the Package Manager.
- Install the Synology Mail Server.
- Launch the Synology Mail Server app and click on SMTP in the left pane.
- Enable SMTP, use Local Users, enable SMTP authentication, then check the box next to Ignore authorization for LAN connections.
- Enter the FQDN of the domain from which you will be sending email, use port 25, and set the maximum email size to your desired value.
6. Click on SMTP Relay.
7. Enter the FQDN of your SMTP provider and the port.
8. If your SMTP provider requires TLS, check the box.
9. Enter your SMTP credentials. Note: Some providers require an “App password” for SMTP that is separate from your email login credentials. So check with your email provider to ensure you are using the right credentials.
10. Close out all Synology SMTP windows.
Hubitat SMTP Configuration
Note: I’m assuming you already have the Hubitat Package Manager (HPM) installed. If not, I highly recommend using it for maintaining your Hubitat packages. If you aren’t using HPM, go to the Dec’ 21 section of this thread and follow the steps to install it.
- In Hubitat Package Manager click on Install, then Search by Keywords
- Search for “sendmail” and select the package by Larry Kahn.
3. Check the box next to the package and click Next and finish the HPM wizard.
4. Back in the main Hubitat screen click on Devices in the left pane.
5. Click on Add Device in the upper right corner.
6. Click on Virtual.
7. Change the type to LGK Sendmail V3.
8. Give the device a name….something like “SMTP” or “SMS-xxxxx” if are using SMTP to SMS forwarding of your mobile provider.
9. Click on Save Device.
10. On the Device screen that appears, configure the email server (IP address of your Synology NAS), Port number (25), and the From: and To: addresses. Enter a Subject name of your choice.
11. Go back to the main Devices list and you should now see a parent SMS/SMTP device, with five child devices.
Take note that you can create multiple SMTP devices, so you could have one or more for SMS, one for actual email alerts, etc. Check with your mobile carrier to see if they support SMTP to SMS, and what email address format you need to use.
Testing the SMTP Relay
- Click on the SMS/SMTP device you created in the Devices list.
- In the Send Msg box type a word or two and then click the box.
- Go back to the Synology Mail Server App and click on Mail Log.
- Click on the refresh button, and see if the incoming email was logged.
- Check your SMS/SMTP destination and verify that you got the test email or SMS message. Note: SMS messages can take a couple of minutes to go through so be patient.
Using the SMTP Alert
All of my automations are based on Webcore, so I’ll show an example of how to use the new SMTP/SMS device in a piston. To use the Sendmail device in an action, chose the SMTP/SMS device and the “do” command should be “Send device notification“. For the value, enter the message you want to send.
Below is an example piston on how I use this post to send SMS notifications to my phone.
If you have a Hubitat Elevation home automation hub and a Synology NAS, then this post shows you how to configure SMTP/SMS notifications. This assumes you have a commercial SMTP server that requires authentication, such as Gmail, Yahoo, Outlook.com, Fastmail.com, etc.