Better Email Q&A

emergent
Posts: 51
Joined: Fri Aug 30, 2013 6:42 pm

Re: Better Email Q&A

Post by emergent »

Is there a way I can send an email to the email account I have set up for Indigo and have it set the time fora scheduled event?

My fiance's schedule is varying for the next few months and I want her to be able to send an email with the subject "Coffee" and the body to be the time she wants the coffee maker to start "6:00am". Is this possible to do with this plugin?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

BetterEmail can receive the email and parse out the subject line and message body. So it's no problem triggering an event when the subject line matches.

The problem is that I don't know of any way for trigger actions to change the scheduled time for an event. There are no actions in the client UI for changing a scheduled event, and according to http://wiki.indigodomo.com/doku.php?id= ... _reference, IOM access to indigo.schedule.* is not yet implemented.

Anyone have any ideas on actually creating or modifying the time for a scheduled event?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Better Email Q&A

Post by jay (support) »

If you truly need a completely arbitrary time, then you'd need to revert to AppleScript for the time being.

I would suggest, however, that you might be able to create a few "options" for fixed times: you would the create schedules for each time period but disable them. Then when the email arrives that says, say, "6am" in the body. Then you'd enable the 6am schedule and disable the others.

This could in fact be done just by naming an Action Group "6am", so the only action BetterEmail would have to take would be to execute the action group named in the body of the email. The Action Group itself would then manage the enable/disable for the appropriate schedules.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
dlmills27
Posts: 3
Joined: Sun Dec 31, 2017 9:55 am

Re: Better Email Q&A

Post by dlmills27 »

Hi all, and happy new year!

I am a new user to indigo 7 (have had previous versions in the past, then went to smartthings, and now I am back) but managing to navigate my way through a lot of integrations through the resources out there.

I have become stuck on one issue however and need some advice please.

I want to integrate google home into my indigo setup and have decided to take the the following route:

GOOGLE HOME COMMAND ->IFFTT -> GMAIL > INDIGO -> TRIGGER ACTION

I have this working using the better email pluggin (thanks flyingdiver!) but I cannot seem to avoid the 1 minute time lag set by default in indigo preferences for email scanning. I have Gmail set to IMAP.

I fully appreciate that due to the IFTTT integration there will always be some delay but I am fine with this as I only really need it for triggers and can live with a 10 sec ish delay on those, but 1 minute seems too long.

Any suggestions of how I can do instantaneous email scanning to avoid this?

Thanks in advance!!
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

Turn on the IDLE option in the IMAP setup and you don't need to scan at all.

However, a better method for IFTTT integration is http://forums.indigodomo.com/viewtopic. ... 16&t=17281
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
dlmills27
Posts: 3
Joined: Sun Dec 31, 2017 9:55 am

Re: Better Email Q&A

Post by dlmills27 »

Thanks - is this in the Gmail settings, or in the pluggin? Also in the email scanning setup native to indigo under preferences do I set the box to scan every 1 minute or leave it unchecked?

All may irrelevant now though thanks to your other suggestion which I already have successfully working with my microbot pushes through IFTTT but stupidly didn't think to take the same approach here! :roll:
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

dlmills27 wrote:Thanks - is this in the Gmail settings, or in the pluggin? Also in the email scanning setup native to indigo under preferences do I set the box to scan every 1 minute or leave it unchecked?
It's in the config for the IMAP device you create. There's no IDLE option in Gmail's settings.

If you're using BetterEmail, you don't need to configure anything in Indigo's email preferences.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
dlmills27
Posts: 3
Joined: Sun Dec 31, 2017 9:55 am

Re: Better Email Q&A

Post by dlmills27 »

Great thanks
ghenne
Posts: 14
Joined: Thu Nov 08, 2007 11:44 am

Re: Better Email Q&A

Post by ghenne »

I'd like to use an incoming email to trigger an AppleScript. In the script, I would like to use messageText from messageReceived.

Is that something I can do using Better Email?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

ghenne wrote:I'd like to use an incoming email to trigger an AppleScript. In the script, I would like to use messageText from messageReceived.

Is that something I can do using Better Email?
Probably, but since I don't do AppleScript I have no idea what the AS syntax would be. messageText is a state of the incoming mail device (either a POP device or an IMAP device).

But AppleScript is deprecated and you should probably use Python instead if at all possible.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
ghenne
Posts: 14
Joined: Thu Nov 08, 2007 11:44 am

Re: Better Email Q&A

Post by ghenne »

I need to instrument another app, so AppleScript is probably still the best tool for that. (I'd rather use Python, too!)

Is there more documentation on how Better Email works? I see the option to select it in Trigger Actions, but I'm not sure what happens when I do. How would an AppleScript (or Python script) be kicked off?
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

ghenne wrote:I need to instrument another app, so AppleScript is probably still the best tool for that. (I'd rather use Python, too!)

Is there more documentation on how Better Email works? I see the option to select it in Trigger Actions, but I'm not sure what happens when I do. How would an AppleScript (or Python script) be kicked off?
You create a trigger event, selecting either String Match or Regex match depending on the complexity of the string matching you're doing. Then in the "Edit Event" dialog you select the field you want to match against and the string your looking for. All that does is cause the trigger to fire when the correct email is detected. Then you use the "run script" server action in the actions list.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
ghenne
Posts: 14
Joined: Thu Nov 08, 2007 11:44 am

Re: Better Email Q&A

Post by ghenne »

Thanks - I was able to set things up just as you specified.

- Do anyone have a sample AppleScript? I'm trying to access messageReceived or messageText somehow, but they are not in the dictionary.

- My condition (Message From = [email protected]) isn't getting triggered. The log shows the plugin was started, but nothing when the email comes in, even with debugging enabled.

I'm running BetterMail 1.2.14 with Indigo 6.1.11
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Better Email Q&A

Post by FlyingDiver »

If you're not seeing anything in the debug log, how do you know the email was received (by the plugin)?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
ghenne
Posts: 14
Joined: Thu Nov 08, 2007 11:44 am

Re: Better Email Q&A

Post by ghenne »

FlyingDiver wrote:If you're not seeing anything in the debug log, how do you know the email was received (by the plugin)?
I see Email Scanned messages.

Code: Select all

Jan 15, 2018 at 5:20:05 AM
  Email Scanned                   from "[email protected]"; subject "Payment Skipped"
Post Reply

Return to “Better Email”