OH2 CALDEV Don't work

Hello,

I have a problem with the caldev-personal binding.
I added the binding in the papUIand setup the caldavio.cfg like this:

################################### CalDAV IO Binding ###################################
W12A:url=https://apidata.googleusercontent.com/caldav/v2/@gmail.com/events
W12A:username=
W12A:password=
W12A:reloadInterval=1
W12A:preloadTime=20000

But i have only errors in the openhab.log:

2016-11-10 14:34:18.506 [DEBUG] [av_personal.internal.CalDavActivator] - CalDav-Presence binding has been started.
2016-11-10 14:34:18.528 [INFO ] [b.core.service.AbstractActiveService] - CalDav Loader has been started
2016-11-10 14:34:18.539 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: Abfallkalender
2016-11-10 14:34:18.565 [DEBUG] [ldav_personal.internal.CalDavBinding] - setting CalDavLoader: true
2016-11-10 14:34:18.568 [DEBUG] [ldav_personal.internal.CalDavBinding] - CalDavBinding (personal) activated
2016-11-10 14:34:29.936 [ERROR] [caldav.internal.job.EventReloaderJob] - error while loading calendar entries: Unexpected response (401 - Unauthorized)
com.github.sardine.impl.SardineException: Unexpected response (401 Unauthorized)
at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35)[222:org.openhab.io.caldav:1.9.0.201611090213]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218)[222:org.openhab.io.caldav:1.9.0.201611090213]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409)[222:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386)[222:org.openhab.io.caldav:1.9.0.201611090213]
at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:208)[222:org.openhab.io.caldav:1.9.0.201611090213]
at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:111)[222:org.openhab.io.caldav:1.9.0.201611090213]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.201611041332]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.201611041332]

I uninstalled the binding and installed it again, but i get always this error.

BR

Rene

Did you specify the right username and password in the config file? According to your logs it seems that the server does not authenticate with the credentials supplied.

Yes, i set the correct username and PW. I can log in with this username and PW in my google-account.

Do you have 2 factor authentication with Google?

I think i dont have 2 factor auth, how can ich check this?

You should find it in the google account settings. If you have it enabled, you need to create an app password for the Caldav binding. Check on Google for app password!

BR,
George

I checked and the 2 factor auth is not enabled.

Today i changed the caldavio.cfg and add the timezone and disableCertificateVerification to get the calendar data and get a other error, the 404.
Here my caldavio.cfg and the erroro log.

caldavio:W12A:url=https://apidata.googleusercontent.com/caldav/v2/@gmail.com/events
caldavio:W12A:username=

caldavio:W12A:password=******
caldavio:W12A:reloadInterval=10
caldavio:W12A:preloadTime=2000
caldavio:W12A:disableCertificateVerification=true
caldavio:W12A:timeZone==Europe/Berlin

[ERROR] [caldav.internal.job.EventReloaderJob] - error while loading calendar entries: Unexpected response (404 - Not Found)
com.github.sardine.impl.SardineException: Unexpected response (404 Not Found)
at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35)[226:org.openhab.io.caldav:1.9.0.201611090213]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218)[226:org.openhab.io.caldav:1.9.0.201611090213]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409)[226:org.openhab.io.caldav:1.9.0.201611090213]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386)[226:org.openhab.io.caldav:1.9.0.201611090213]
at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:208)[226:org.openhab.io.caldav:1.9.0.201611090213]
at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:111)[226:org.openhab.io.caldav:1.9.0.201611090213]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)[104:org.eclipse.smarthome.core.scheduler:0.9.0.201611041332]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[104:org.eclipse.smarthome.core.scheduler:0.9.0.201611041332]

I delted all entries in the karaf console and reboted the system, now i get the first error 401 again.
Can anybody help me?

Now i chenged my googleaccount to 2-way-auth and created a app-key. I puted this key into the caldavio.cfg, but i get the same error like before.
What cn i do?

Hello,

After the binding works some days now i it don’t work again.
In the log i found this lines for the error:

2016-12-07 09:03:06.973 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=286, bundle=186/mvn:org.openhab.io/org.openhab.io.caldav/1.9.0-SNAPSHOT]: Updating property usedCalendars of configuration org.openhab.caldavio caused a problem: unknown identifier
org.osgi.service.cm.ConfigurationException: usedCalendars : unknown identifier
at org.openhab.io.caldav.internal.CalDavLoaderImpl.updated(CalDavLoaderImpl.java:166)[186:org.openhab.io.caldav:1.9.0.201612051712]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[7:org.apache.felix.configadmin:1.8.8]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]

Here my configlist from karaf( I hide PW,User and calederID):


Pid: org.openhab.caldavPersonal
BundleLocation: mvn:org.openhab.binding/org.openhab.binding.caldav-personal/1.9.0-SNAPSHOT
Properties:
service.pid = org.openhab.caldavPersonal
usedCalendars = Geburtstage, Muellkal, Termine

Pid: org.openhab.caldavio
BundleLocation: mvn:org.openhab.io/org.openhab.io.caldav/1.9.0-SNAPSHOT
Properties:
Geburtstage:disableCertificateVerification = true
Geburtstage:password = thdotvepkenjfvyz
Geburtstage:preloadTime = 300000
Geburtstage:reloadInterval = 180
Geburtstage:timeZone = =Europe/Berlin
Geburtstage:url = https://www.google.com/calendar/dav/****@group.calendar.google.com/events
Geburtstage:username = ***@gmail.com
Muellkal:disableCertificateVerification = true
Muellkal:password = ****
Muellkal:preloadTime = 144000
Muellkal:reloadInterval = 180
Muellkal:timeZone = =Europe/Berlin
Muellkal:url = https://www.google.com/calendar/dav/
@group.calendar.google.com/events
Muellkal:username = ***@gmail.com
Termine:disableCertificateVerification = true
Termine:password = ***
Termine:preloadTime = 144000
Termine:reloadInterval = 180
Termine:timeZone = =Europe/Berlin
Termine:url = https://www.google.com/calendar/dav/
@gmail.com/events
Termine:username = ***@gmail.com
service.pid = org.openhab.caldavio
usedCalendars = Muellkal, Termine, Geburtstage