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

I noticed on the last update (couple days ago), that now if I have 2 events ending in the same day, I get a notification for the first (proper time), and then immediately I get a second notification with the first and second event (co listed in the event) at the first events time.

IE: Kid1 ends works at 7:00 PM. Kid2 ends work at 7:15PM.

I get one notification that says "kid1 ends at 7:00PM" and then a second that says "kid1, kid2 ends at 7:00PM".

Sorry not understanding the issue. I released an update several weeks ago and you are saying something changed a few days ago?

I will need to better understand your settings for the notifications and calendar examples to troubleshoot.

Sorry, I meant I just noticed the update and did that a couple days ago (3.4.2).
This was what was in the calendar (same day):
Job1: 11:15AM - 7:00PM
Job2: 11:30AM - 7:15PM

I have it set to notify me 30 minutes before the end of their jobs. I got one notification at 6:30PM that says "Job1 ends at 7:00PM" and then a second that says "Job1, Job2 ends at 7:00PM". I never get one specific for Job2 (the later event), and it doesn't have the right end time.

Looks to be something when they overlap in the calendar.

Thanks!

Thank you for the additional details. I setup a test for this morning and will try to reproduce.

Did you update manually or via HPM? If manually you updated both apps and the child switch code right?

I used HPM. Just haven't checked for updates in a while!

OK cool just wanted to make sure something wasn't missed

I haven't been able to reproduce this issue in my testing. How frequently are you polling your calendar? I ask because this app by design only fires for the first matching item found so overlapping items can get tricky unless you are polling more frequently. But this said with offsets in place it might fire an event late. Still doesn't explain the odd text you received but I haven't been able to reproduce.

@lpakula is this setting turned on in your app?

This would provide details on all matching events but would only fire based on the first matching event details.

If you really need separate notifications it would be best to create two separate search triggers for each kid's work schedule.

Hmmm, no, I don't have that set. Right now I configured it for:
Include all day Events: True
Calendar field to search: title
Search string: *
Run: Perdiodically
Frequency: Hours
Range: 1
Start at: 5:00 AM
Search range: end of day
Expand end date for sequential events? True
Delay to Calendar Event start: True
Set offset? True
Start offset: -20
End offset: -20

Send notifications: %eventTitle% ending %eventEndTime%

I haven't reconfigured anything since I set it up a long while ago, so this is a new issue.

1 Like

If you want individual details I would recommend turning off this setting. With this enabled on overlapping events your end notification would be delayed based in the second overlapping event end time.

Has there been similar overlapping schedules before? Curious examples of the notifications you received. With the above mentioned setting set to true and hourly polling I don’t see how you received 2 notifications for the overlapping events. If you recall what version you were on prior to 3.4.2 I can roll back and try to reproduce there.

Please go to the apps code and ensure both GCal apps have 3.4.2 at the top and same for the GCal driver.

If the desire is to have notifications for both kids schedules, separate search triggers is the best solution.

It would have been the last HPM version just before this one (assuming you didn't release a bunch in between). I had been logging in to check, and other apps got updates, but I must have stopped before you released 3.4.2

I unchecked the "expand date for sequential events" to see if that is it. I've never seen this issue before, but I'm not 100% sure that the kids ever had overlapping schedules that close together before. I want to say "no" there was always 30+ minutes between start/end, and this time it was 15 minutes. Could have been one of those unicorn cases!

Cool please let me know how things go. If you go get an odd notification again please check your log for errors and report those here. Hopefully this is just a unicorn case!

Getting back to this: I'm having trouble using the "eventStartTime" attribute in WebCoRE because it isn't in ISO 8601 format. Is it possible to add two new attributes to the child switch, one for start and one for end time, that exposes them either in ISO 8601 format, or as a millisecond epoch timestamp?

This is a user preference in the app where you can change it to the desired format. This setting changes all dates within the child device and app.

I don't think that will work, because the time format is still not ISO 8601 compliant.

It does using Other which allows you to put in whatever you want. Example using:
yyyy-MM-dd HH:mm:ss

Which I believe is what you need
image
image

I have never used Webcore but honestly surprised it doesn't provide formatting capabilities for dates. Dates are always my nemesis when coding as they are a huge pain in the rear.

Edit: Maybe you need to use the following format instead. This is what Google uses behind the scenes in their APIs:
yyyy-MM-dd'T'HH:mm:ss

Using "Other" you can enter whatever format is required by Webcore including time formatting. Again I have no experience with Webcore so you might for help in that community thread.

Sorry about the late response. This is all good with once I unchecked that box. Looks like previously, I never had 2 schedules that would be within my search window before. :ok_hand:

1 Like

@dsegall checking back in to see if you were able to enter a date/time format to solve your webcore issue.

@ritchierich The dev who maintains webcore added a function that allows me to parse times in an arbitrary specified format. Thanks for checking in

1 Like

Hi,

I attempted to provision Google Calendar API access and install the code you authored, using the instructions here:

Under header, " Hubitat Installation and Setup", item 2, at step:
GCal Search Trigger - Import URL is: Google_Calendar_Search/GCal_Search_Trigger.groovy at main · HubitatCommunity/Google_Calendar_Search · GitHub

Import of the indicated code failed, with error message when I attempt to save:
No signature of method: Script1.definition() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:GCal Search Trigger, namespace:HubitatCommunity, author:Mike Nestor & Anthony Pastor, cometfish, ritchierich, ...]] on line 25

I then read in your revision history, that as of version 3.1.0, "Child switch is now optional".
I then thought, "Maybe we go ahead and try making a custom trigger..?".

Finally, when I attempt to use the application, "GCal Search", by creating a new search, I receive error:
App type not found for namespace: HubitatCommunity and name: GCal Search Trigger

The parent application code installed and configured (Seemingly?) just fine. Can anyone elucidate me regarding proper installation, usage?

Are you using HPM? If so it makes the code installation much easier. All 3 components are necessary even though the child switch is now an optional component because of the way Groovy compiles all the code. Please make sure you have the two apps and the one driver installed.

Unfortunately, I didn't use HPM, though I'll try that next, and report back.

Thanks for your swift reply!

1 Like