iCal

[quote=“Stuart, post:19, topic:190765”]The http 404 error code can mean (usually) one of two things (1) that the url cannot be found or (2) that you do not have permission to access it.

In this case I suspect it’s a permission issue. So now the question is whether it’s at the google end or at the ical end.

Can you see and access the calendar in google ? In an earlier reply you said “Yes I can. I have logged out of google and the calendar displays correctly.” but it was not clear to me if you meant that you were accessing the ical directly or if it was displaying in your google calendar.

I copied the html link in google calendar, logged out, pasted into address bar. This opened up calendar.google.com. Please feel free to try the link - it is not sensitive data.

If it does not display - then it’s a good guess that the problem is at the ical end. How are the permissions set in your ical – is it public ? If it is - and you want to share the ical link via IM I can see if I can access from my system.

It is not public. I did visit the syncselect page and ticked the box to this shared calendar

Also - if it is public - have you tried putting in the ical link directly into GCal (it will work with some ical calendars but not all as ical is not standardised too well)

have a look in https://calendar.google.com/calendar/syncselect does your calendar show up as shared and read only ?

Yes.[/quote]

Hello - did you have any more luck with this?

I’ve been doing quite a bit and in the middle of writing up some notes (see draft incomplete below) . Also making some code changed for Direct method iCal – because of some underlying issues in the Lua libraries - that’s pretty well done. Note that this does not affect calendars from google like the one you sent the url for.

One thing that I noted is that the url you sent to me is not public – so I could not see it – that may be part of the issue if the permissions are incorrect at the google end. i.e. given the url you sent gcal will treat it like any google calendar. Below I say “you need to set up google credentials in the normal way.” – but I still need to figure out exactly what that means because it’s not clear what google expects in this circumstance. That’s the next step to figuring this out.

Can you send me the public direct url to the ical ? Not the one created by google but the one that you input into google. I can troubleshoot on that come wednesday (traveling in the meantime)

The following notes are ? to the best of my knowledge ? accurate BUT they are based on limited use of iCal and may contain errors.
Basically ? there are two ways GCal can access an iCal:

  1. Directly. This method uses a direct link to an iCal that bypasses Google calendar
    a. The GCal plugin has some limitations on direct iCal use. Not all iCal can be interpreted correctly. This is because the iCal specification allows for variations in format ? not all of these variations are handled by GCal.
    b. This is a direct link to your iCal so changes that you make to your iCal will show up immediately.
    c. The iCal must be public.
    d. The calendar information will not show up in the calendar tab of the plugin
    e. There are no credentials required.

  2. Through Google Calendar.
    a. If google calendar can display the iCal correctly then GCal can.
    b. You are creating a subscription from google calendar to an iCalendar. Google only updates this subscription from time to time (every 12 hrs. ?). Changes that you make to your iCal may not show up in google (and hence GCal) for a while.
    c. The iCal must be public for google to see it.
    d. The calendar information will show up in the calendar tab of the plugin
    e. You need to set up google credentials in the normal way.

The Direct Method
GCal will attempt direct access to iCal by looking for ?.ics? or ?.ical? or ?.iCloud? in the url that you input as the Calendar ID. It then treats the calendar as public and does not use any google credentials. For example:
https://www.calendarlabs.com/templates/ical/International-Holidays.ics
To test if your url is likely to work, try opening the url into a browser. If it downloads a .ics file ? then it?s likely good. Check by opening the .ics file in a text editor. The top few lines should look something like this:

BEGIN:VCALENDAR
PRODID:-//Calendar Labs//Calendar 1.0//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:International Holidays
X-WR-TIMEZONE:America/New_York
BEGIN:VEVENT

If it does not have BEGIN:VCALENDAR and VERSION:2.0 then it?s NOT an iCal. If it does then it should be an iCal.

Through Google Calendar

Yet to write this bit up but intend for it to be a step by step setup for an iCal being accessed by google.

Tried the Direct Method which does indeed download a file containing BEGIN:VCALENDAR,
VERSION:2.0, PRODID … have sent you the link.

So the direct method does not currently work on all iCal’s because of the lua library issue that I mentioned. I’m working on it …

However the “through google calendar” method seems to work perfectly !!

I created a calendar in google using your url
Other Calandars → Add by url
Insert the ical url
Make the calendar publicly accessible? worked both ways
→ Add Calendar

I then went to Settings → Calendar → [your calendar] and got the embedded Calendar Link <iframe …

put it in as the Calendar ID in the plugin and … (tada).

you should try this using the test credentials I posted on the main thread. I’m now convinced that your credentials are not set up correctly.

@ powisquare

You can try this patch with the direct iCal url if you like. Seems to be working fine.

Make sure you set the calendar ID again as there was an error encoding certain iCal url’s (Direct) that I have corrected.

Did you get the google variant working ?

Edit: Patch removed as it’s included in the official version

Have had a bit of trouble (credentials) but seems to be working now! Will be away for a week so shall look at this in more depth on my return. Kind Regards.

Good news. I started again again created a new credential with my personal calendar as there is no way of sharing the ical I am using. I have then used the ical Calendar Link and it works.

Is it possible for the app to look 2 days out instead of one and do you know of any pleg examples out there using your app I might be able to refer to?

[quote=“powisquare, post:28, topic:190765”]Good news. I started again again created a new credential with my personal calendar as there is no way of sharing the ical I am using. I have then used the ical Calendar Link and it works.

Is it possible for the app to look 2 days out instead of one and do you know of any pleg examples out there using your app I might be able to refer to?[/quote]

Good to hear that it is working for you. Are you on the latest version from the marketplace ? It has some additional capabilities and changes that you should upgrade to (so I can continue to support). I cannot remember if the patch version you were working with includes this - but the latest version in the marketplace has an additional parameter gc_ExtraDays (default is 0) So to look 1 additional day ahead you set it to 1.

I will have a slightly newer version in the marketplace in the next day or 2 (has better handling of initial configuration mistakes). You may want to to wait for that.

For PLEG - I will have a look to see what examples I have. I do not know if others do. You should post a request in the main GCal and PLEG forums.

Good Luck

If you are already on V2.0 you can get the next version (2.1) without waiting for the marketplace to update by using the following:

http://:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=7016&Version=31461

If you are NOT on V2.0 already - then be sure to follow the upgrade instructions here:
http://forum.micasaverde.com/index.php/topic,26692.msg276087.html#msg276087

So the calendar has been up and running in gcal3 for a while now which is great. I have installed it on another box (same version 2.5)and am trying to access a similar calendar to the one that works. ie it comes from the same 3rd party source in the same format. Am getting a 404 credential error. I am using the same credential file as the calendar that works. Apologies for the cross posting but probably should have started here to begin with.

See my prior post in the main forum. You are using a GOOGLE calendar ID therefore you need to apply the credentials to the google calendar. The fact of the underlying calendar info comes from an iCal is irrelevant in this situation.

Sorry … totally confused. I do not know how to apply credentials to the google calendar. Don’t see an option for it or for sharing - am I missing something?

These are the two calendar links. The top one works in both Vera boxes. The second gives me the 404 error.

Open this document from the main post:
Google V3 API Service Account V3.pdf

For the calendar that does not work – perform the steps from:
“BUT ? you also need to:”

I don’t believe I am able to do the following (there is no option to share) and have attached a screenshot of what I am seeing:-

Next click on Share this Calendar
On the section that says ?Share with specific people? Add the client-email from the
step above. Change the permission to ?Make Changes to Events?
Click on Add Person
You should now see the client_email listed like this

What puzzles me is that I was not able to complete this step for the calendar that is working either.

The problem is permissions - the bit that says:
Anyone can: See nothing
You can: See all event details.

This is because GCal is accessing the calendar programmatically and needs specific credentials (which it does not have). It’s trying to access the calendar as “Anyone” and it’s working … you CAN “See nothing” :smiley:

Try just putting in the source iCal url in as the Calendar id. Your iCal is public so that ought to work. i.e.

https://marshwoodmanor.checkfront.co.uk/view/bookings/ics/?id=<…snip…>&iid=7&m=24

You are quite right of course - the working calendar ‘Anyone can See all events’.

I have spent a week trying to figure out how I managed to alter this sharing permission. I looked at https://calendar.google.com/calendar/syncselect and the working calendar was checked and the others not. I have since checked all remaining calendars but they still all read ‘Anyone can see nothing’.

Sadly the source ical does not seem to work.

[quote=“powisquare, post:37, topic:190765”]You are quite right of course - the working calendar ‘Anyone can See all events’.

I have spent a week trying to figure out how I managed to alter this sharing permission. I looked at https://calendar.google.com/calendar/syncselect and the working calendar was checked and the others not. I have since checked all remaining calendars but they still all read ‘Anyone can see nothing’.

Sadly the source ical does not seem to work.[/quote]

I’m surprised since your source iCal url works fine in my plugin. Your calendar is publicly available …

I will PM you your url so that there is no confusion.

Thanks Stuart - PM received. I replaced the working calendar ID with the source url provided and get “No iCal events found today”. Put the iframe one back in and it’s working.

Got there in the end. To share a third party ical with google and when using “add by url” remember to check the “Make the calendar publicly accessible?” box so that “Anyone can: See all event details”.