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

Somehow I missed the "upgrade instructions". It seems to have worked. Thank you! :slight_smile:

1 Like

Calendar events have a reminder feature that you can set when creating a new event which I find incredibly useful with my day job and personal life. As I tell everyone if something isn't on my calendar then I won't remember to be there. Google has a very flexible scheduling of that reminder letting you set it minutes, hours, or even weeks in advance of an event - done via Google Calendar App or web browser (iOS calendar doesn't allow this much flexibility). This reminder can vary from event to event.

Curious if anyone would benefit on bringing this into Hubitat as I can see a few uses:

  • Notifications: advanced push or speech notification to a calendar event. Trash collection notifications, holidays, etc. Today there is an offset you can define but this is set for all events that match the criteria versus being dynamic based on the reminder of a calendar event. This could also allow a reminder notification to be sent yet switch could toggle based on event start and end.
  • Dynamic offset: have switch toggle or additional actions run dynamically based on the reminder value. Reminders are typically run in advance of scheduled time so could include ability to "delay" start based on this value too. All day events start at midnight but lets say you want to delay the switch toggling 6 hours later at 6 AM.

I am happy to invest some time building this if folks would find this useful. Please let me know your thoughts!

1 Like

I would find it very useful I have a lot of rules that fire based off of the virtual switches from my calendar and have them firing off notifications through echo speaks for reminders or firing off other routines so this would be very useful to me. I love your app I just started playing around with HA and wish they had something like this as well so thank you for your work.

1 Like

I was just looking at this app in my system and thinking "this would be great if it would trigger from reminders for bday's"... and speech reminders are exactly where I was contemplating.

1 Like

v3.4.0 has been published to Github and HPM with these features.
Dynamic Offset based on the reminder setting is found in the Schedule Settings section:

Reminder notification setting is found in the Additional Actions section:

@jriffe90 @gwp1

1 Like

v3.4.1 has been uploaded to Github and HPM updated.

Encountered an issue with one of my calendar searches over night. Basically I am querying my kids calendars for a wake up alarm starting at 2 AM and a default reminder number of minutes wasn't set within their calendar and I started getting errors in my HE logs. This new version will detect this situation and default it to 15 minutes if one isn't set.

You can set a default notification timing within your Google Calendar via web browser:

  • Open https://calendar.google.com within a web browser
  • Find the calendar you want to edit in My calendars within the left navigation
  • Click the 3 dots beside the name and choose "Settings and sharing"
  • Scroll to the Event notifications section and click the + Add notification
    image
  • This will set the default notification for all calendar events within that specific calendar and you can override this on individual events with a different value.

I for the life of me cannot get the created switch to toggle on or off with events. I can see all the event details in the switch's device page and I can Poll or Switch the device but it will not do it automagically. I used this app pre pandemic and haven't had a need for it since but with things now as normal as they're going to be I need it to perform tasks programmed in Webcore based on the switch's state again. What could I be doing wrong? I deleted all the old apps and updated to the latest 3.4.1.
Thanks!

I am going to need more details on your search trigger settings and what type of event you have in your calendar that matches. Feel free to post here or PM me the details. Might need some debug logs too but let’s first start with your settings.

Sent you a PM.

1 Like

Thanks @ritchierich!! For posterity and so that others might check for issues, I had v1.0.0 app code still in my Apps Code section and the v3.4.1 searches were attaching to it vs the latest code.

All v3.4.2 has been published to Github and HPM. @es_ferret uses this app for meeting reminder notifications and he found that the notification was duplicating sometimes after a meeting has started. I refactored the code to only duplicate a notification if one of the variables designated in the notification changed vs any attribute of the Google item changing.

1 Like

@ritchierich I just installed this, and I have a quick question: If "Delay toggle to event start" is turned off, will the value of the "eventStartTime" attribute on the child switch still be set to the actual calendar event time, or will it be set to the time the query runs?

All the event* attributes are set according to the matched Google item. What happens is a scheduled job won’t be created to toggle the switch at the start of the event. It will toggle immediately but you can still reference the actual start time via this attribute.

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.

Download the Hubitat app