Can Hubitat receive/decipher emails?

I use the Temp Stick WiFi temperature sensor to notify me when my freezer's temperature is higher than a specified value. Temp Stick can be set up to send email alerts when this happens. If I create a new email account, e.g., a gmail address, and tell Temp Stick to send the alerts to that email account, is there a way that Hubitat can somehow receive the email, decipher it, and "do something"? For example, flash a zigbee controlled light in the kitchen?

Short answer: no. HE can send notifications via email using a community app I believe (I haven't used it)

Long answer: It is possible using node red on a raspberry pi or other linux machine in order to read the email (which needs to be properly formatted of course) and then pass a message back to the hubitat. Probably a bit much for a new user but yes it can be done.

If the device can communicate over IFTTT you could that or if it has an API maybe someone can write a driver for it. Unfortunately a quick search on the forum hasn't turned up anything.

2 Likes

Of course.

The application was an email sent from an Amcrest IP Camera, to enable Hubitat to take some action.

I am attaching a link to show how that was done.

2 Likes

It still requires you to set up an SMTP server on a pi to get it to work.

Using node red is far easier IMO.

1 Like

Could IFTTT be triggered on an email being received at Gmail? Which then triggers HE?

2 Likes

Good point. Looks like it's possible

Trigger an IFTTT Applet with an Email - Postbox.

2 Likes

In that link, I mention using the Android app Tasker and that could also be used using notification coming from the Temp Stick versus an email. Since the notifications probably have a consistent format, you could manipulate the text of the notification enough to send an HTTP request to update a virtual temperature/humidity sensor in Hubitat.

EDIT:. Based on their FAQ page, this means it should be easy to send a formatted notification that would be easy for Tasker to manipulate and result sent to HE as an HTTP request to Maker API.

3 Likes

I did consider using tasker when I set mine up a couple of years ago How to pass a text variable from Tasker to HE via Maker API and then to TTS?

Pretty sure this capability wasn't in tasker then (either that or it required extra plugins or something I didn't want to do then) as my original post had me looking at k9 as the mail client. Up to this day my node red approach has worked perfectly (we still do various meetings over zoom).

Back to the OPs question I think the IFTTT approach is probably the easiest and doesn't require any additional hardware.

@stephen_nutt I assume the http request only works over the local lan? So you would need to install it in an unused phone and leave it at home.

@rocketwiz You know what happens when you assume.....

You can always use the cloud version of the Maker API user command if the Android device may or may not be connected to home Wifi. However, what I did was set a variable that is "1" when connected to home Wifi and "0" when not. Then, my HTTP Request is an If-then and sends either the local or cloud HTTP Request based on that variable.

However, if you have an old Android phone and want to leave it at home, it doesn't need a data plan to receive app notifications. I did both options but not currently in place because I am in a temporary rental house.

Since it looks like that app can have a customized notification, the OP could send a notification as simple as "H56" when the sensor detects a humidity of 56%. Tasker could then use the "H" in the notification to determine that it is humidity. Then, using Variable Split, Tasker can separate the "H" into one variable and the "56" into another. Finally, send the HTTP Request Maker API command to a virtual humidity sensor.

Tasker is definitely more difficult but would be local when the Android device is connected to home network and I don't know how IFTTT could get the values of temperature and humidity into HE for use on dashboards or trigger automations. I have read horror stories about reliability of IFTTT.

Well we live and learn. :wink: Actually looking at the rest of my old thread you were instrumental in getting me on the right track! :+1: :+1:

According to OP, the device just sends an alert email when temps exceed a preset value. No need to send actual temp data so IFTTT should work (leaving aside how well it actually works as I've never used it). If so he can just configure the device to send the alert straight to IFTTT https://ifttt.com/email/triggers/send_ifttt_an_email.

1 Like

It turns out the Temp Stick has a published REST API that looks to be fairly comprehensive...

https://tempstickapi.com/docs

It does not look like you have to be logged in to view the API doc.

I would rather not have to introduce additional devices/software, so is Hubitat capable of issuing REST API calls on a timed basis, and execute actions based on the data returned?

From the API doc... the data returned is gzip'ed JSON. Can Hubitat unzip the data and process the JSON results?

I have several decades of commercial software development experience, but none with languages like Java, PHP, Groovy, etc. The Temp Stick API doc has examples written in PHP. Are there any simple code examples on this forum of something similar, e.g., polling a device using a REST API and executing actions based on the returned JSON data?

I realize this would require Internet access, which is something I would rather stay away from. However, for this particular case, I'm okay with it.

Thanks.

I use Blue Iris with my Amcrest Cameras, this allows me to use the Alerts from Blue iris to trigger events

I maintain the Google Calendar, Task, and Reminder search app:

I have considered expanding this to include searching email as well as there have been a few community members ask about this use case. I would expect that you would leverage the advanced Google search terms to query the inbox looking for matching email since the last query. Then from there you could toggle a switch, send notifications, or execute rule machine rules based on the fact a matching email was found.

1 Like

@user2164 or anyone else reading this, I have added Gmail search capabilities to this application along with Gmail notification capabilities:

1 Like

Download the Hubitat app