Page 6 of 8

Re: Better Email Q&A

PostPosted: Wed Nov 29, 2017 9:27 pm
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?

Re: Better Email Q&A

PostPosted: Thu Nov 30, 2017 10:58 am
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?

Re: Better Email Q&A

PostPosted: Thu Nov 30, 2017 11:40 am
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.

Re: Better Email Q&A

PostPosted: Wed Jan 03, 2018 5:37 am
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!!

Re: Better Email Q&A

PostPosted: Wed Jan 03, 2018 7:26 am
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 viewtopic.php?f=216&t=17281

Re: Better Email Q&A

PostPosted: Wed Jan 03, 2018 7:53 am
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:

Re: Better Email Q&A

PostPosted: Wed Jan 03, 2018 7:57 am
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.

Re: Better Email Q&A

PostPosted: Wed Jan 03, 2018 10:16 am
by dlmills27
Great thanks

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 4:21 am
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?

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 7:18 am
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.

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 9:00 am
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?

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 9:05 am
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.

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 3:28 pm
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 = xxx@yyy.com) 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

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 3:30 pm
by FlyingDiver
If you're not seeing anything in the debug log, how do you know the email was received (by the plugin)?

Re: Better Email Q&A

PostPosted: Mon Jan 15, 2018 4:03 pm
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 "service@intl.paypal.com"; subject "Payment Skipped"