Email Driver - Using Google API. (Please Make)

Just to make sure I understand what you want to do . . .

Am I correct that your desire is to be able to send something (status, alert, etc.) from Hubitat to a Mobile Phone via SMS? Is E-mail just a potential (and convenient) intermediary? Or is e-mail essential to your use case? You mention both.

Reliable and assured delivery?


So I want to be able to get SMS from Hubitat, (Push Notifications just will not work when you do not have internet on your phone do to a poor coverage area.

Now Hubitat has a 10 SMS limit per day, and that really is just not enough. I know it cost them alot for the sms and that is why its so low.

Now to get around this limit I have a way to get potential unlimited as I have never had an issue with my server sending them to me and I have got over 50 sms in one day when it was having a breakdown using the following method.

Method: Most Cell service providers have a way to send an SMS to a phone number via email. Such as T-mobile that I have. I can create an email and send it to "" then the email come to my phone as an SMS.

So with mu server it has a built in feature to send an email when there is an issue, I just enter in my email credentials (Using google email) and it will send an email about server issues to the email address I provided, but I dont always check my email, so I discovered that I could also put the above method to work for me. so I have my email address and my cell number email address and when it fires off an email i get it at the email I specified along with an SMS to my phone. Its very convenient.

So what I need is someone to create a way we can use a gmail for the backed for sending an email out, to any email address we want. then once that is done, I just need to enter in my credentials for that email account, then when I want to send an email alert I just enter in the codeing needed to send a message, But instead of a regular email address I enter in phone number email address that will automatically push it through to me as an SMS.

So whoever wants to make/create this, they only need to think about it as a way to send an email to an email address. And a way for us to define the sender email account (AKA gmail).

So in the end we just get a way to send emails. (And using the method I said above users can send SMS to their phone without the 10 day limit.

If we can find a way to create this. Hubitat said they would take the code and make it part of the system as it would allow people to get around the 10 SMS limit they have.

So in the end when we would click to "Send a message" Hubitat would let us pick from SMS or email options.

I have no clue how to program or I would be all over this.

I was asking because I see there are providers that could do the SMS without e-mail. Sounds like you don't want that. They all charge a fee as well.

Ya and this would be free. :slight_smile:


1 Like

Did you take a look at what I posted a link to. Someone has already done this. You can send an email straight from HE through a middle-man server to whatever address you want. I use this to send text and email alerts to myself.

1 Like

completely missed that. I will look into it. Thanks!

What email server do they use? I see something about a Linux server setup, but noting about the email address credentials for the server side of the email.

Hi! I'm the author.. It uses sendmail to communicate. Actually it could use anything Node server can handle (with modification of course). For me it just worked. You might have trouble if your ISP blocks outgoing mail.

If you have any questions etc. happy to help if I can!

Yes mine does block most ports for residential so I guess that will not work. I see online that other people (FOR other stuff not Hubitat) create groovy scrips. I have no Idea about the limitations of Hubitat and groovy, maybe you can answer this.

I see this code in there groovy script. Can Hubitat handle this:

import javax.mail.*
import javax.mail.internet.*

I couldn't make that work.. so ended up with a separate server (Raspberry PI) so if you can figure it out let me know.

Why don't you just use the IFTTT notification driver.

The setup instructions have you use the Notification Service through the IFTTT app but there's nothing saying you can't use the email function in IFTTT.

Not a fan of IFTTT, And I have been digging deeper in the forums and I have found many people wanting to what I described. And others just want email support period. And the consensus seems to be to use google. Just nobody seem to have the time to dig into it. I don't know how to program or I would make the time to create this.

I have looked at other peoples code and I just don't understand it.

Just hoping someone that knows and has time, would think an see that many people want this and create if for us.

I know people are busy and they do this for free. Back in the day I worked on sever community projects and did some basic system programming and tweaking. Groovy is just over my head.

Not Sure if this help anyone get a jump start on it, but it looks a few methods listed here:

The libraries don't work on HE.. I already tried which is why I ended up created a RESTFul server solution. I am looking at maybe incorporating a "mail relay" via nodemailer-relay so someone could define which server to send mail thru. Have to think about it..

1 Like

Yep, that is what I found as well... :wink:

I’m still not clear on why sms is a better option than pushover if you’re somewhere with poor cell service. If you have no cell service, you won’t get the sms until you reconnect to the network. If you use pushover, the queued message will be delivered to your phone when you connect to a cell or WiFi network.

1 Like

Is it feasible to use Python? HE send http Post to Python, and then Python use smtplib to create email?

I think anything that can receive html will do the trick. I used Node originally because I was planning on doing other "stuff" and it seemed the easiest, most flexible way to implement a RESTful interface. DoNS = "Do Net Stuff" :smiley:

My driver implementation is extremely simple and copied from others. I did change over to use Async recently.

I was thinking Node would be easier too. But it never talked successfully with my IoT device using Node lib... After one week trying, I decided to move to Python, which has more resources online.. And it works fine now. My HE could retrieve data from the device without Internet connection.