Email Driver - Using Google API. (Please Make)

I am due to get my Hub tomorrow and notice something missing I would love to have.

Support for sending an email instead of SMS or push notification.

Reason 1) If I do not have proper cell service (in a rural area) I will not get text or push notification, but I can check my email in a hotel or friends house. This way I can still get important info sent to me.

Reason 2) With the update google made to Android 9, I can't allow just certain apps to send push notifications during DND mode. Its all or nothing. (Issue they said would be fixed in months to come, Hopefully)

Reason 3) Most Cell providers offer a way you can send a text email to SMS.
Example. I can crate an email and have the email address (my number@provider)
5555555555@tmomail.net (T-Mobile)

Find more info about that here:

So can some create support for email via google API? So we put in our credentials (email address & password) , and then in the trigger we specify it an email, then who its to and if there are any cc, or bcc, and then the message.

This would allow us to get emails for certain things and for carriers that support it we can get sms also for other things.

So we could send an email to: recipient@gmail.com and cc 5555555555@tmomail.net and we would get an email and a SMS with the info if we wanted.

I have no clue how to do this else I would. Its an nice alternative to pushover.

Thanks everyone. Looking forward to joining the family and leaving ST behind.

Someone Has developed something similar.

1 Like

Wouldn’t the push notification also go through when you connect to the internet at the hotel or your friend’s house?

If you can’t wait on something there may be a ifttt driver on the forums that you can use with the ifttt webhook. You can use it to have your hub email, text, push notification or call (with a robotic voice) your phone.

I am pretty sure this does happen with Pushover notifications. They appear to get queued up on the Pushover Server, and then delivered once my phone connects to a network (cellular or WiFi.) I haven't explicitly tested this scenario, but I do seem to recall noticing it occur from time to time.

1 Like

That is how it works. Pushover queues messages until the recipient device comes back into service.

How are notifications stored and delivered?

  1. A server, application, or plugin sends a notification to our API over HTTPS (TLS), including its application key, a user or group key, and the message details.
  2. Our server queues the notification in a local database for reliability.
  3. Our server communicates with the appropriate push server (Google's, Apple's, or ours) over TLS and hands off the queued message. If successful, the message is marked as delivered in our database.
  4. Google's or Apple's push servers deliver the message to the end-user device over its proprietary, persistent TLS connection. Our Desktop push server delivers notifications to web browsers over our WebSocket connection.
  • On Android phones, the notification is received by the Pushover application, stored in its local database, and an alert is generated.
  • On iOS, if the Pushover application is running, the Pushover application stores the notification in its local database and an alert is generated. If Pushover is not running, iOS handles the notification and generates the alert. The message will not be received by the Pushover application until it is opened and can synchronize with the Pushover servers.
  • On Desktop browser devices, the notification is received by the Pushover web application, stored in its local database, and an alert is generated in the browser.
  • On macOS desktops, the notification is received by macOS and a notification is generated.
  1. When the Pushover device client is opened and has not synchronized recently (or a manual sync is requested), the device client communicates with the Pushover servers over TLS and downloads any new messages that were not received by push notification, usually due to transient network issues.
  2. Finally, the Pushover device client notifies the Pushover servers of the highest message ID that it has in its database that has been reliably received. The Pushover servers delete all messages up to that ID for storage and security concerns. At this point, the message exists only on the user's device.

Messages delivered to devices but not acknowledged will be automatically deleted from our servers after 21 days.

1 Like

I briefly looked into doing this a few months ago. It seemed far too complicated for my skills. Most of the examples utilized libraries that would need to be ported, if possible, into groovy. For me, it wasn't worth the effort.

Pushover really does work extremely well. It is very low cost (one time $5 fee), supports up to 7500 messages per month, buffers messages and delivers them when your device connects to a network, supports enhanced messages (like Emergency), etc...

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?

Free?

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 "my_phone_number@tmomail.net" 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:

Understood.

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.