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

Getting the following error when attempting to update:
Error Occurred During Installation

An error occurred while installing the package: Failed to upgrade driver https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Driver/Gmail_Notification_Device.groovy. Be sure the package is not in use with devices.

Tried rebooting Hub and running HPM update process a few times. Is there more logs that would shed more light on this error?

Never seen that error before. Searched the community and see this has popped up with other apps. Try repair in HPM instead and see if that resolves it.

1 Like

Thanks for the advice, this has fixed the issue.

2 Likes

Version 4.6.5 has been posted to Github and HPM:

  • Fixed an issue where Additional Actions \ Text to Parse feature isn't parsing text correctly. Refactored the code.

Thank you @salieri for letting me know of the issue. @3rdStng FYI since I know you use this feature. You should be good to go but let me know if you run into any issues.

3 Likes

I have a couple of questions.

What happens if I run the query every 5 min and a calendar entry is removed?
Is there a way to grab the title of the match so I can use it for a txt to speech notification?

When a match is found several GCal Switch attributes are set with the details of the calendar event. These are then reset to a single space value when either the event completes or the event is not found on the next refresh.

Yes the event title, location, start, end, etc are all stored as attributes and can be used for notifications. Within the search trigger you can send notifications including these attributes without the need of other apps but this said you can leverage Rule Machine to send notifications as well.

Edit: Pictures often help

At the top of the search trigger you will find the matched event details:

In the Additional Actions section of the Search Trigger app you can natively send notifications and details of the matched event:

You can optionally create a child GCal Switch (setting within the Search Trigger app) and it will also contain the event details so you can "listen" for events on the attributes for rules and apps:
image

1 Like

Hello! Very much love this app and been using it since ST days as well! Thank you!

Question I had was whether it was possible for both start/end time to separate the date and time values instead of having it combined? Finding it would be easier to pull those values as two separate states into WebCore for some automations.

1 Like

What’s the use case?

I haven’t ever used Webcore, used the ST Rule Machine App and jumped ship to HE 6.5 years ago and still haven’t explored. Does it have the ability to split a string field? I ask because you could split the date/time based on the space between the two. I haven’t ever needed to use the pieces separately so trying to understand.

@ritchierich, it's been a very long time! My previously configured GCal search eventually stopped working. I think through a bunch of the subsequent updates, I needed to reconfigure it. Looking at the app now, it looks NICE! so many new options and refinement to old features.

I'm back with a new use case: Using some rules, virtual switches, variables, I had implemented a way to tell other rules when my daughter doesn't have school on a usual weekday. It would adjust morning alarms, bed times, thermostat, and more. But the end date and time were manually set and then the holiday switch turned on. Now, I want to have the holidays entered into a calendar, and then the holiday routines to turn themselves on and off, with no need for any of my input (other than calendar entries).

Ask: in order to keep things backwards compatible, would it be possible to somehow access the ending trigger date/time from the GCal virtual switch? Currently, I can SEE the eventEndTime in the switch, but can't access the value in a Rule. More preferably, I would like to access something like an eventEndTriggerTime that would already have the offset included.

I can use the eventEndTime in a Condition to compare, but I can't extract that value.

Any ideas?

1 Like

One of my primary use cases developing this app was school calendars and every year I create a spreadsheet of the holidays and import that in my calendar so I have access to it for morning routines. My kids are older now and I have since changed things where they manage their wake up and they simply enter a “wake up” appointment into their calendar and that gets picked up and lights and music come on. I even have that setup for my wife and I too when we both need to get up.

In the child switch there is a preference to use the offset for the switch times values. Is this what you are looking for?

Regarding rules, you should have access to all the switch custom attribute values. I am not really following what version you came from and what features were added that make your rules work.

1 Like

Cool! My daughter is still too young to set her own alarms. I like the idea for the adults! Thanks!

Unfortunately, no. I want to take the value of eventEndTime and use it in Rules. How do I access it in a Rule to assign to a variable?

Screenshot 2024-09-13 at 11.19.36 AM

Don't worry about this part of my comment. :slight_smile: Basically, a lot has changed, for the better, in the last two years in your app. It's great!

I am definitely no expert on Rule Machine and most of mine are simple and once things get too complex I write my own custom app. Device state attributes are all strings and there is not a notion of a date type state value unfortunately. Within a rule I was able to set a string variable to the value of my calendar switch:

Now from here is where I don't have the knowledge about RM to know if you can then turn the string into a date and then how to trigger things from a date variable. Now this said, could you explain more on how you are using the variables in your rules and the adjustments?

The child switch turns on and off based on the event start and end times. Could your rules just use the fact that the switch turns on and off vs date variables? Within rules you can even have a wait for event and that could be the switch turning off for example. It is also worth mentioning that the child trigger app can run rule machine actions at the start and end of an event too - found in the Additional Actions section.

The current version of the app can set variables based on text found within the calendar events so variable setting is already there. I suppose this could be extended to allow the setting of variables based on the values from the matched calendar events. This said this opens up a can of worms for data and variable type validations.

2 Likes

@neerav.modi Would the ability to map event attributes to Hub Variables be useful?
image

This would be added to the Additional Actions section of the Search Triggers but idea is at the start of the event, the variables chosen would be updated with the value from the Google Item (calendar event in your case) and then at the scheduled end it will blank out the variable value. Above screenshot is just a quick example of what things could look like.

1 Like

Thank you for such a detailed example and moreover, the explanation of what each thing does. I have learned a lot and it gives me additional ideas for automation rules.

Though more convoluted than one might want, you guide would work really well to seamlessly integrate into all of the other rules and switches that are already implemented.

THANK YOU!

1 Like

That would be MOST useful to me! I don't know how useful it would be for others, but I can imagine that mapping to Hub Variables could open the possibility to do quite complex things by using multiple offsets to those variables. That just gave me an idea to make calendar entries for controlling lights for various holidays, scheduling vacations, and more!

Another, possibly simpler implementation: create another set of attributes that preserves the date/time from the calendar as a date/time instead of converting it to a text string.

Really, either way works. Thank you for considering this!

1 Like

With dates I would convert it to a valid date so it maps correctly to a date type variable which you can then use to schedule things within RM.

I will spend a little time to build this out over the coming days.

2 Likes

@harmony7 These steps worked perfectly! The hardest part was correctly entering the date format into the calendar app.

Looking forward to it, but no rush. Thank you again for considering this feature.

2 Likes

In my case I am using GCal to for sporting events and then from webcore I am trying to grab the date as an initial trigger and the time as a more immediate trigger. Webcore however cant seem to pull either out of the unified date and time. While not an expert at it, I have tried a few different methods and am fairly confident that the issue is how the eventStartTime and eventEndTime is reported together.

Reading a bit further down to additional inquiries recently it might seem that using date/time variable as opposed to string might help me as well so I can wait and see if that solves it for me!

1 Like

@SergL @neerav.modi questions on the use of the date variable in rules (or anyone else that would find this enhancement useful):

  1. When would you want the variable set with the start/end date of the calendar event? When the refresh runs in advance of the dates or have then set at the event start? Guess I could make an option for either of that is useful.
  2. With the existing functionality of setting variables from text within the events, I have an option to set the variables to a value at the end of the event. I might be overthinking this but was planning to implement this here as well though maybe it is not necessary to please let me know. In a bit of testing I am finding that I cannot null out a date variable. Not knowing how these date variables will be used, curious if this will be a problem. I could set it to Unix epoch time at the end of the event: January 1 1970

Thanks

1 Like
  1. For me it would be best at the time of all the other data population. At the start of the event would be to late for me to use as prior notifications.
  2. This would not apply to my use case. For me all I am looking for is the description, start date, start time, end date, end time.

Much appreciate your work!!

2 Likes