General CalDAV set up

I am trying to get the CalDAV binding to work on my OH1 system and have quite a few questions. I believe I have all of the files necessary installed in the addons folder.

  • org.openhab.io.caldav-1.8.2.jar
  • org.openhab.persistence.caldav-1.8.2.jar
  • org.openhab.binding.caldav-1.8.2.jar
  • org.openhab.binding.caldav-1.8.2.jar

My openhab.cfg file set up as follows. I have the refresh time set to be short for testing purposes.

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV. All parameters are required.
# Path to the calendar
# caldavio:<calendarId>:url=
  caldavio:ohab:url=https://www.google.com/calendar/dav/me@mydomain.com/events
#
# Username for the calendar
# caldavio:<calendarId>:username=
  caldavio:ohab:username=username
#
# Password for the calendar
# caldavio:<calendarId>:password=
  caldavio:ohab:password=password
#
# Reload interval unit is minutes.
# Defines how often the calendar should be reloaded from server.
# Default is 60 minutes
# caldavio:<calendarId>:reloadInterval=
  caldavio:ohab:reloadInterval=5
#
# This defines which events are relevant for execution. Unit is in minutes.
# Default is 1 Day (1440 minutes)
# caldavio:<calendarId>:preloadTime=
  caldavio:ohab:preloadTime=5
#
# 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
# caldavio:<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.
# caldavio:<calendarId>:disableCertificateVerification=
#
# Timezone for events which does not have a timeZone information.
# Normally this is not required
# caldavio:timeZone=
  caldavio:timeZone=America/Chicago

################################ CalDAV Command Binding ###################################
# 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=<ids from caldav-io>
  caldavCommand:readCalendars=ohab

############################# CalDAV Personal Binding ################################
# see CalDAV IO Binding
# Used to toggle switch items for presence. Switched to ON if an event in the calendar occurs.
# And back to OFF if the event ends.
# Can also be used to show upcoming or active events
#
# Which calendars should be used to detect presence (comma separated)
# caldavPersonal:usedCalendars=<ids from caldav-io>
  caldavPersonal:usedCalendars=ohab
#
# If the location of the event is one of this identifiers, the presence will not be changed.
# Can be used for events which are at home or are just reminders. (comma separated, optional)
# caldavPersonal:homeIdentifiers=

The CalDAV items files has the following:

String oHABcalendarN1 "Name [%s]" <calendar> {caldavPersonal="calendar:ohab type:ACTIVE eventNr:1 value:NAME"}
String oHABcalendarP1 "Place [%s]" <calendar> {caldavPersonal="calendar:ohab type:ACTIVE eventNr:1 value:PLACE"}
DateTime oHABcalendarS1 "Start [%1$tT, %1$td.%1$td.%1$tY]" <calendar> {caldavPersonal="calendar:ohab type:ACTIVE eventNr:1 value:START"}
DateTime oHABcalendarE1 "End [%1$tT, %1$td.%1$td.%1$tY]" <calendar> {caldavPersonal="calendar:ohab type:UPCOMING eventNr:1 value:END"}

And the event in my calendar has the following:

Event Name : testevent
Location : none
Start Time : any
End Time : any
Description : BEGIN:sKitchenLightStatus:ON
                   END:sKitchenLightStatus:OFF

I based the files off of the binding page in the wiki. Do I need the CalDAV items file if the calendar entry is referencing items I have in my MiOS items file?

I have the logging turned on to TRACE for CalDAV and here is the most recent output. I had just stopped the service added an event for 30 minutes in the future that should have been picked up.

2016-05-17 21:39:59 DEBUG o.o.i.c.i.CalDavActivator[:34]- CalDav Calendar IO has been started.
2016-05-17 21:39:59 DEBUG o.o.b.c.i.CalDavActivator[:34]- CalDav-Presence binding has been started.
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:82]- handling config: calendar:ohab type:ACTIVE eventNr:1 value:NAME
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: calendar:ohab
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: type:ACTIVE
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: eventNr:1
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: value:NAME
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:117]- found values: calendar=[ohab], type=ACTIVE, eventNr=1, value=NAME
2016-05-17 21:39:59 DEBUG o.o.b.c.i.CalDavBindingProviderImpl[:156]- adding item: oHABcalendarN1
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:82]- handling config: calendar:ohab type:ACTIVE eventNr:1 value:PLACE
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: calendar:ohab
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: type:ACTIVE
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: eventNr:1
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: value:PLACE
2016-05-17 21:39:59 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:117]- found values: calendar=[ohab], type=ACTIVE, eventNr=1, value=PLACE
2016-05-17 21:40:00 DEBUG o.o.b.c.i.CalDavBindingProviderImpl[:156]- adding item: oHABcalendarP1
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:82]- handling config: calendar:ohab type:ACTIVE eventNr:1 value:START
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: calendar:ohab
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: type:ACTIVE
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: eventNr:1
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: value:START
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:117]- found values: calendar=[ohab], type=ACTIVE, eventNr=1, value=START
2016-05-17 21:40:00 DEBUG o.o.b.c.i.CalDavBindingProviderImpl[:156]- adding item: oHABcalendarS1
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:82]- handling config: calendar:ohab type:UPCOMING eventNr:1 value:END
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: calendar:ohab
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: type:UPCOMING
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: eventNr:1
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:93]- handling config part: value:END
2016-05-17 21:40:00 TRACE o.o.b.c.i.CalDavBindingProviderImpl[:117]- found values: calendar=[ohab], type=UPCOMING, eventNr=1, value=END
2016-05-17 21:40:00 DEBUG o.o.b.c.i.CalDavBindingProviderImpl[:156]- adding item: oHABcalendarE1
2016-05-17 21:40:00 DEBUG o.o.b.c.internal.CalDavBinding[:66]- setting CalDavLoader: true
2016-05-17 21:40:00 DEBUG o.o.b.c.internal.CalDavBinding[:77]- CalDavBinding (personal) activated
2016-05-17 21:40:00 DEBUG o.o.b.c.i.CalDavActivator[:34]- CalDav-Command binding has been started.

Any help guidance would be greatly appreciated.

Hi,
Maybe some suggestions after a quick run through your data:

  1. next to org.openhab.binding.caldav-command-1.8.0.jar I have also org.openhab.binding.caldav-personal-1.8.0.jar installed.
  2. out the “caldavio:timeZone=America/Chicago” this might lead to problems.

  3. in items file I have used type:EVENT

Maybe also have a look at:

Cheers

Yeah, I just realized my typo. It should be command and personal bindings in my jar list. I will try commenting out the timezone and changing the item type and see what happens.

I am not sure what is going on or what setting I have flipped or not flipped but it still doesn’t work. I tried several different calendar entries and commenting out the timeZone value. I even added a new item to the caldav.items file that had a value set by the calendar event and configured a rule based on the item value. Still nothing works.

How often should the system poll the calendar for entries? I even set the reload interval in the config file to ‘2’ (it is minutes right?) and it didn’t seem to reach out like it should. I had to restart the service after waiting 20 minutes for it to attempt to pick up a new calendar entry I added.