Tasker Google Calendar event announcer task (download)

Continuing the job of announcing things using Tasker, today’s task download is for Google Calendar. It will read your Google Calendar XML file and announce when and what the next appointment is, assuming it’s on the same day. If it’s not on the same day, it will announce that you have no appointments that day.

Difficulty level: Medium. Meant for existing Tasker users that know the basics of Tasker, but with task download and instructions provided for easy implementation

Download the task from the bottom of the article. Four versions are available: A direct .xml download and a zipped version for each of the two basic task versions, DDMM and MMDD. Which of the basic versions you need depends on the date format you use. This task only works with the date formats DD/MM/YYYY and MM/DD/YYYY. This is a setting you pick in your device’s system settings, in the date and time section. It has to use one of those two, or it won’t work. If you read 07.12.2012 as July 12th, you want MM/DD/YYYY. If you read it as December 7th, you want DD/MM/YYYY.

As for .xml vs .zip download, on some devices you can go to this page in your browser, long click on the .xml download, select “save link”, open it once downloaded, and then select to open with Tasker. If that doesn’t work, download the .zip, and unzip it to the Tasker/tasks folder manually. The resulting steps are identical regardless of which of these methods and basic versions you use:

Go into Tasker, long click on the Tasks tab, select Import. Select the Calendar version you chose to download.

Open the task, then the HTTP Get action. In the Path field, you will see XXXX and YYYY as part of the path:

These are the two pieces of information you have to switch out. XXXX needs to be replaced with your Google user name, e.g. “example” if your login email for Google is example@gmail.com. If your email for Google does not end in @gmail.com, you also have to change the bit after %40 with whatever domaing your email is. Examples:

YYYY needs to be replaced with a private access key for your Google calendar. To get this, start by going to the Google Calendar website, then go into settings. Click the Calendars tab, then the calendar you want to use. At the bottom of the calendar details screen, click the orange XML button next to Private Address. You should get a popup box with a URL that looks something like this:

Save the edit to the HTTP Get action and then find the Say action at the end. Select a speech engine that you have installed on your device.

That’s it, the task will now hopefully work. It takes a few seconds to pull the data and process it, so if you want to use this in combination with other Say tasks, you should delete the Say action from the task itself, use it in the other task using the Perform Task action, and then include %Nextevent in your existing Say action to include the calendar information in that Say.

The idea for this task came from one of our readers. She knows who she is. Thanks!

About the Author

Andreas Ødegård was an associate editor at Pocketables. He's more interested in aftermarket (and user created) software and hardware than chasing the latest gadgets and tends to stick with his choice of device for a long time as a result of that. Currently that includes an iPad mini and a Samsung Galaxy S II.

Anony Mouse

And to accompany this profile, you can set up an announcement to notify you when you need to leave. Note: Make sure to run the calendar task first so that this profile gets the information to know that you have an appointment that day! Simply click the plus sign, create a name (or not), click green check, press “Time”, set the time when you need to run out the door, and click green check. Click new task, name it if you would like (or not), click green check, click the blue plus sign, audio settings, then media volume, set volume to level 15, click green check. Click the blue plus sign again, go to misc, click on say, type what you want it to say in the text box (mine says, “You need to leave now” but you can get it to say, “It is %TIME (this variable states the time). You will be late if you don’t leave now” for example), click the magnifying glass for the speech engine you use, check the box in the If category and type in %Samedayevent in the first box, leave the ~ alone, and type in “yes” in the next box, then click the green check, and again, and you are done! This will only announce on the day that you have the appointment (as long as you run the Calendar task the following day and it gets the information that there is nothing on your calendar for that day). It is less maintenance with a consistent schedule such as a meeting every Monday, Wednesday, and Friday at 9 A.M. and you need to leave at 8:15 A.M. on those days. If you have a Dr. appointment on Thursday at 1:30 P.M., the time context needs to be manually changed for the appointment and then reset again later for the meeting the next day. Hope this helps. :)

Sam

I can’t seem to get this to work. It looks like the HTTP Get isn’t retrieving anything, although it doesn’t throw any warnings. The warning I do get is that Calendar.txt doesn’t exist, which of course, nothing would work after that. When I type in the full port and path into my web browser, however, I do get the correct xml file.

Andreas Ødegård

Make sure that you replace the correct parts of the path with the correct info, without leaving any Xs or Ys, or any spaces or something like that. It might be a good idea to copy the entire path from the browser (notice how it’s split between server and path, so you don’t use the entire URL in the path field) and into Tasker. Also check that Tasker can write to that directory by simply running a task that writes something to calendar.txt manually.

Sam

I can write a file with Tasker. And I did send the entire web address from my computer to my phone, although I just left it all in Port, instead of splitting the second half to Path. I don’t think that makes a difference, does it? I’ve also tried just using the HTTPD variable instead of writing to a file. I am not running the beta though, but the current 1.3 does have the Read File option

Andreas Ødegård

I would try splitting it if I were you. I can’t remember if it’s necessary, but since this has worked for other people, and lack of split is the difference, that’s likely the reason too

Sam

As it turns out, I don’t need to split it. I had to set Mine Type to text/plain. Thanks for all you’re help.

Mike

How does this work with multiple appointments during the day and how often would you suggest this task run? It looks like it’s only going to give you your first appointment of the day unless you run it over and over but then it seems you’ll keep getting told of the same appointment until it’s time passes.

Andreas Ødegård

It will only report on the first upcoming event, and only if that event is on the same day. This is by design, and this profile was also “made to order”. It’s possible to use the same basic method for pulling calendar data to create a profile that is as simple or complicated as you want, but there’s no “switch” to flip on this profile to do it, unfortunately. Have to be done from scratch

Deb

I got it to tell me that I have no appointments scheduled for today. But I do have one scheduled today.

Any help would be great. It’s helping me understand tasker better. And I really like the calendar interaction.

I have a GSM Galaxy Nexus. I do not have the tasker beta, just what’s in google play.

Thanks,
Deb

Andreas Ødegård

Try putting the URL from google into a normal web browser on a pc and check the code (ctrl+u if it loads some sort of RSS menu). Search for the text in your appointment to see that it’s actually there in the code. That would help to see if it’s on the Tasker side that something’s wrong or the calendar side

jimminyhiggens

I’m also having the same problem, only getting ‘No events scheduled for today’. I tried pasting the google URL in firefox and the appointments did show up. Not sure what I’m doing wrong. Thanks for your help!

Andreas Ødegård

I used this task as an example in part 4 of the beginners guide, and noticed a new format on a new calendar, so you have to check what email is used when you copy the key- might be a google group one you also have to copy

jimminyhiggens

Ehh, sorry but where do I find this ‘google group key’ and where do I pase it to? I’m pretty new at this so forgive me for the questions.

Andreas Ødegård

When you copy the key as per the article instructions, also check that the email used in the url you get the key from is correct. On newly created calendars it’s a @group.google (or something like that) email, not your normal email. In those cases you also need to copy that email address into tasker. It immediately precedes the calendar key in both places

jimminyhiggens

I checked my email and it was not a “@group.google” type email, just the normal “@gmail”. Could it be that I have to wait until after midnight for the code to retrieve the next days events?

Andreas Ødegård

Yes, it will only notify on events that same day. Thats 100% by design, and doesnt have to be like that. Part 4 of our tasker guide shows how this task works, if you want to edit it

Emanuel

Great tutorial – I got it working perfectly – and even went through the walk-through on your more detailed breakdown in another post to make sure I understood. Always so great to see people sharing their knowledge and experience like this!
One question for you – I have this functionality also built-into a morning routine – but for some reason, it always reads me the previous day’s calendar events in the mornings – if I run the profile in the afternoon, it works fine, but at around 7-8am it only seems to have the previous days events in it.
Any way to address this?

thanks!

SalV

Hello,
I was wondering if its possible to do this same type of thing but through Google Tasks. How can you find the Get HTTP link for Google Tasks?

Thanks for your help!

Cory

You dont still need the beta right?

Andreas Ødegård

Nah, there have been several versions of Tasker since this

nivekmai

Google seems to be sending the date in the US as 12-08-2012 whereas tasker uses 12-8-2012. Therefore, you should divide Eventdate2 and Eventdate31 by 1. This trims the leading 0 so that the two date formats match. Otherwise you will “never have appointments” for the first 9 days of each month.

Jason Gilbert

Awesome, that was exactly what I needed to get mine working. It’s true for month as well as day, fyi. I put two variable set tasks ahead of the %Samedayevent To yes evaluation; one to set %Eventdate2 = %Eventdate2/1, and the second one %Eventdate31 = %Eventdate31/1

ortonauta

It works perfect, but it seems to drain the battery really quick, normally I have 25% left at midnight and today I drained out completely a t7 pm. I set it to check every 2 hours during working hours. Is this expected?, maybe the lack of coverage where I work makes tasker to keep trying and trying? I feel my phone getting warm in my shirt pocket. Any suggestions?

Andreas Ødegård

I can’t comment on reasons your phone would be running amok. Tasker on my device is checking things all the time, without it really affecting battery life. You would need to enable and check Tasker’s log, run battery monitors, CPU monitors etc to find out what’s draining your battery and why

Charlie Callow

Doesn’t work for me but then so far almost all of the tasker tasks I’ve downloaded seem to mess up in some way. This seems to pull down the data okay but it never says anything. My Google Calendar is currently blank but I would expect a “you have no scheduled appointments” message, no? I’m using the tasker beta with the new UI – I don’t know if there were any significant changes that could have broken this task and possibly some others?

Andreas Ødegård

The Tasker dev has abandoned the version of Android I use, so I can no longer answer any questions relating to why something doesn’t work on newer versions.

I built this way as grabbing data from the web isn’t fool proof and I had calendars that weren’t in Google.

Thanks though for this tutorial – was great inspiration!

ortonauta

hi. This was working perfectly until a couple of days ago, now I get an error that says in #13: VariableSection:%Cevent22: no value
Any help with this please? I was so satisfied how this worked before!

Andreas Ødegård

I dont use this anymore myself so I dont know if anything has changed, but if you installed the new version of tasker right around that time, I wouldnt be surprised if that’s the culprit

How did you know what arguments to place after the private key? Is there a reference I can look up?

Broesie

Doesnt work for me… It keeps saying no events… However events are placed today, and URL is fine…

Kellen

The download links appear to be broken. I just get a 404 page from Dropbox.

Dan

This is a bugbear of mine. If you already have a website hosting an article, why use Dropbox to host the tiny script that the article refers to/depends on? They should be hosted on the same server so that if one is available, so is the other.

Alternatively, the people who write articles like this could actually tell you how to set up the profile yourself, instead of giving you a prewritten xml file. Even a high level list of pointers would be more useful than the current situation.