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

Hi Curiosity:

Thank you for responding to me so quickly. How do I place this information in the trigger creation page?

Please can you share a print screen?

What do series of numbers mean?
1708738141 for am, 1708738260 for pm and 1708738202 for am&pm?

THANKS!

Hi,
after parameter contains a date in epoc format and is automatically added to the query. This is the date of the last message that was processed and to avoid being triggered more than once. Btw, by searching unread messages, you can return your messages as often as you want. This will facilitate the development of your Google Email Search.

1 Like

Thank you for answering my questions!

2 Likes

@ritchierich
I seem to have found a situation I cannot figure out. I am trying to make a GCalSearch trigger that will toggle a switch ONLY at the start of an event, and do nothing at the end of the event. Currently, it will toggle the desired switch to OFF at the beginning of the event as desired, but then automatically switches it back ON when the event is ended on the calendar. I want a trigger that ONLY triggers the switch at the beginning of the event, and ignores the end time of the event. How can I make this happen?

This is the default behavior where the child GCal switch follows the calendar event and will toggle at the start and end of the event.

Your use case of not toggling at the end has never been requested with the child switch.

I am actually not using a child switch, but a external virtual switch. (I named it as if it were a child switch to maintain consistency with the rest of my GCalSearch switches)

I thought based on the description provided above this option, that I could do a single time toggle by controlling an external switch and choosing the desired switch state, but it seems that even this method also reverts at the end of the event and turns the switch back to 'On'.

Since this functionality hasn't been requested yet, I guess I'd like to request this option if it isn't too difficult to implement. I would happily send a donation to your PayPal if you'd like to link it (I don't see a link in the parent app page or at the top of this thread for donations)

(Also, I just noticed that there seems to be no toggle to enable Description Text in logs on any new GCalSearch triggers I create, but the toggle still exists on older ones. ??)

Just spent a little time and got this implemented. The Additional Actions \ Control Switches from calendar event details has this functionality and I was able to copy some code to make the change quickly.

I have uploaded the changes to a Beta version in case you want to test it out today.
You can download the code here and all that is necessary is to update the GCal Search Trigger App:
https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Beta/GCal_Search_Trigger.groovy

I will get a new version posted to Github and HPM tomorrow with this change.

1 Like

Awesome I'll give it a shot right now :+1:

1 Like

Version 4.6.3 has been posted to Github and HPM.

  • Fixed issue in Search Triggers where 'Enable descriptionText logging' wasn't available for all Additional Action options
  • Added option to disable toggling of switches at the end of a calendar event when using Additional Action Toggle Switches capability

Thank you @a.mcdear for brining these to my attention!

2 Likes

Tested and the new option to only toggle once works perfectly. Thanks so much!

1 Like

I'm looking at possible adding in some calendar event parsing so I can get a little more granular with my notifications. Using a hub variable in the notice. I don't know if the following can be done or not though. I understand that the parser will take everything after the Text Prefix, but could it be set to take anything before the text? Or maybe even anything/everything except for the text?

For example, I have everyone trained to enter an event on a family calendar as "Person1 visit" or "person2 visit". I use the gCal search to monitor for "visit" and can then automate things based on a visitor coming. But being able to extract out who the visitor will be, Person1, Person2, etc., would be fantastic. And also not require me to retrain everyone to change the format of the event to "visit person1" or "visit person2".

Just want to confirm that person2 visit is on its own line within the description of the event

Definitely possible will need some time to figure out how best to describe this since the entered text is no longer a prefix.

@3rdStng 's response to this, I expect, may or may not be the same as others.... Just my 2c from the sidelines...

OH! The "description" of the event and not the title of the event? If so, I misread that. Nobody uses the description of the calendar event. They only put their name followed by visit in the title of the calendar entry.

1 Like

My bad I haven't touched that code in a long while and forgot you can choose different attributes within the calendar event including the title. Sorry for the confusion.

Looking at the code it is a quick change to get this working for you. In the current version I have a check to ensure that the parsed attribute "Starts with" the value of the Text Prefix and that can be changed to do a contains like search instead.

Would you mind testing this to ensure this will work for you? I uploaded a Beta version to Github

  • Navigate to Developer Tools \ Apps Code
  • Open the GCal Search Trigger app
  • Click the Import button at the top of the screen and enter the following URL:

https://raw.githubusercontent.com/HubitatCommunity/Google_Calendar_Search/main/Beta/GCal_Search_Trigger.groovy

  • Click Save and give it a try. Feel free to try it for a few days and report back. Thanks!
1 Like

Thanks for the amazing turn around time. Got it imported and noticed a few things.

  1. It is case sensitive. If my calendar entry contains "visit" but the parsing text is "Visit", the variable doesn't get updated.

  2. When the switch turns off, it didn't reset the variable to what was defined. Now granted I didn't actually wait for the switch to turn off, I deleted the event and polled the switch, so maybe that has something to do with it?

  3. When I set an event based on a time range, and then I poll the calendar, nothing happens. Pasting the debug logs below if that helps. IIRC, a future event would populate the Current States but the switch wouldn't turn on until it's time. Even setting the event to start 20 minutes ago and poll, nothing would happen.
    3a. Setting the event to an All Day worked to set the variable. The unset/reset didn't, as noted above.

Just to confirm you have case sensitive matching at the top disabled? Unfortunately Groovy is case sensitive so I will need to figure out how best to handle this in variable parsing too as this hasn't come up before and to be honest this isn't a feature I utilize in my own setup.

Will have to test this. Likely because you deleted the event before the scheduled end job could run and clear out the value.

Not sure I understand this. Depending on your settings above Additional Actions the event should be found by the app and scheduled things to occur based on the event time settings unless you turn off the delay setting.

This is odd because this is how I frequently test this app. Unless of course the event ended before the current time because events that span the current time will trigger the additional actions within a few seconds of it finding an event at the time of the poll/refresh.

Yes.

I'll test again tomorrow. The hub I was on only has 1 gCal search trigger, and it has criteria to offset the start and stops. (I forgot about them.) This could be part of my issue too.

Regarding Groovy's case sensitivity, a work around, at least for me, could be two parsers. One using Visit and a second using visit.

I could leverage the search setting to dictate text parsing case sensitivity too. That is not in the current version.

1 Like

@3rdStng I posted a new Beta version to Github please give that one a try.

Parsing the text is now case insensitive. The case insensitive option at the top is not leveraged when using Google search matching so decided to make it case insensitive by default.

I tested this and it does work at the end of the calendar event. If you want to blank it out, please make sure you put in a space in the Value to Set field because blank won't do anything.

@salieri making you aware of changes to the Additional Actions text parsing since I know you leverage it for Airbnb emails. Want to make sure there are no impacts to your use of this app.

3 Likes