# \[TUTORIAL\] Trigger a flow using calendar events

**URL:** <https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017>\
**Category:** Tutorials\
**Created:** [August 26, 2020, 11:37am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017 "2020-08-26T11:37:14Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [September 11, 2022, 8:51am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/41 "2022-09-11T08:51:15Z")

</div>

Oh so good! the moment.format is super nice!  
The format works perfectly.  
Thank you once again!

However, I am getting a bit of some wrong data.

![ical](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/d/3d4f8cee6939c516a9819b3dc497891c38be8535.png)

My **Next event title** and **Next event start/end time** is correct but that will start on the 14th, not the 3rd.  
**Todays events** is showing yesterdays event and count.

I have never used/noticed **“Variable” (contains)**, what are those and are they supposed to be **“-”**?

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [September 11, 2022, 9:10am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/42 "2022-09-11T09:10:01Z")

</div>

It might sound like you have used the wrong format, maybe switched **Do** and **do**?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/5/a530988007fe3350326ad83c8ef04a0b2907416c.png)

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [September 11, 2022, 9:18am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/43 "2022-09-11T09:18:21Z")

</div>

> [@j\_wak](#):
>
> I have never used/noticed **“Variable” (contains)**, what are those and are they supposed to be **“-”**?

> **[GitHub - runely/calendar-homey: Gives Homey flow cards to trigger on your...](https://github.com/runely/calendar-homey#next-event-tags-containing)**
>
> Gives Homey flow cards to trigger on your calendar events - GitHub - runely/calendar-homey: Gives Homey flow cards to trigger on your calendar events

---

<div class="post-metadata">

**Author:** ![HuisCHovens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/huischovens/32/16973_2.png) [@HuisCHovens](https://community.homey.app/u/HuisCHovens)\
**Post date:** [September 11, 2022, 9:31am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/44 "2022-09-11T09:31:08Z")

</div>

@Peter_Kawa How do you get that capital letter on the weekdays I used this designation:  
ddd DD-MM

I get small letters.  
If I change that small d to big it doesn’t make sense anymore.

---

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [September 11, 2022, 9:34am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/45 "2022-09-11T09:34:13Z")

</div>

Indeed I did … **facepalm**

---

<div class="post-metadata">

**Author:** ![j\_wak](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/j_wak/32/56668_2.png) [@j\_wak](https://community.homey.app/u/j_wak)\
**Post date:** [September 11, 2022, 9:35am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/46 "2022-09-11T09:35:30Z")

</div>

ah ok perfect, I did not check github, only the top of the thread.  
I’m starting to get the hang of the community, I am still a newborn xD

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [September 11, 2022, 9:53am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/47 "2022-09-11T09:53:07Z")

</div>

It depends on your _locale_.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/5/f53d5e3a3d56cab2e51224c478142dbb20e26646.png)

---

<div class="post-metadata">

**Author:** ![HuisCHovens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/huischovens/32/16973_2.png) [@HuisCHovens](https://community.homey.app/u/HuisCHovens)\
**Post date:** [September 11, 2022, 9:59am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/48 "2022-09-11T09:59:21Z")

</div>

ah okay and that can certainly not be changed because then hole homey will change?

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [September 11, 2022, 10:25am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/49 "2022-09-11T10:25:07Z")

</div>

Correct. The _locale_ is determined by the Homey itself. If your Homey is set to one of the languages my app supports, it will use that _locale_. If it’s set to another language which my app doesn’t support, it will fallback to english ( **en** )

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [September 11, 2022, 10:56am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/50 "2022-09-11T10:56:59Z")

</div>

Yes my Homey is set to English.

---

<div class="post-metadata">

**Author:** ![BenOkk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/benokk/32/72340_2.png) [@BenOkk](https://community.homey.app/u/BenOkk)\
**Post date:** [March 29, 2023, 8:41pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/51 "2023-03-29T20:41:02Z")

</div>

Hi everyone,  
I’m using IcalCalender for my vacation home to switch on or off the heating, when guests move in or out.  
My logic should work but I’m using “Title” (or “Next eventtitle”) for starting different actions and it looks like that “Title” is mixed up.

I have two flows:  
**Event starts**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/f/effe55d233f25e7f5545f0f38f7f36409add695c.jpeg)

**Event ends (with “Any event is ongoing”)**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/5/a53c04f6d881ad6dcfe418e5718bd5c7764f0e8e.jpeg)

For testing I’ve set up 4 calender events behind each other with 15 minutes duration:  
15:00 - Guest A  
15:15 - Guest B  
15:30 - Guest C  
15:45 - Guest D

Because the “Event ends” flow doesn’t work, I let it sent me the “Title” and “Next eventtitle” via Push Message every time it’s executed, and I get the following:  
15:00 - Guest A

- No “Event end” flow

15:15 - Guest B  
PM send at 15:16 with

- Title: Guest A (I would expect “Guest B”)
- Next Eventtitle: Guest C

15:30 - Guest C  
PM send at 15:31 with

- Title: Guest B (I would expect “Guest C”)
- Next Eventtitle: Guest D

15:45 - Guest D  
PM send at 15:46 with

- Title: Guest C (I would expect “Guest D”)
- Next Eventtitle: Nothing

Does anyone know why “Title” uses the title of the previous event? Especially as I’m using “Any ongoing event” I would expect that it uses the title of the actual event. Is it a bug?

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [March 29, 2023, 9:06pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/52 "2023-03-29T21:06:00Z")

</div>

As long as you are using the **Title** tag from the trigger card, the **Title** tag will reflect the **Title** from the event being started.

I don’t see your full flow so it’s kind of hard to know what’s going on. Could you please share your full flow?

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [March 29, 2023, 9:08pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/53 "2023-03-29T21:08:05Z")

</div>

The **Next event title** is a global tag and has nothing to do with the tags from the trigger card. The **Next event title** always holds the name for the next event to be started

---

<div class="post-metadata">

**Author:** ![BenOkk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/benokk/32/72340_2.png) [@BenOkk](https://community.homey.app/u/BenOkk)\
**Post date:** [March 30, 2023, 3:43pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/54 "2023-03-30T15:43:52Z")

</div>

Okay, thanks for clarifying.  
Here are my full flows.  
**Event begins**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/6/0619687e4f3493766e7a8db6e7cac37b142bcb15.jpeg)

**Event ends**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/3/f384f054da059f9da19c8cc39cc149f87ea9441f.png)

I use the “Title” to differentiate between periods. If “Nicht verfügbar” (Not available) is the title, the heating should turn off as well. As the start and end time can be the same, I place the “delay” in the event end flow to make sure that the “event ends” flow is executed after the “event starts” flow, but it still returns the title of the previous event instead of the actual running event. Whereas “Event starts”, which runs before, gives me the correct title of the newly starting event.

My event test set up in Google calender looks like this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/4/a4fb14867561de18d3401b6c44dc9bb5ab3fc299.png)

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [March 30, 2023, 5:08pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/55 "2023-03-30T17:08:36Z")

</div>

Just tried here and everything works as expected.

![Skjermbilde 2023-03-30 kl. 19.03.15](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/d/ed27db5ae1d8d55a2a4832645fcb61363363db11.png)

 ![Skjermbilde 2023-03-30 kl. 19.07.21](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/0/008bb30b739546eadaae3783e57dcf237d5faa84.png)

 ![IMG_0194](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/9/996f5de43dad6051e34b422c26a87c9de7c28efc.jpeg)

---

<div class="post-metadata">

**Author:** ![BenOkk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/benokk/32/72340_2.png) [@BenOkk](https://community.homey.app/u/BenOkk)\
**Post date:** [March 30, 2023, 5:45pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/56 "2023-03-30T17:45:11Z")

</div>

Okay, I’ll check it again but your results are mixed up as well. “Event b starts” before “Event a ends”. Is there any possibility to bring this in the right order?  
For triggering a heating it’s not useful if it’s turned one with “Event b starts” and directly turned off again with “Event a ends” after.

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [March 30, 2023, 5:58pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/57 "2023-03-30T17:58:43Z")

</div>

If you look at the timestamps, they are logged at the exact same time, meaning they are equal and Homey will anyway be the one who determines which trigger card will be triggered in which order.

You see this on **Event b ends** and **Event c starts**

---

<div class="post-metadata">

**Author:** ![BenOkk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/benokk/32/72340_2.png) [@BenOkk](https://community.homey.app/u/BenOkk)\
**Post date:** [March 30, 2023, 8:28pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/58 "2023-03-30T20:28:34Z")

</div>

Okay, thanks. Then I’ll have to find a different solution for this.

---

<div class="post-metadata">

**Author:** ![runely](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/runely/32/28153_2.png) [@runely](https://community.homey.app/u/runely)\
**Post date:** [March 30, 2023, 9:11pm UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/59 "2023-03-30T21:11:09Z")

</div>

If you have these events in a separate calendar you can use the `Event ends` trigger and the condition card `Event containing ... in calendar ... starts within ...` to check if the next wanted event starts within a reasonable time

---

<div class="post-metadata">

**Author:** ![Zafar\_Iqbal](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/zafar_iqbal/32/65202_2.png) [@Zafar\_Iqbal](https://community.homey.app/u/Zafar_Iqbal)\
**Post date:** [July 27, 2023, 7:33am UTC](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017/60 "2023-07-27T07:33:46Z")

</div>

Is it possible to get Ical to read title of al events for next 24/ 48 hours?

Title next appointment only returns one appointment not all.

[Previous page](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017.md?page=2)

[Next page](https://community.homey.app/t/tutorial-trigger-a-flow-using-calendar-events/34017.md?page=4)
