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

Thanks so very much for the information and the prompt reply. I will switch over to your new version and give it go! I truly appreciate all your work.

1 Like

@CoreDex I made some great progress today and just uploaded v3.0.2 that allows you to skip the child switch requirement. It adds the ability to send notifications and run rule actions directly from a search trigger. Let me know if this meets your needs!

Assuming no issues, I should publish this new version next week for everyone.

Hello @ritchierich ! I got to test your latest code version (3.02) and everything seem to work fine!
This week I will probably create a bunch of child apps representing my tasks. Is there any chance a new code version my cause me to have to delete them?

I tested both Tasks and Reminders and both of them captured the calendar info and toggled it correctly. However, I see in the log that the start time of my tasks always come as midnight, which is not correct. Do I need to update the DateTime format field in your app to capture it correctly? Right now this is not causing me issue just because I am setting the Search Range to 24 hours.

As a last point, I just want to confirm one thing: I am setting my Tasks (in your app) to be toggled in the time the query is made. Are they going to be toggled again at the time of the task)? I understand that's the behavior for an event, but since the Tasks don't have End time I just want to confirm the behavior here.

Great work!

Thank you for testing! v3.0.2 will be my path moving forward where I combine calendar, reminders, and tasks within one child app vs separate. Apologize for the extra effort upgrading. This decision will save me a bunch of time long term.

Unfortunately this is to be expected. The Task API does not provide the due date's time and defaults to midnight regardless if another time is set. I wish I could do something to fix it but unfortunate not. But the Reminder API does provide the time so maybe reminders is a better option? You might try both to see as you can always switch back and forth with the current design without impacting your child switch, rules, etc.

With calendar events there are scheduled jobs created to toggle the switch at the event start (if Delay Event Toggle Preference is ticked) and another at the end of the event. With Tasks and Reminders it will only toggle with the start of the due date and no second trigger to turn it off. The only situation where this could happen is if the search trigger doesn't find a matching task/reminder. I saw this happen with daily recurring tasks but weekly worked fine. This was due to the API seeing the new task and not providing that yesterday's was still outstanding. But toggling the switch will complete the task/reminder in Google.

Keep me posted on your use of the app and if you run into any issues.

1 Like

@ritchierich Thanks so very much for taking these into consideration and for adding these features. I really appreciate it. I am going to give this version a try (likely later this week), and I'll share any feedback. Really great work!

1 Like

I think you're talking about this... works great.
Rule 5.0 API

1 Like

Yes thanks. After my post I found that and got it working with 5.x too. Appreciate it!

@maxnet21 and @CoreDex thank you for your recent inputs. I have officially releases v3.1.0 to GitHub just now. If you used HPM to install the apps it should prompt you to update to the latest version. @CoreDex I found a bug with a trigger with no child switch that is fixed in v3.1.0.

As mentioned in the release notes in post 2 above, please follow these upgrade instructions. I spent a bunch of time on error handling and testing upgrades so existing calendar searches should continue to work if you cannot immediately get to the required Google Console credential changes mentioned in the upgrade instructions.

2 Likes

Just upgraded via HPM. Everything seemed to go smoothly. Thanks again for a great app.

1 Like

Hey @ritchierich , just a quick thing it occurred me about Tasks always coming as Due date midnight:
Any chance you receive the start time of the task instead? Maybe that's the data we should look into for a task, instead of the due date time... (I have the impression I had seem the task start time showing up somewhere)

Update: Nah, I think it was just a mirage. In any case, I started googling about it now and found google API documentation mentioning methods that are supposed to bring that, but I assume that's exactly what you went through.

I wish it came across but as shown previously in my screenshots it always defaults to midnight of the date set. I have seen enhancement requests to Google to fix but those have been outstanding for a few years now so assume it won’t be fixed. Try reminders since date and time to come across.

1 Like

Yeah, the reminders part is working perfectly about reminders due time etc.
Important to notice that in either case (task or reminder) the API brings past tasks/reminders that were still not marked as done. This is exactly what I need so that's awesome.
For anybody else reading this, at this point I strongly advice to use reminders over tasks :slight_smile:

Cheers!

1 Like

This is a very slick app to have! I've been looking for a way to get reminders of my kids "end work time" so the wife can go out and get them.

Issue I'm seeing (maybe as per design and not an actual issue) is if:

  • event to occur at 9:30 AM
  • set offset to -30
  • set notification of "%eventTitle% ending %eventEndTime%" to my phone
  • at 9:00 AM the notification fires, but the eventEndTime it displays is the eventEndTime-offset not the straight eventEndTime

@lpakula Do you have a child switch? If yes please pull up the device and show me the details along with your calendar event details in Google. Need details to replicate on my end to troubleshoot.

I was just checking this with almost full defaults:

Google Calendar:

  • Create a calendar event that starts before current time and ends after current time.

GCal: (almost full defaults)
Search Preferences

  • Calendar Event
  • same calendar as the Google Calendar above
  • title
  • enable case matching
  • Asterix

Schedule Settings:

  • Periodically
  • Hours
  • Every 1 hour
  • Start at 8AM
  • Search range: End of Current Day
  • Expand end date for sequential events enabled
  • Delay toggle to event start enabled
  • Set off set enabled
  •  Start: -30
    
  •  End: -30
    

Child Switch Preferences:

  • Create child switch disabled

Additional Action Preferences

  • Send notifications enabled
  • Custom message start: %eventStartTime% %eventEndTime%
  • Custom message end: %eventStartTime% %eventEndTime%
  • Send notifications to devices:

As a check, if I go to the app, click "Utilities", "Sync all calendars..." and then "next", I will get a Hubitat notification for the calendar event, but the start/end time displayed are actually the -30 minutes (my offset).

Hope that helps to replicate? Let me know if you need more info!

1 Like

Extra note, if deselect "Delay toggle to event start", then it displays the current time when fired, with the offset added as well.

Thank you for the details. Bug was replicated and fixed in v3.1.1 that was just uploaded to GitHub and HPM. Thanks for letting me know about the bug!

You might also find this release useful since you aren't using a child switch, I added matched item details at the top of the search trigger app below the Pause and Refresh buttons.

Thanks! Reports perfect now.

One thing I did notice is if I use I pick the schedule to run periodically, that if it runs and the calendar event is still ongoing, you get another notification.

For example, I set a calendar event for 8am to 5pm, with the schedule to run every hour. On each hour (from 8-4), I get another notification on my phone saying there is an appointment at 8am.

Is it possible to have two instances of this app, for the calendars of different users, and run on a single hub?

Arg OK I will look into that.

Yes you can install apps multiple times though with current version the app will stay the same. I will add the ability to rename the parent app so you know which one is which in a future release. Another idea is sharing the calendar from one user to another. I did this with my son's calendar where I have access to it via my account and it shows up as another calendar selection.

1 Like