problem with calendar trigger: [calendar_start_time] not set

When I use calendar event as a trigger (for an event in the future) I find that there are a number of useful variables available in the macro. For example: [calendar_start_time] and [calendar_detai].

But these variables all seem to be set to 'null'.

Am I missing something?

Motorola phone E4plus , android 7.1.1
 

Andydroid

Member
Only once the Calendar Event trigger is actually fired do the magic text values eg [calendar_title] and [calendar_start_time] become populated (according to the event that triggered the macro).

It works in the same way as a Notification Received or SMS Received trigger: the relevant magic text values eg [not_title] or [sms_message] become populated correctly only after the macro is triggered by such an event.
 

Dm114

Well-known member
When I use calendar event as a trigger (for an event in the future) I find that there are a number of useful variables available in the macro. For example: [calendar_start_time] and [calendar_detai].

But these variables all seem to be set to 'null'.

Am I missing something?

Motorola phone E4plus , android 7.1.1
@Andydroid is right. What you could do to test your macro is to press the 'Test trigger' option on you 'Calendar' trigger. You'll get magic texts populated with test values.
 
I have done some more testing.

the variables are correctly filled if the macro is triggered using 'negative time'. That is if I trigger on an calendar event that was started.

But when I trigger using a positive time, for an event that is in teh future, the variables are filled with nulls.
 
Thank you Andydroid and Dm114 for your help.

I am still stuck though.

I have set up a test macro that has the calendar trigger an then emails me the various variables.

The magic variable [calendar_title] and [calendar_detail] come through as "test title" and "test detail" , so that's good news.

But all the rest: [calendar_start_time] [calendar_end_time] etc. are just set to null. This is true if I fire the trigger by hand or if I put an entry in calendar and wait for it to trigger the macro.

The date variables did come though a few times, but mostly they are missing.

I'll keep fiddling and see if I can understand when they are there and when not. At first I though they were only missing when I trigger before the event, but I now see that that's not the case. It seems to be random.
 
Last edited:

Dm114

Well-known member
Thank you Andydroid and Dm114 for your help.

I am still stuck though.

I have set up a test macro that has the calendar trigger an then emails me the various variables.

The magic variable [calendar_title] and [calendar_detail] come through as "test title" and "test detail" , so that's good news.

But all the rest: [calendar_start_time] [calendar_end_time] etc. are just set to null. This is true if I fire the trigger by hand or if I put an entry in calendar and wait for it to trigger the macro.

The date variables did come though a few times, but mostly they are missing.

I'll keep fiddling and see if I can understand when they are there and when not. At first I though they were only missing when I trigger before the event, but I now see that that's not the case. It seems to be random.
You cannot test (or reach) an event "in the future" nor "in the past". The 'Calendar' trigger only can fire at the exact time the event is supposed to 'Start' or to 'End'. So, the variables (magic text) are solely filled at that exact times.
 
Ah, but in the trigger setup there is a 'check in advance' option. When you select it you get the ability to choose how many hours or minutes before (or indeed after) the event you want the trigger to fire.

I tested it. When you don't use the 'check in advance' option things work OK.

When I don't set 'check in advance' my email tells me these values:

test title

test detail

test location

25/12/2000

04:44

26/12/2000

05:55


When I do use 'check in advance' I get these:

test title

test detail

null

null

null

null

null
 

Dm114

Well-known member
Ah, but in the trigger setup there is a 'check in advance' option. When you select it you get the ability to choose how many hours or minutes before (or indeed after) the event you want the trigger to fire.

I tested it. When you don't use the 'check in advance' option things work OK.

When I don't set 'check in advance' my email tells me these values:

test title

test detail

test location

25/12/2000

04:44

26/12/2000

05:55


When I do use 'check in advance' I get these:

test title

test detail

null

null

null

null

null
Sorry, you are right! As I never used this trigger for any of my macros, I didn't even notice this option. I think it has been added in a recent MD version.

I only suppose that the delay (before or after) has to correspond to the exact current time for the trigger to fire. Don't forget to check the 'Use alarm' box too.

Sorry again ☹️🙏
 
No problem, I am very grateful for your interest and help. I'll play with some other options and see if anything else affects it.

I have macros that warn me about calendar events 45, 30, 15 and 5 minutes before hand - saved my bacon a few times!

R
 

Dm114

Well-known member
No problem, I am very grateful for your interest and help. I'll play with some other options and see if anything else affects it.

I have macros that warn me about calendar events 45, 30, 15 and 5 minutes before hand - saved my bacon a few times!

R
Can't you have this kind of warning from your calendar app ? I use aCalendar and it works fine.
 
You mean use the normal notifications from calendar? Yes I used to do exactly that and I had default notifications at 45, 30,15, 5 minutes before. In fact I also had an MD script triggered by those notifications that spoke out and warned me about the details of the upcoming meeting.

However: Although I use google calendar a major client uses Outlook and he sets up his meetings via Outlook calendar. I use sync2 to keep the two calendars synchronised. But there is a problem with this: when Outlook meetings are inserted into google calendar by sync2 they don't get the default notification times set.

Triggering macrodroid at set times in advance of the meeting solves this. But I can't make it speak out and tell me the details of the meeting because the magic variables are not set.

Well, you did ask :)
 

Dm114

Well-known member
You mean use the normal notifications from calendar? Yes I used to do exactly that and I had default notifications at 45, 30,15, 5 minutes before. In fact I also had an MD script triggered by those notifications that spoke out and warned me about the details of the upcoming meeting.

However: Although I use google calendar a major client uses Outlook and he sets up his meetings via Outlook calendar. I use sync2 to keep the two calendars synchronised. But there is a problem with this: when Outlook meetings are inserted into google calendar by sync2 they don't get the default notification times set.

Triggering macrodroid at set times in advance of the meeting solves this. But I can't make it speak out and tell me the details of the meeting because the magic variables are not set.

Well, you did ask :)
Now I understand your needs!

As I make an allergy to all Google's products (I only use their search engine which, unfortunately, is the best ☹️) I don't use Google calendar neither. And, as I retired, I have no more professional appointments or meetings 😀. But in your case, you probably choosed the best (or at least 'not worst') solution.

Good luck and hope you'll quickly find a way to be notified in advance with MD.
 
Now I understand your needs!

As I make an allergy to all Google's products (I only use their search engine which, unfortunately, is the best ☹️) I don't use Google calendar neither. And, as I retired, I have no more professional appointments or meetings 😀. But in your case, you probably choosed the best (or at least 'not worst') solution.

Good luck and hope you'll quickly find a way to be notified in advance with MD.
Hi Dm114, I am also retired, but somehow I am still working! I remember when all those search engines first started working, back in the 1990s. It soon became clear that google was better than the others. So in a sense they deserved to win, but it has resulted in them being rather too powerful.
 

Dm114

Well-known member
Hi Dm114, I am also retired, but somehow I am still working! I remember when all those search engines first started working, back in the 1990s. It soon became clear that google was better than the others. So in a sense they deserved to win, but it has resulted in them being rather too powerful.
I agree with you 200%! 👍
 
Top