Caldav google calendar problem

<calender-id>: look into the calender details at google
You also have to create an additional Client-Id. Look at https://developers.google.com/google-apps/calendar/caldav/v2/guide#creating_your_client_id
Then set the log level of the OH plugin to TRACE and look at the logfile after OH has been restartet.
There should come up a message that access to goolge has to be authenticvted giving an URL to a google page. Call this, grant access and you will be provided with a access token which should be used a the password along with the client-id as username.

################################ CalDav Binding #######################################
#
#********************************************
#Googlekalender 
#********************************************
caldavio:GoogleSmarthomeCal:url=https://apidata.googleusercontent.com/caldav/v2/<calender-id>/events
caldavio:GoogleSmarthomeCal:oauth=true
caldavio:GoogleSmarthomeCal:reloadInterval=5
caldavio:GoogleSmarthomeCal:preloadTime=10080
caldavio:GoogleSmarthomeCal:disableCertificateVerification=false
caldavio:GoogleSmarthomeCal:username=<client-id> 
caldavio:GoogleSmarthomeCal:password=<access token>

# Additionally needed binding: org.openhab.binding.caldav-personal-<version>.jar
# used to record and simulate presence and to show upcoming/active events
# multiple calendars (calerdar-id) can be seperated by commas
caldavPersonal:usedCalendars=GoogleSmarthomeCal

Hope this helps.

Did you try to go to your google account security settings and allow less secure apps to connect?

Hi @thucke,
unfortunately I did all steps you mentioned, but i do not get “3 happy messages” into logs.
I’m stuck on this from 4 days.

Marco

Hi @sudocristian
I did, but without luck

Marco

if you go to your caldavio:GoogleSmarthomeCal:url with your browser and log in with the same credentials you provided, does it download your events?

@sudocristian
if i put the URL into the browser, there is not auth request. I got this page:

Change your url like this and try it https://www.google.com/calendar/dav/email@address.com/events

Hi @querdenker2k,

now after one week running this configuration I can report that only the first ocurrence of the recurring entries has been recognized. I left all entries untouched.
Does this help you?
Thanks
Thomas

hi @sudocristian
with this URL same result on OpenHab. From Browser ask me Authentication, but I do not know which credential to use.
My Account Username and password do not work, and ClientID and Client Secret do not work too.
In log I do not got message and URL for authentication.

you need to enter your email@gmail.com and password that owns this calendar

@sudocristian
it does not work, and arrived me an email from google on same account, that tell that some try to access to an insecure app, or something similar, i translated from italian

I also try to do access to applicatuion less secure at this URL: https://www.google.com/settings/u/1/security/lesssecureapps

but I cannot logon with my credentials

Instead accessing from mail.google.com to my mailbox and my calendar username and password works fine

Not sure. This should be on like below

If that doesnt work try creating a brand new gmail account and use that in openhab and see if it works. If that doesnt work then i am not sure. sorry

@sudocristian
I have another google account, I’ll try with it.
The strange thing, is that on version 1.8 I use the old Gcal binding with oAuth 2.0 and works fine since 2 years. I do not know what happen with this binding.
Thanks for help.

Marco

Hi @querdenker2k,
yesterday I had to restart my OH instance.
Without any other change the recurring entry today got recognized 


I was in holidays and will try to reproduce this next week. With normal Events you do Not have a Problem?

Welcome back :wink:
No issue so far.

I suspect that there could be an issue handling recurring event out of the cache.
Assuming that during restart the cache is rebuild from scratch.

Ok, please try this one
http://www.xup.in/dl,20699170/org.openhab.io.caldav-1.9.0-SNAPSHOT.jar/
I just removed a caching of the calendar in oauth handling.

It really seems that all recurring entries got recognized now.
I switched back in my configuration to use the every weekday recurring entry which now doesn’t drop any entry.
I made a cross-check using the old JAR-file which brought the issue back.

Now I stay using your new version. Will do additional tests.
E.g. I meant that I saw a removed entry in the middle of the week hasn’t been recognized as deleted.

Thank yo so far.
Does the removed caching imply any other drawbacks?

@querdenker2k:
I can confirm that individually deleted entries of a recurring series won’t be recognized as deleted by the plugin and are still reported “active”

Great,
No, this have no other implications.
Because of the exception
 Its an open issue in this library which i use: https://github.com/ical4j/ical4j/issues/42#issuecomment-257728182