Feature Request for iCal Alarm Processor

Posted on
Mon Mar 27, 2023 11:18 am
makedrinklas offline
Posts: 124
Joined: Oct 12, 2004

Feature Request for iCal Alarm Processor

So I realized that I might be able to turn off my weekday alarm with integration with iCal sending an email the day before I am off work to toggle a variable "SnoozeDay" to true. (A conditional schedule)

I began exploring the iCal Alarm Processor and it seems straight forward except for a few things.

- Integration with Email + I have to re-enter my email info but...
- No StartTLS, just SSL, so not sure if it will work. (Currently it's not – possibly unrelated but see below)
- I'm not sure at what time it will be polling next, I assume the next poll will be after I set the value in minutes. I think not needing to do every 5 minutes would save on overhead. I have it to every 480 minutes for now. In theory if I knew the time it would poll next, I could set it to once a day.
- It would be great if there was an option to view passwords in Email+ as well as the iCal Alarm Processor to make sure they're correct at a glance when typing them out.

Sidebar question: Will Email+ or iCAP plugins potentially allow others to access my email? (2FA code vulnerability, etc.)

Also, just an FYI, it appears the link for "Show in Plugin Store..." appears to be broken.

Thanks again for all you do! :D

Here is what happens when I hit Check for Alarms:

Mar 27, 2023 at 1:23:37 PM
iCal Alarm Processor Error Unknown error (possibly IMAP server connection error): unexpected response: '220 iCloud SMTP - st43p00im-zteg10061901.me.com 3.5.0 (2312BSE2-ed4d329eadba)'
Traceback (most recent call last):
File "plugin.py", line 74, in update
connection = imaplib.IMAP4(self.pluginPrefs['host'].encode('ascii','ignore'), int(self.pluginPrefs['port']))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 195, in __init__
self.welcome = self._get_response()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 960, in _get_response
raise self.abort("unexpected response: '%s'" % resp)
abort: unexpected response: '220 iCloud SMTP - st43p00im-zteg10061901.me.com 3.5.0 (2312BSE2-ed4d329eadba)'

Posted on
Tue Mar 28, 2023 1:12 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request for iCal Alarm Processor

The iCal plugin was discontinued.

You can setup email+ triggers to do stuff based on a received email
See: https://wiki.indigodomo.com/doku.php?id=indigo_2021.1_documentation:plugins:email

And I just read a writeup today on how to receive calendar information using shortcuts. This looks promising as well and all runs locally.
See: https://forums.indigodomo.com/viewtopic.php?f=298&t=27014&p=217019&hilit=calendar#p217019

And here is a discussion a few of us had recently on how to make conditional schedule adjustments (might be helpful)
See: https://forums.indigodomo.com/viewtopic.php?f=80&t=22961

Bill
My Plugin: My People

Posted on
Tue Mar 28, 2023 1:17 pm
makedrinklas offline
Posts: 124
Joined: Oct 12, 2004

Re: Feature Request for iCal Alarm Processor

Thanks, that's great information, I will try it out!

Posted on
Fri Mar 31, 2023 2:13 pm
makedrinklas offline
Posts: 124
Joined: Oct 12, 2004

Re: Feature Request for iCal Alarm Processor

Ok, trying it out at this moment and I had success adding the IMAP device. I now understand that some of my initial questions were completely uninformed. Sorry.

RTM is always a good thing. Although, I am experiencing a few hiccups as I set this up including Indigo hangs with spinning wheel during setup of the trigger.

First I tried including the exact variable name in the body as the trigger (and a few carriage returns above it) using String Match and no reaction from Indigo except an error about that the To: field returned null. So I set the trigger to look for a specific from email address I set up for this. I also included the variable name in the text again, just for giggles.

Here is the error I get now:

Mar 31, 2023 at 3:21:21 PM
Email+ Error Email+ Event Checker: IMAP checkMsgs error: STORE command error: BAD [b'DONE is the only command allowed after IDLE']. Data: b'GJCG400 STORE 63 +FLAGS ($IndigoProcessed)\r\n'

Reading the error, I saw IDLE so I turned off Polling in the IMAP device and now it hangs Indigo for a bit and I can't make any further adjustments. Same behavior as when I switched the Trigger from String Match to RegEx Pattern Match – Indigo choked. and then disabled the trigger. Only deleting them and restarting the Indigo Server seemed to make it stop. It does not like when I modify things that are running I suppose?

Mar 31, 2023 at 3:34:09 PM
Trigger Test
Trigger Alert - Nine-Twenty Alarm Off
Error (client) timeout waiting for plugin response from com.indigodomo.email for request UiGetValues2
Error (client) timeout waiting for plugin response from com.indigodomo.email for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Error (client) timeout waiting for plugin response from com.indigodomo.email for request UiGetValues2
Error (client) timeout waiting for plugin response from com.indigodomo.email for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Error (client) timeout waiting for plugin response from com.indigodomo.email for request UiGetValues2
Error (client) timeout waiting for plugin response from com.indigodomo.email for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Error (client) timeout waiting for plugin response from com.indigodomo.email for request UiGetValues2
Error (client) timeout waiting for plugin response from com.indigodomo.email for request CallPluginFunc
Error (client) runDialogForDevice() caught exception: NSInvalidArgumentException -- *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]


After the Local Server off /on, I set up a brand new IMAP device with Email+ and revised the trigger to do the RegEx Pattern Match for the variable name as an unusual keyword. (Calendar also sent other body text in email alerts.)

It worked! Although I did see this error shortly after in Indigo:

Mar 31, 2023 at 3:47:44 PM
Email+ Error new device 1: Error fetching FLAGS for Message # b'63': argument of type 'NoneType' is not iterable
Email+ Error new device 1: Error fetching FLAGS for Message # b'64': argument of type 'NoneType' is not iterable
Email+ Error new device 1: Error fetching FLAGS for Message # b'65': argument of type 'NoneType' is not iterable

After another test email sent from Calendar, it worked as expected now but this error showed up in the log:

Mar 31, 2023 at 3:56:51 PM
Trigger Test 2
Trigger Alert - Nine-Twenty Alarm Off
Email+ Error new device 1: IMAP checkMsgs error: STORE command error: BAD [b'DONE is the only command allowed after IDLE']. Data: b'LBJO631 STORE 63 +FLAGS ($IndigoProcessed)\r\n'

Thoughts? Aside from that I'm obviously not a programmer. This is working of me now after some trial and error. Matt & Jay, I just want to make you aware of the errors that persist, and the hangs that can occur when adjusting the trigger, at least on my setup. (2022.2.0 on a Mac mini running 12.6.4). All Indigo plugins are up to date. Ignore or try to grasp the above as you see fit. I've done my best to report the errors and what caused them. If you have further questions, let me know, I'll try to help.

Posted on
Fri Mar 31, 2023 8:12 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request for iCal Alarm Processor

I only use email triggers for one thing at the moment. I can't do the calendar thing because I had issues with email+ working with iCloud (and it looks like from calendar you can only send an email to an associated iCloud account.)

For email+, I'm using a GMX account now. I was using Google.... but google keeps changing stuff and killing indigo integration.... SMS, maps now gmail.

Another possible option is the SMTPd plugin. https://www.indigodomo.com/pluginstore/63/
It's a fun, simple plugin. It basically runs an SMTP server on your indigo machine. You can trigger of any message and the messages don't actually go anywhere. If you could add that email account to your indigo mac then maybe calendar could use it?

(I added the SMTPd email server and used it on my security cameras for a while. So when they detect motion, they send an email. Instead of waiting for the email to go to a google server on the other side of the county, back to my house, get polled.... big time delay. Since I didn't need the email to actually leave my home network, this plugin worked.) Your kinda in the same boat that you don't need your email to actually go anywhere. So.... maybe?

anyway.... here is an example of one of my triggers with Email+ that has been working flawlessly...... but I haven't tried to parse information out of an email. I get several emails from a service that monitors my kids phones.... if one of the email's is an Alert, I can have an automation response with it.
Attachments
BarkEmail02.png
BarkEmail02.png (29.65 KiB) Viewed 1519 times
BarkEmail01.png
BarkEmail01.png (46.34 KiB) Viewed 1519 times

Bill
My Plugin: My People

Posted on
Sat Apr 01, 2023 11:34 am
makedrinklas offline
Posts: 124
Joined: Oct 12, 2004

Re: Feature Request for iCal Alarm Processor

Thanks for the response sir, I really very much appreciate it. As I mentioned it appears to be working with iCal. The Match String function may have been too specific but the RegEx Pattern Match does the trick. I'm not totally clear why, but I'm not arguing. :) I'm excited to see if it works Monday (I'm off) and I have a calendar entry as such with the variable name in the notes.

Again, I agree GMAIL really pooped the bed on SMS, it took a lot of testing to realize it was just not reliable for me. I feel I've spent a bit too much time on this new automation already, lots of other housework to do now that spring has sprung. If things go south for some reason, I'll take a look at the SMTPd plugin.

Question, how did you come to know the iCal plugin was discontinued? The documentation looked great and nothing in Indigo gave any notice that I saw. In fact I wonder if now that I know a bit more about Indigo polling emails if I could get it to work. I'm betting it's included in new releases because other users continue to have use for it. Maybe it's a bit of a security risk?

Posted on
Sat Apr 01, 2023 1:58 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request for iCal Alarm Processor

makedrinklas wrote:
Question, how did you come to know the iCal plugin was discontinued? The documentation looked great and nothing in Indigo gave any notice that I saw. In fact I wonder if now that I know a bit more about Indigo polling emails if I could get it to work. I'm betting it's included in new releases because other users continue to have use for it. Maybe it's a bit of a security risk?


I began using iCal plugin for a totally different reason that I never got to work anyway. (Was trying to figure out a way to have a calendar on a control page). I scrapped that idea... but still had the iCal plugin in case I wanted to tinker with it. Either during the last release or 2 indigo releases ago, I decided to do some indigo spring cleaning (like deleting out old plugins that no longer work or I have no more need for). That is one of the plugins that was showing as grey? meaning that it won't be compatible with future indigo releases. So, I deleted it.

When I saw your post, I instinctively went to my list of plugins and looked for iCal..... couldn't find it. Checked the plugin store... not there either.... found a thread somewhere that discussed it being discontinued.

Unfortunately, that happens from time to time as a plugin developer moves on to something else or just doesn't have time to keep a plugin updated. Sometimes those plugins get adopted by another developer, sometimes they disappear.

Plugins that directly tie to either Google, Apple or Alexa, I have found to be the most buggy and hard to keep going due to an ever changing landscape of security protocols.

Like I was bummed two days ago when I found a plugin that I've never seen before but it was discontinued like 5 years ago. (Santa Tracker). Thought it would be fun with the kids.... but now you just add the Norad app to your smart TV and walk away.... so not worth trying to resurrect a dead plugin.... especially since that plugin relied on Google Maps which now requires an API key and some other nonsense that makes it unusable for our purposes.

Bill
My Plugin: My People

Posted on
Tue Apr 04, 2023 1:02 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Feature Request for iCal Alarm Processor

We quietly removed the iCal plugin from the Indigo 7.5 installer and removed from the Plugins section of the docs, primarily because the Better Email plugin (which would become Email+ and included in Indigo) was better at connecting to email servers and had the capabilities in the iCal plugin. We also pretty much knew that there were very few users using it (as evidenced by this topic!) so getting people moved over would be pretty easy to do on a case-by-case basis.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Apr 07, 2023 12:31 pm
makedrinklas offline
Posts: 124
Joined: Oct 12, 2004

Re: Feature Request for iCal Alarm Processor

Thanks Jay, I appreciate the update.

So yes, I have tried using Email+ for scanning emails and have had limited success. It seemed testing worked, but when it came time to put everything into practice, the trigger did not pick up on the emails with the pattern SnoozeDay (name of the variable to change). I've just completed the upgrade to 2022.2.2, possibly it works now? I'll have to test again at some point.

Since it wasn't working, I decided to just delete the Email+ IMAP device. It looked like it went away and then I did a restart and it was back! It appears the best I can do to get rid of it is type in some garbage info and disable Indigo communication.

This was just an attempt to automate something that we do naturally with Calendar, no big deal, I can just change the variable manually as needed. (if I remember!)

Thanks again,

Mike

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron