Start Node-Red automation 15 minutes before Google Calendar event?

Hi everyone! I want to create a node that starts a Node-RED automation 15 minutes before a Google Calendar event and I don’t know where to start. I’ve seen many posts that work in different ways, but I would like to hear a recommendation from someone here to know which way to go.

I created a new Google calendar for this (I need it to be a Google Calendar and to accept invitations automatically, that’s already set), and I want Node-RED to check this calendar (maybe every 30 minutes?) and if there’s an event, it should trigger an automation 15 minutes before the start time of the event.

I installed the “node-red-contrib-ical-events” but don’t understand how to use it, and again, I feel a bit lost and want to know where to start. I saw that there are multiple calendar integrations for Node-Red and some of them haven’t been updated for years, I don’t know if that’s a problem.

Any help or ideas are appreciated.
Thanks!
R.

The “node-red-node-google” nodes can do this. You don’t need to check regularly, you can configure the “google calendar in” node to start a flow ‘x’ minutes before the start/finish of an event.

1 Like

Thanks @michaelblight for your reply!

Ok, I’m trying to go that way but cannot make the node to sign in to the Google API.

I’m getting this message from Google:

image

For the API URL, I tried these options (with my unique ID instead of xxxx)

https://xxxxxxxxxx.ui.nabu.casa/google-credentials/auth/callback
https://xxxxxxxxxx.ui.nabu.casa/redirect/oauth

Do you know what could be going on here?
Thanks,
Rodrigo

I set mine up a few years ago, so I don’t remember much. And once set up, the node gives you no detail. And the documentation is somewhat lacking. So sorry, I’m not much help. Since the node is by the NR team, you might have more luck on the Node Red forum.

1 Like

Don’t worry, I’ll look around and find a solution :slight_smile:
I believe the problem is related to the Redirect URL not functioning properly through Nabu Casa link, I opened a separate post about this.

R.

Did you use Nabu Casa URL? OR are you using a different method?

If so, it would be really helpful to know the format of the Redirect URL you used in the Google API.

This is in https://console.cloud.google.com/

Select the corresponding project on the top left drop down selector,
On the top center search bar write “API” and select “APIs & Services”,
On the left columdn select Credentials,
Under " OAuth 2.0 Client IDs" find your login (mine is called Web Application) and click on the pencil button to the right.
Under " Authorized redirect URIs" you should see the URI that points to your Node-RED authentication.

I don’t need the complete URI, just the format (i.e. https://xxxxxxxxxx.ui.nabu.casa/google-credentials/auth/callback) to be able to understand what could be failing here.

Thanks,
Rodrigo.

I ended up using the event-trigger node from node-red-contrib-ical-events, pasting the iCal link from a public calendar I created in Google Calendar.
The calendar is published in free/busy mode to reduce privacy concerns.
I wasn’t able to configure the Google node, but this method is working fine for the moment and is really easy to set up.

R.

If anyone interested, this can be done with the default time node, just set the target calendar as entity, and the propery value should be attributes.start_time And the offset you wish, for example -15 minutes

1 Like

zolli07 thanks, for a long time I have been wanting to play a reminder on my garage speaker the day before waste bin days, based on my imported calendar from the city. Now when a security camera outside detects motion, home assistant plays a message to take out the appropriate colored bin for pickup tomorrow. Hopefully the mailman will listen to the message as he comes to my mailbox, and will take out my bin for me.