# Using the agenda/calendar in scenes

**URL:** <https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525>\
**Category:** Demandes livrées\
**Tags:** feature-core\
**Created:** [September 4, 2020, 8:55pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525 "2020-09-04T20:55:15Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Romuald\_Pochet](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/romuald_pochet/32/6441_2.png) [@Romuald\_Pochet](https://community.gladysassistant.com/u/Romuald_Pochet)\
**Post date:** [November 1, 2021, 9:26am UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/21 "2021-11-01T09:26:24Z")

</div>

> Citation  
> No problems, there was nothing negative in my message!! 😛

No worries, it’s just my first real PR so I wanted to make sure I did things right to not break everything 😉

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [November 12, 2021, 3:36am UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/22 "2021-11-12T03:36:21Z")

</div>

@Romuald_Pochet For information, for calendar sharing, we are considering two types of calendars with @bertrandda:

- «&nbsp;Shared&nbsp;» calendar accessible to all users of the Gladys instance and in the scenes
- «&nbsp;Private&nbsp;» calendar displayed only in the «&nbsp;Calendar&nbsp;» view for the user who configured it.

So for you, you will need to make a request to retrieve all «&nbsp;shared&nbsp;» calendars in the scenes.

The discussion is available here:

> [@\[Caldav\] Configuration multicomptes](https://community.gladysassistant.com/t/caldav-configuration-multicomptes/6620/14?u=pierre-gilles):
>
> Je reposte ici ce qu’on s’est dit sur Github. Pour archive, on part sur du “partagé/privée” et pas du partage par utilisateur qui est peu utile/complexe à mettre en place pour pas grand chose slight_smile Cf discussion Github: [Add internal calendar sharing by bertrandda · Pull Request #1337 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1337#issuecomment-961454974)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 18, 2022, 1:30pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/23 "2022-02-18T13:30:34Z")

</div>

For your information, I just merged the calendar sharing, so work on the scenes can resume 🕶

> [@\[Caldav\] Configuration multicomptes](https://community.gladysassistant.com/t/caldav-configuration-multicomptes/6620/15?u=pierre-gilles):
>
> Pour information, je viens de merge la gestion du partage de calendrier dans une instance Gladys rocket Vous pouvez remercier @bertrandda pour tout le travail effectué slight_smile Dans l’UI ça ressemble à ça : La PR est dispo ici :

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 21, 2022, 2:33pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/24 "2022-02-21T14:33:15Z")

</div>

Hello everyone!

As this feature is quite requested, and as I just merged a PR that unlocks this behavior, I worked on a small functional specification so that we can at least agree on the desired functionality (that’s the hardest part :p).

**Functional specification for the scene trigger**

I propose a trigger in the scenes that could be configured as follows:

 ![Gladys Assistant calendar in scenes@2x (7)](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/9/9257fe2536c53a9bf08b047aee1935b50cc19c7e.png)

**Features:**

- Ability to trigger a scene if any event from a calendar occurs in XX minutes/hours/days. Possibility to select one or more calendars. The calendar must be a shared calendar, as scenes are shared within an instance.
- Ability to add a condition on the event title. Ex: is exactly «&nbsp;music lesson&nbsp;», contains «&nbsp;pool&nbsp;», contains «&nbsp;work&nbsp;», contains «&nbsp;school&nbsp;», starts with «&nbsp;Class&nbsp;», ends with «&nbsp;volley&nbsp;».
- The trigger runs in advance relative to the start or end date of the event: 10 minutes before, 1 hour before, 1 day before. The finest granularity is the minute. It is possible to set 0 minutes to be notified at the start/end time of the event.

**Functional specification for the condition in the scenes**

For the conditional part in the scenes, the idea is to be able to continue or interrupt a scene if an event in one/more given calendar meets a condition and is ongoing.

**Example:**

- If a movement is detected
- There is an event in the calendar that is ongoing that says I am at work
- Then send me a message

Proposal:

 ![Gladys Assistant calendar in scenes@2x (6)](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/83bd4a5405e2871a4103848deb21777d52b9fef8.png)

What do you think?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 22, 2022, 6:10pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/25 "2022-02-22T18:10:21Z")

</div>

For information, I have started the developments, for now only on the scene trigger.

The backend part is almost finished, I’m working on the frontend now.

@bertrandda I had to change a bit the GET /calendar request, in short I needed an option to retrieve only the shared calendars (and not my private ones), so I added 3 cases:

- No parameters provided → all calendars I can see (private to me + shared)
- shared = true → Only shared calendars
- shared = false → Only my private calendars

I thought about updating the frontend code.

It was necessary because now in the scenes only the shared calendars are accessible.

 ![Screenshot 2022-02-22 at 18.06.13](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c505a38e03d72fccbfe64a25f384d39a86e64595.jpeg)

The PR on Github is here:

[https://github.com/GladysAssistant/Gladys/pull/1443](https://github.com/GladysAssistant/Gladys/pull/1443)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 22, 2022, 6:52pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/26 "2022-02-22T18:52:45Z")

</div>

The complete view with all options:

 ![Screenshot 2022-02-22 at 18.52.16](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/d4fb08910f33a1ccb5db1bd9a18a6aca427a32ee.jpeg)

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [February 22, 2022, 7:15pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/27 "2022-02-22T19:15:21Z")

</div>

Do you also take into account holidays, etc.?  
Or do you only manage certain filters on email titles?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 22, 2022, 8:29pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/28 "2022-02-22T20:29:07Z")

</div>

I’m not managing any of this!

The purpose of this feature is to give the user the ability to trigger scenes based on upcoming events / those that are about to end in their calendars, after that it’s up to the user to connect their own calendars.

The calendar content is personal to each user, I just provide the tools to create the scenes 🙂

If you want to connect a calendar with vacations, holidays, the day you go swimming, your kids’ school, everything is possible!

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [February 22, 2022, 9:01pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/29 "2022-02-22T21:01:03Z")

</div>

Are we in agreement that there is no built-in calendar in Gladys, it’s just synchronization with a third-party service?

I would use it well for heating periods in a dedicated calendar…

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [February 22, 2022, 9:45pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/30 "2022-02-22T21:45:46Z")

</div>

Oh, I see.  
That’s not a bad idea, it saves you from having to get a library that calculates public holidays based on a given country.  
It’s another way of looking at things, like it prevents library errors.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 23, 2022, 5:08pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/31 "2022-02-23T17:08:16Z")

</div>

> [@GBoulvin](#):
>
> We agree that there is no built-in calendar in Gladys, it’s just synchronization with a third-party service?

Exactly, we consider that we are not here to code a complete calendar client (it would be a lot of work, and it’s not really our job)

The idea is that users keep their classic calendar client, continue to fill in events on their phone/computer as they already do, and then we just synchronize with it.

> [@GBoulvin](#):
>
> I would use it for heating periods in a dedicated calendar…

You can create a specific calendar anywhere for your heating periods and it will do the job 🙂

> [@spenceur](#):
>
> It’s another way of looking at things, like it avoids lib errors

Exactly 🙂

For example, for public holidays, by default my calendar has a «&nbsp;public holidays&nbsp;» calendar I think, and Gladys synchronizes it. You just need to connect to this calendar, not put a filter on the name to catch all events, and there you go, you manage public holidays in Gladys.

---

<div class="post-metadata">

**Author:** ![bertrandda](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bertrandda/32/5929_2.png) [@bertrandda](https://community.gladysassistant.com/u/bertrandda)\
**Post date:** [February 23, 2022, 8:30pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/32 "2022-02-23T20:30:14Z")

</div>

Great job, this will be useful to many people.

> [@pierre-gilles](#):
>
> No parameters provided → all calendars I can see (private to me + shared)

Once again @AlexTrovato was right from the start 😆 [Add internal calendar sharing by bertrandda · Pull Request #1337 · GladysAssistant/Gladys · GitHub](https://github.com/GladysAssistant/Gladys/pull/1337#discussion_r757130943)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 25, 2022, 5:24pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/33 "2022-02-25T17:24:59Z")

</div>

Hello everyone!

I’ve made great progress today, and I’ve merged into master the first part of this development: triggering a scene based on an event that is happening or about to end.

**Concretely, what is possible to do**

- «&nbsp;Send me a message 15 minutes before going to the gym&nbsp;»
- «&nbsp;Wake me up 1 hour before a work event&nbsp;»
- «&nbsp;If the event ‹&nbsp;Disneyland&nbsp;› starts in 1 hour AND the house is not empty&nbsp;» → Flash in the living room to warn us that we need to leave!
- «&nbsp;Start the heating when there is an event that starts and is called ‹&nbsp;heating&nbsp;›, and stop the heating when there is an event that ends and is called ‹&nbsp;heating&nbsp;›&nbsp;»

These are just a few examples, but of course the possibilities are endless!

**What does it look like?**

 ![Screenshot 2022-02-25 at 16.28.11](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/680f19a9be490e1ca801ca7f7137c5bfded3d8f5.jpeg)

What is powerful is that it is possible to retrieve in the actions the event that triggered the scene! 🕶 and this gives:

 ![Screenshot 2022-02-25 at 16.27.41](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/4/42dcc5a150570fb379c09c1e1aea7590f6335c53.png)

I can already see @lmilcent telling me: «&nbsp;but wait? are we going to be able to use the sensor values of the triggers in there??&nbsp;» Maybe in the future yes!! 😃

**Video demonstration**

I recorded a video that shows an example 🙂

[https://streamable.com/bfkp2u](https://streamable.com/bfkp2u)

**How to test?**

I made a Docker build on the `:dev` tag as usual.

The Docker image is as follows:

`gladysassistant/gladys:dev`

I welcome any feedback, if you have time to test this weekend that would be great 🙂

For the second part of the development, it will be later, I will keep you informed of the progress!

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [February 25, 2022, 5:53pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/34 "2022-02-25T17:53:06Z")

</div>

> [@pierre-gilles](#):
>
> I can already see @lmilcent telling me: “but wait? Are we going to be able to use the sensor values from the triggers in there??” Why not in the future, yes!!

🤣🤣

This is great, I love these messages: «&nbsp;hey look at the new super powerful feature I just made&nbsp;» 😍

Thanks so much for the work!!

Well, for the heating example, first of all, it has to be supported by Gladys 😅

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [February 25, 2022, 6:00pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/35 "2022-02-25T18:00:57Z")

</div>

> [@lmilcent](#):
>
> Well, for the heating example, it first needs to be supported by Gladys 😅

I didn’t dare to say it, but I think it’s a feature that is being developed in secret to surprise the community 😉

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 25, 2022, 6:10pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/36 "2022-02-25T18:10:27Z")

</div>

I don’t want to dash your hopes @spenceur but that’s not the case 😂

Heating is a big topic, and 90% of the work is defining what we want to do. Right now, we’re still at level 0, nothing has been done yet.

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [February 25, 2022, 6:14pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/37 "2022-02-25T18:14:31Z")

</div>

You’re tough, I’d say 5% already (see the feature request and the start of reflection) 😇

I’m trying to test the feature this weekend!

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [February 26, 2022, 7:49am UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/38 "2022-02-26T07:49:20Z")

</div>

> [@pierre-gilles](#):
>
> Flash in the living room to let us know it’s time to leave!

And did you add the ‹&nbsp;flash for…&nbsp;› or ‹&nbsp;flash until&nbsp;› function? 😃

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [February 26, 2022, 10:04am UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/39 "2022-02-26T10:04:04Z")

</div>

Turn on the light + wait 1sec + turn off the light, that should do it, right? 🙂

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [February 26, 2022, 5:55pm UTC](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525/40 "2022-02-26T17:55:19Z")

</div>

Couldn’t we have a condition that if there is an event in calendar x, then an action is taken?

This would allow me to do this:  
If there is an event on a public holiday in the holiday calendar, then we notify the head of linote that he can go back to bed

[Previous page](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525.md?page=1)

[Next page](https://community.gladysassistant.com/t/utilisation-de-lagenda-calendrier-dans-les-scenes/5525.md?page=3)
