Homey Community Forum

Trigger a flow using calendar events

You can trigger flows on your calendar events, using the icalCalendar app.

Setup

First thing we need to do is to add your calendar to the app. You have the possibility to add one ore more calendars. IcalCalendar works with Apple, Outlook and Gmail calendars but in theory it should work with any provider asl long as they expose a public ical url (*.ics).
Open the app settings (configure app) and paste in the ical link and give your calendar a name.
If you do not know where to find the link you have to paste, please follow the instructions below:

When you use an Exchange or Outlook calendar:

  1. Go to Outlook
  2. Click settings -> Show all outlook setting
  3. Go to Calendar -> Shared calendars
  4. Publish a calendar, click the ics link and choose copy
  5. Paste the ical link in settings of Homey app

When you use a Gmail calendar:

  1. Go to Google
  2. Click the three dots next to the calendar you want to share -> Click Settings and sharing
  3. Scroll all the way down to the bottom
  4. Copy the link from Secret address in ical format
  5. Paste the ical link in settings of Homey app

When you use an Apple calendar:

  1. Go to Apple , or open the Calendar app on your iOS device or Mac.
  2. Click on the icon next to the calendar name in the left pane
  3. Tick the checkbox for Public calendar
  4. Copy the link
  5. Paste the calendar link in the Homey app settings
    It must be the original link (Apple Calendar has case sensitive urls)

The Date and Time format used in the app can be changed in the settings. If you not change it, the default is used.

Format date:

  • DD = day
  • MM = month
  • YY or YYYY = year

Separated by / - or .

Format time:

  • HH or hh = hour (24h or 12h)
  • mm = minutes

Separated by : or .

Usage

Now you have added your calendar, it is time create a flow that will be triggered.

Triggers

  • Event starts - will trigger when any event starts**
  • Event starts from calendar - will trigger when a specific calendar is selected
  • Event starts in - will trigger when any event starts in when specified
  • Event stops - will trigger when any event stops

Create a new flow and add the card: “Event starts
If you want to add a logic card to AND, you have the possibility to add some flow tokens (tags):

Flow tokens on triggers

  • Event title
  • Event description
  • Event location
  • Event duration
  • Event duration (minutes)
  • Calendar name

The tag information is coming from your agenda.
When you have selected as first card: “Event stats in”, then you are able to add a time variable to it. Enter the amount and unit [Minute, Hour, Day, Week].

You can also add an extra condition. Therefore select “AND” and select the icalCalender app. You see the following conditions:

  • Specific event is ongoing - will check if specific event is or isn’t ongoing
  • Specific event starts within - will check if specific event starts or doesn’t start within when specified
  • Specific event stops within - will check if specific event stops or doesn’t stop within when specified

Finalise your flow adding the THEN section and save the flow.
If you select in the THEN section the icalCalendar app, you can add the card: Sync calendars. This will download new .ics files to update current events.

If you want to add in one of your current flows an icalCalendar token (tag), you can find and add them by:

  • Select Tag
  • Search: icalCalendar

Global flow tokens

  • Next event title
  • Next event start date
  • Next event start time
  • Next event stop date
  • Next event stop time
  • Next event duration
  • Next event duration (minutes)
  • Next event starts in (minutes)
  • Next event stops in (minutes)
  • Calendar name of next event
  • Todays events, title and time
  • Todays events (count)
  • Tomorrows events, title and time
  • Tomorrows events (count)
  • Todays events (per calendar)
  • Tomorrows events (per calendar)

These tokens can be used in any app and service.

Next event tags per calendar (can be turned on in the settings)

  • Next event title in %calendarname%
  • Next event start date in %calendarname%
  • Next event start time in %calendarname%
  • Next event stop date in %calendarname%
  • Next event stop time in %calendarname%

Synchronising

  • The icalCalendar app will automatically sync your calendar every 15 minutes
  • The Sync calendars action flow card can also be used to trigger a sync
  • Only events not started yet or events started but not finished will be fetched
  • Recurring events where start date is within 2 months or less will be fetched

Recurring events

Be aware of multiple/duplicate “recurring” events:
On a recurring event, where one or more participants have declined, that specific event is detached from the recurring event and created as a separate non-recurring event. This can result in two similar events, both have the same name and date.

Ideas & Issues

If you have any ideas or issues, create a ticket in the project on GitHub

6 Likes