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

@ritchierich

First of all, thanks for your hard work.

I was wondering if this is possible, I have a calendar with only "All Day Events" with multiple per day. I want to get all the events scheduled for today (preferably in one call, but can do it with multiple if needed). After looking at the code, it looks like getNextEvents in GCal Search gets all the events, but poll in GCal Switch doesn't get them.

Any suggestions would be appreciated.

Alan

The way this works is scheduling is done via child GCal Search Trigger app with further on/off refinements in the GCal Switch driver. The Search Trigger app always calls Poll in the child Switch to initiate the query, which in turn calls the parent Search Trigger getNextEvents which in turn calls the GCal Search getNextEvents telling it which calendar to query since that setting is part of each child Search Trigger app. GCal Search will gather the events and pass that down to the child Search Trigger app to process the match.

You should be able to insert your code in the Search Trigger getNextEvents function. There you will find code that filters for all day events already for example code. Entering a search string of * will get all events for that calendar.

1 Like

Thanks for the help. Made the changes. Had some issues with End date/time, so I decided that when you want multiple events, they must be all day events (what I wanted anyway). I know, cheating, but didn't really want to write extra code. I guess I code parse the list, but didn't. If you want to code, happy to share.

Alan

Programming with dates is the bane of my existence. Bang my head every time. When I first published this project I had simple scheduling because of that but over time community members wanted more flexibility and thus I added it in.

I don’t fully understand your specific use case but if you could explain and if others desire this feature I am happy to explore.

Primary use case is to load all the All-Day events I have on today's calendar. So, if I have multiple All-Day events, I want to know in the morning and display on my Dashboards. Hope this helps!

Alan

Ah got it. @bptworld has a driver that can do this already though haven't used it myself so don't know how it connects:

I wanted in my own notification tile (custom code), but I will look at Bryan's work.

1 Like

Bryan work is very sophisticated but what I wanted was just the events on today.

1 Like

What about this one (sorry if it's already been mentioned):

1 Like

Hi @ritchierich,

Great work on this app, just installed it and started playing...

Is there a way to have the switch turn on if an event is found anywhere on the day? I've setup entries in my calendar for when my local football side play, configuring each calendar entry based on when the game will be played. I would like the linked switch to turn on to indicate today is "game day". I know I could use the offsets, but the start times are not always the same, would be nice if there was a specific option for this use case.

Thanks,
Simon

If I can add another request while I am at it, would be nice to have a formatting option for the start and end time attributes. Perhaps still have the default the way they are currently stored, but an option to enter a format string would be nice. If you use the existing attributes for any logic, then maybe additional attributes for start and end as formatted strings would be the way to go.

Also, do you have any plans to implement a tile layout at all?

Thanks,
Simon

Want to make sure I understand the request, do you have the search running once a day and you want the switch to turn on at the time of the query regardless of the actual matching event timeframe? If yes thinking a “delay toggle” type preference that defaults to on could be added and when off it would toggle switch immediately if a matching event is found regardless of start time. But I would assume you would want the end time to remain and switch turn off at the end of the matching event, with offset option too.

Ugh I hate programming with dates and I had issues with formats and comparing dates in the code. So know there is room for improvement. Are you any good with programming dates? :joy: Definitely open to pull requests. Thinking the easiest approach would be to use the hub location setting as the preference versus offering a new setting.

I do not but open to pull requests. I don’t use dashboards at all so not much use for me.

1 Like

I think so.... :slight_smile: Yes, read it again, you have interpretted it correctly. I run the query at 4am every day, if my team is playing later that afternoon, I want to have the switch turned on a 4am. I like the idea of the switch preference and the naming of it. The end time I hadn't really thought about, but turning it off at the end of the event sounds like a good solution too.

I know what you mean, it is a nice feeling being the one asking... :slight_smile: You can use a driver of mine as an example if you want. All I'm thinking is something similar where you can provide a format string as a preference setting, a blank could act as a switch to use the default. Not the most user friendly for those not into programming, but functional, as long as you include a default in the code, so the user doesn't HAVE to provide a format string if they don't know how.

With the tiles, I'm not motivated enough to take a stab myself, was only interested to find out if you were intending to, there's probably enough alternatives, and you can never please everyone with the layout, so it's a small win for a reasonable amount of work I expect.

Simon

@sburke781 I just uploaded v2.4.1 to GitHub. Added the following new preferences in the GCal Search Trigger app:

  • Delay toggle to event start: By default the switch will toggle based on the matching Event Start Time. If this setting is set to false, the switch will toggle at the time a match by this search trigger. The switch will continue to toggle again based on the Event End Time.
  • Date Format: You can now choose the Date format for dates set within the child GCal Switch. By default the time format set within the hub settings will be used however you may choose "Other" and enter your own custom date/time format.

@alan564923 you might be interested in the date format updates with your custom edits to show the dates on a dashboard.

HPM has been updated as well and you should be prompted to update.

1 Like

Thanks I will look at it. I don't display the date/time on my dashboard just event titles.

1 Like

The switch for my calendar search turned on when I ran the search this morning. So the changes works the way I want it to, thanks for getting it in so quickly.

1 Like

I'm getting an error in HPM when upgrading to this version. It's related to the "switch" driver and causes HPM to state it's rolling back.

I am not able to reproduce this. When I launched this new version a few days ago, I was getting a rollback with the .0 release when I was updating my production hub via HPM and realized I had mistakenly updated the main and child app with the same code and had to fix that via the .1 release. I just verified and GitHub has the right code. I just performed a HPM repair on this app and got no errors.

I just performed a repair in HPM, it completed without issue. But now I have two GCal switch drivers and the older one is still linked to my current searches so I can't delete it. Probably best to delete all searches and then rebuild them?

EDIT: Disregard, I just copied the raw URL into the original driver, imported, and deleted the newly created driver and all seems good now.

Cool glad you got it sorted. Curious did you go from 2.3.x to 2.4.1 or did you install 2.4.0?