Setting up Caldav-Personal in openHab 2.3.0

Dear Everyone!

I want to use this binding to show one calendar events is BasicUI (the next event which is the closer to the actual time)

However I don’t know how to setup this binding. The documentation seems to refer to openHab 1.x versions, since as I know there is no openhab.cfg file in 2.x
I have found a caldavPersonal.config and caldavio.config files in userdata\config\org\openhab but I think this is not what I’m looking for.
Where I have to define my calendars and its settings?

Thanks!

Yes, because it is a 1.x binding :grinning:

My caldav configuration files
Located in /conf/services

caldavcommand.cfg:

# see CalDAV IO Binding
# Used to execute commands if events starts or ends with an easy notation in the event description.
# commaseperated (e. g. openhab, anothercalendar)
caldavCommand:readCalendars=openhab_tasks

caldavio.cfg:

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar
caldavio:openhab_tasks:url=https://www.google.com/calendar/dav/xxxxxxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com/events

# Username for the calendar
caldavio:openhab_tasks:username=xxxxxxxxxxxxxxx

# Password for the calendar
caldavio:openhab_tasks:password=xxxxxxxxxxxxx

# Reload interval unit is minutes. 
# Defines how often the calendar should be reloaded from server.
# Default is 60 minutes
caldavio:openhab_tasks:reloadInterval=60

# This defines which events are relevant for execution. Unit is in minutes.
# Default is 1 Day (1440 minutes)
caldavio:openhab_tasks:preloadTime=2879 #2 days -1 minute

# A caldav Server is just a webdav Server which list files. Some servers does not use the valid timestamp for modifications.
# If your calendar does not provide correct timestamps you have to set this false.
# Default is true
#<calendarId>:lastModifiedFileTimeStampValid=

# SSL verification can be disabled, if you don't want to import the server certificate
# into the java keystore. This is just needed for self-signed certificates, where the
# certificate path cannot be verified. Default is false. Do not set to true if no SSL is used.
#<calendarId>:disableCertificateVerification=

# Timezone for events which does not have a timeZone information.
# Normally this is not required
#timeZone=

# Charset which should be used for reading an event.
#charset=UTF-8

Thanks for your help!

However I tried to set it up, but I miserably failed…
Where I can get these kind of link from a Google Calendar? I couldn’t find it, just an embed link…

Locate URL

This site may help to find the Calendar URL (i.e. Google Shared Calendars): http://www.ict4g.net/adolfo/notes/2015/07/04/determingurlofcaldav.html

I have tried to setup, but I get this 401-Unauthorized exception.
I have provided my username (email) and password. Maybe it’s because I have two-factor authentication? Should I use it with an application password?
Secondly, this is a shared calendar and I’m not the owner of this calendar. This can be a problem?

Yes you need to disable two actor auth. And enable third party apps.

Thanks, however this is not an option, I’ll try to get a workaround for this!

Create an account just for that, with only your openhab calendar in it. That’s what I did.

Yes this is exactly what I thought!
Anyway, you tried it creating an app-password for that? In that case, it ignores the two-factor auth…

To be honest I don’t remember. It was a long time ago. But I don’t have two factor auth. So no I didn’t try that.
It work very well.

Thanks for your help!
I’ll try some things with this and post the results here, as I haven’t found anything on the forum about this.

I believe the app password will work for you. You use app passwords for things that can’t handle the 2 factor usually. I had to use it when I setup cal-dev on my iphone several years ago. Now, I think apple handles everything with no issue.

https://support.google.com/accounts/answer/185833?hl=en

Yes it seems that it works with app password. I don’t get any 401 exception.
However it doesn’t show up in my sitemap. I just want to see the next event name and date.
Maybe @vzorglub can you help?

This is what I set up:

String CalendarTitle "Next event [%s]" <calendar> { caldavPersonal="calendar:openhab type:ACTIVE eventNr:1 value:NAME" }

Sorry, I don’t use caldavPersonal, only caldav command.