[RELEASE] Google Calendar, Task, and Gmail Search and Gmail Notification Device

Wow, ritchierich, thanks!

I wonder why attempting to import a local *.groovy file threw the error on both GCal Search Trigger install, then the error when the parent application tried making a new search trigger? Is it because of characters of a codepage which were lost, when I saved the *.groovy file locally, in UTF-8 format?

I say this, because upon inspecting the data types of the following files:
GCal_Search.groovy
GCal_Search_Trigger.groovy

I noticed GCal_Search_Trigger saved as UTF-8, and GCal_Search saved as ANSI!.

Perhaps that was the error all along..? Either way, it now appears to be installed properly.

Thanks again! I'm going to laugh if that's the hardest part of integration, using your method. XD If I have more problems, I'll be sure to ask.

Those errors do come up too if you install the code in the wrong order. You much install the parent GCal Search first since its referenced by GCal Search Trigger but since GCal Search trigger creates child devices it has to have GCal Switch installed. I usually just use the import button to import the code directly from Github on new installations vs saving down files.

Let me know if you have any further questions! Great to hear you got past those errors.

1 Like

I just installed with HPM and it couldn't have been easier. I'm very grateful for your software - this will be really handy once I understand it completely. Which leads me to my question and I hope I'm not missing something obvious.

I have a preexisting multi-day event on my calendar today that does not match my search string. I put my test event on today's calendar then kick off the calendar search. Reviewing the logs, I see it initially find my multi-day appointment (labeled "Booking Palm Springs Vacation") in matchItem, then after that, in getNextEvents, it matched the same appointment. It never sees my short 15 minute appointment in the middle of this multi-day appointment.

Is there a setting I'm missing to review ALL appointments on the calendar for the day?


app:1442022-10-18 09:29:47.191 AMdebug[runAdditionalActions - items: [[eventTitle: , eventID: , eventDescription: , eventLocation: , eventAllDay: , eventStartTime: , eventEndTime: , eventReminderMin: , switch:defaultValue]], previousItems: null, itemSame: false, scheduleStartTime not set, skipping additional actions, scheduleItems: [triggerSwitchControl:[], triggerReminderNotification:[], triggerStartNotification:[], triggerEndNotification:[], triggerStartRule:[], triggerEndRule:[]], AFTER items: [[eventTitle: , eventID: , eventDescription: , eventLocation: , eventAllDay: , eventStartTime: , eventEndTime: , eventReminderMin: , switch:defaultValue]]]

app:1442022-10-18 09:29:47.123 AMdebug[getNextEvents - BEFORE search: foo, items: [[kind:calendar#event, eventID:_70r36d9l8cr3eba47124ab9k70ojiba26t0k4b9g6gpjac9p6sojig9h60, eventTitle:Booking Palm Springs Vacation, eventLocation:none, eventDescription:none, eventReminderMin:1440, eventAllDay:false, eventStartTime:Fri Oct 14 06:00:00 PDT 2022, eventEndTime:Sat Oct 22 07:00:00 PDT 2022]] AFTER , foundMatch: false, item: [eventTitle: , eventID: , eventDescription: , eventLocation: , eventAllDay: , eventStartTime: , eventEndTime: , eventReminderMin: , switch:defaultValue]]

app:1442022-10-18 09:29:47.118 AMdebug[matchItem - caseSensitive: false, searchTerms: foo, searchField: eventTitle, items: [[kind:calendar#event, eventID:_70r36d9l8cr3eba47124ab9k70ojiba26t0k4b9g6gpjac9p6sojig9h60, eventTitle:Booking Palm Springs Vacation, eventLocation:none, eventDescription:none, eventReminderMin:1440, eventAllDay:false, eventStartTime:Fri Oct 14 06:00:00 PDT 2022, eventEndTime:Sat Oct 22 07:00:00 PDT 2022]], searchTerm: 'foo', itemSearchFieldValue: booking palm springs vacation, itemMatch: false]

app:1442022-10-18 09:29:45.198 AMdebugpoll - childDevice: foo Switch

app:1442022-10-18 09:29:45.196 AMdebuginitialize - creating schedule with cron string: 0 0 8/1 * * ? *

Welcome to the community. Happy to hear this was easy to setup and get started.

This is designed to match the first event against the search string and stop. All day events can definitely throw things off with shorter events so there is a setting to ignore all day events.

Not knowing your use case there is a setting in additional actions, notifications to include details for all march events. This was added for @danabw as he wanted an early day alert of his calendar events.

If these suggestions don’t match what you are trying to do please provide details on your use case and I can evaluate it against current or possible enhancements.

1 Like

Thanks for helping me dig into this! Just to clarify, my appointment spans multiple days e.g. starts Monday at 4pm and ends Thursday 10 am. So technically not "all day events" in Google Cal terminology.

So to further my testing, I moved that multi day event into next week, created new testing appointments and new Cal Search rules and they don't find any match today. Do you think it's possible there's a cache holding on to the previously scheduled multi day appointment?

No caching at all. Try going to your Google calendar in web browser and searching for your event and then replicate that same search in the app via Google search option.

I am traveling this week and won’t be able to replicate any issues until I return late weekend.

1 Like

@jbubeck did you resolve your issue? If not please provide a bit more detail so I can try to reproduce. I will need to know what your search trigger settings are plus examples of calendar events that aren’t working.

I'm trying to install and configure the Google Calendar app thru HPM. I went thru the Step by Step but must have done something out of place. I made it thru getting the "Client ID and Client Secret" but can not find the Calendar API under Marketplace. is there something obvious that I'm missing? I went back through the step by step and can't see anything I might have missed.

Seems like a great tool if I can get it configured properly... Please help

I have several Gmail accounts and did a search for it in an account that doesn't have this setup and found it:

You can also try this direct link to see if it works:
https://console.cloud.google.com/apis/library/calendar-json.googleapis.com

After spending most of the morning trying to install and configure, I threw in the towel... Could not get the "credentials" set up. I'm just not familiar enough with how things are supposed to flow for configuring the app. Too complicated for a simple man and I can only take so much....

Sorry to hear you weren't successful. I wish the Google API setup was simpler but unfortunately there are a lot of steps to it but it is one of those things you setup once and forget about.

Thanks!!- I'll try again once the frustration subsides. I'm sure the app will be very helpful once its installed and configured. You done a great job putting the step by step instructions within Github. I just can seem to make all the links. I just hope I don't screw something up in Google or Hubitat,

1 Like

Version 3.5.0 has been uploaded to GitHub and HPM. This release includes integration with Gmail:

  • Ability to search Gmail messages similar to what has been offered for Calendar, Task, and Reminders. Only difference with Gmail is that you must use Google Query logic to search for matching messages. The app provides instructions on how to do this if you are unfamiliar.
  • Ability to send Gmail notifications directly from your HE hub. This includes a new Gmail Notification Device Driver so if you update your hub manually vs HPM, be sure to download the new driver from GitHub. Integration is direct from the hub to Google so no "middle man" servers are required to send emails using this app. Thank you @robvogelsang for the motivation to finally get this added.

For those of you with existing installations:

  1. Enable the Gmail API in the Google Console in your existing project.
  2. Open the GCal Search parent application and click Google API Authorization in the Authentication section.
  3. Click Reset Google Authentication.
  4. Leave your Client ID and Secret alone and click Authenticate GCal Search.
  5. Follow the steps you previously went through but be sure to select Gmail along with your previous selections and click continue.
  6. Once the authentication process is complete click Next to navigate to the main page and from there you will be able to add Gmail Notification Devices.
6 Likes

Congrats on this release, quite impressive. Just sent my first notification to myself via Gmail. Set it up to go to my Verizon MMS email address phonenumber@vzwpix.com, and text came through quickly. (I use the MMS address so I can avoid SMS character limits.)

Regarding adding the Gmail option when you already have your app set up - when I got to the Google Authentication step, my Client ID and Client Secret are already filled in (of course). But initially I was confused about whether I needed to create a new Project to add the email capability to the app. You don't have to, you can just continue down to the Authenticate step, but wanted to share that I was stuck for a little bit at this point. Probably need a warning for folks like me who are easily confused, that they do not want to create a new Google API project...

Also - just a minor housekeeping note, seems like you need to add something about allowing Gmail access in the third bullet below on this page:

Also...I know you don't want to rename the app at this point, but we can rename it on our hubs. :smiley:
image

2 Likes

Awesome to hear this is working for you!

Thank you for the feedback, I just edited the post above with upgrade instructions.

Great suggestion! I will get that queued up for the next release. Will wait a bit to see if anyone else raises any issues.

I REALLY want to rename the app but unfortunately it would cause so much havoc with HPM, import URLs, etc. But yes you can rename your own installations of the app via preference.

Thank you for the feedback please keep it coming.

2 Likes

Oh - one thing I forgot - when you are setting up your email address it appears that "Subject" is a required field. Unless I entered a subject the green "Create Notification Device" would not appear.

W/out subject:

W/subject:

For me, at least, I'd like Subject to be optional.

It is on purpose so there is at least a subject to default back to in case it’s not passed in the notification message. There is not a way to require it with the notification message.

Would you like an email without a subject?

1 Like

Sorry - my post wasn't very clear. Regarding this screen:

Because of the note about customizing the Subject that is below the three fields, it led me to believe that Subject was an optional field on this screen.

So I filled in the Notification Device Name and Email address to send notification fields and then skipped Subject and scrolled down and hit "Next" at the bottom of the page and was returned to the main app page w/out the email device getting created. It's obvious now why that was happening, but took me a couple cycles until I had my "aha" and filled in a Subject and got the green "Create" button. Since the create button doesn't exist until all three fields are completed, it's not obvious that the UI is missing anything if you leave one of them blank, so it looked logical to hit Next. :slight_smile:

This may be a just-me issue, as I'm using this for text messages only (sent to the phonenumber@vzwpix.com) so I don't really need a fixed subject, and was thinking I would customize what I wanted for each subject in notifications using the "Subject:, [Content]" option that you provided. I can then choose when I want a subject, and not include a subject when I don't want one.

Hope that makes more sense.

1 Like

@ritchierich Thanks so much for this cool app!

I got it installed through HPM easily, setup the required Google Cloud configuration per your instructions, have created Gmail Notification Devices and successfully sent emails through the Gmail Notification Devices.

Just curious about performance of the Gmail Notifications: Have you noticed any latency/delays or dropped emails in the sending or receiving?

I have been using LGK Sendmail with a free account on smtp2go.com that has worked well for more than 6 months but have been noticing some random delays in receiving emails lately.

2 Likes

To be honest I haven't used this that long but haven't noticed any issues and emails are coming through quickly. I will post here if I run into any issues and hopefully others using it will as well.

1 Like