Troubleshooting CalDav Personal - Public Garbage Collection Calendar

Hello all,
I’m trying to get a CalDav IO Personal binding up and running.
I am running Openhabian - OH2.4 on a raspberry pi with an SSD, & persistence (mapdb, influxdb).
I’m trying to integrate a publically accessible calendar file for garbage collection into rules, to have prompted reminders.

This has been a bit challenging, as much of the documentation refers to OH1 details such as the OH config file that doesn’t exist anymore. The suggested caldavio.cfg file is also missing the usedCalendars parameter, which then threw an error in the log. This could be added back, but then unfortunately the binding doesn’t seem to have any logging to be able to troubleshoot it further. I can’t see any references to caldav logging levels in the logging level file /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg
Perhaps I’m getting too far into the weeds with this - is there an easier way to debug a caldav binding?

The link to the calendar works, and a cut and paste into a browser results in this file being downloaded - I imagine it should be compatible

BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:Data::ICal 0.22
X-PUBLISHED-TTL:1440
X-WR-CALDESC:Solid Waste
X-WR-CALNAME:[**Address Removed**]
X-WR-TIMEZONE:America/Vancouver
BEGIN:VEVENT
DESCRIPTION:Recyclables and green bin
DTSTART;VALUE=DATE:20190429
SUMMARY:Recyclables and green bin
UID:2019-04-29-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Green bin and garbage
DTSTART;VALUE=DATE:20190506
SUMMARY:Green bin and garbage
UID:2019-05-06-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Recyclables and green bin
DTSTART;VALUE=DATE:20190513
SUMMARY:Recyclables and green bin
UID:2019-05-13-[**Identifier Removed **]
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:Green bin and garbage
DTSTART;VALUE=DATE:20190521
SUMMARY:Green bin and garbage
UID:2019-05-21-[**Identifier Removed **]
END:VEVENT

[**SNIP**]
END:VEVENT
END:VCALENDAR

caldavio.cfg

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar
caldavio:GarbagePickup:url=https://SNIPPED-ADDRESS

# Username for the calendar
#<calendarId>:username=

# Password for the calendar
#<calendarId>:password=

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

# This defines which events are relevant for execution. Unit is in minutes.
# Default is 1 Day (1440 minutes)
<calendarId>:preloadTime= 8639 # 6 days -1 minute
#2879 is 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

caldavPersonal:usedCalendars=GarbagePickup

caldavPersonal.cfg

############################# 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)
# usedCalendars=<ids from caldav-io>
#
# 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)
# homeIdentifiers=

caldavio:usedCalendars=GarbagePickup

calendaritems.items

String GarbagePickupName0	"Pickup Today? [%s]"		<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime GarbagePickupTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events
String GarbagePickupName1	"Next Pickup [%s]"	<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:NAME" }
DateTime GarbagePickupTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:START" }
String GarbagePickupName2	"Following Pickup [%s]" <calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:NAME" }
DateTime GarbagePickupTime2	"Time [%1$tT, %1$td.%1$tm.%1$tY]" 			<calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:START" }

I’m using a habmin panel pointing to the above strings / dates, which shows the values remaining undefined.

The log doesn’t show anything related to caldav at all - including when I update/modify/touch the config or items files.

Any suggestions on where to go from here?

Thanks

Please file an issue in the openhab1-addons repo. See How to file an Issue for details on how to file an issue.

Anything it tells you to put into openhab.conf needs to go into it’s open file. Name the file after the first part of the parameter. If the parameters are caldav:foo then name the file caldav.conf and removed the caldav: part when you add the configuration parameters to that file.

Individual binding’s are not included in the liver config. If you want to change the logging for just one add-on, you need to add an appender and lover for that add-on yourself. See Log4j2 Sample Config for details.

Alternatively, you can put everything into trace or debug logging and filter out just those that have caldav using grep.

I see a number of errors.

Remove “caldavio:” from in front of all parameters in that file.

<caldendarId> is meant to be replaced with a unique I’d for the calendar the parameter is intended to configure. Many users have this binding connected to multiple calendars and this is how you can have different configurations for reach calendar. It looks like you are using “GarbagePickup” as your calendarID.

Thanks @rlkoshak
I had missed the parameter with the not replaced.
I had kept the caldavio: prefix due to the discussion on the documentation page:


under “Note for Openhab 2” and as reflected by the section immediately above it.

Regardless, after updating the incorrect calendar-ID paremeter, I tried removing all the caldavio: prefixes from the file. I didn’t see any notification that the config file was rescanned (I seem to only see notifications if there’s an error with the file). I restarted OH2, and continued to see the string items as undefined.

I obviously need to get into the finer details of controlling log levels more. My reading of : https://www.openhab.org/docs/administration/logging.html was that even using Karaf, I needed to specify the package and subpackage, which means I need to know the name for it in the first place. I see the new paperui ‘replacement’ idea has a section for setting logging levels, so hopefully this makes it more accessible.

Is there an easy way to just ‘put everything into trace or debug’? I haven’t seen this mentioned yet.

If it helps, in the file structure
/var/lib/openhab2/etc/caldav
I see a directory titled GarbagePickup

  • it is empty. I assume this is where calendar files would be downloaded to.


I’ve just posted an issue about the caldavio documentation (and refining log info) to github - thanks for the prompt.

Thanks for your help!

In the Karaf console I think the command it log:set trace followed by a log:tail. You can do it in the config file by changing log4j2.logger.openhab.level to TRACE in the logging config file.

Definitely follow the directions in the CalDav docs over anything said here. I don’t use this binding so don’t know if there is something unique about it.

Thanks.

Incidentally, on the topic of creating an issue for caldavio, after creating it, a reply was made that stated this belonged in the forums, and the issue was closed. (the issue was that the documentation was out of date, and I requested better logging detail on if/when calendars fail to load)
It seems they want specific defects in code posted as issues, rather than missing features (logging fidelity) or documentation discrepancies.

Well, the issue filled reads like a discussion and request for help and it’s really two different issues and should have been separated.

  1. Docs are incorrect and inconsistent referring files that don’t exist.

  2. A feature request to add additional logging

Though, if the config isn’t correct and loaded the binding probably doesn’t even know about the calendar so would be able to log out about failing.

I agree, I could have been much more succinct in my ‘issue’.

Separately, I’ve done a bit of a deeper dive into this.

Short question: Can someone else reproduce this problem with accessing a freely-available calendar (ie , no username or password )? Below I am using https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true

If so, then perhaps this is an issue that could be posted on github.

Long question(s)/info:

I’ve tried toggling the caldavio authentication, thinking that it may be a factor.

When I set a username and password, I seem to be getting an error logged for parsing. Otherwise, if I remove the username/password (commented-out), I don’t get anything significant per my read of the logs (set to trace).

If I deliberately foul the calendar URL, there is no error thrown that I can find in the trace logs.

  • perhaps either because it doesn’t log failed/successful attempts, or because the error parsing the password stopped the show before that point.


If I add another publically-accessible calendar that doesn’t require username/password (for transparent testing purposes. found on a google search - a public Pool in halifax), I get the same sort of problems.

The calendar URL for testing: https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true

The error from the trace logs:

2019-05-14 21:02:10.493 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=156, bundle=273/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: password

My testing caldavio.cfg file:

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar

caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true
caldavio:TestCal:username=
caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000

caldavio:usedCalendars=TestCal

There are no extra characters after the username or password fields. I tried setting the username and password to ‘random’, and the same unable to parse password error came up. I removed the .config files, as suggested by https://github.com/openhab/openhab1-addons/issues/4074#issuecomment-303877706 - also to no avail.

The trace log - notably still had an entry for GarbagePickup, although it had been removed from the config file:

tail -F /var/log/openhab2/openhab.log /var/log/openhab2/events.log
caldav
 2019-05-14 21:02:10.408 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.413 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.415 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.418 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.422 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.424 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.427 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.431 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.433 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.436 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.440 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.442 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.444 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.448 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.451 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.453 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.457 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.460 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.463 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:10.467 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.469 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:10.472 [DEBUG] [org.apache.felix.configadmin        ] - update(properties={GarbagePickup:disableCertificateVerification=true, GarbagePickup:password=, GarbagePickup:preloadTime=2879, GarbagePickup:reloadInterval=10, GarbagePickup:url=[snip], GarbagePickup:username=, password=blank, service.pid=org.openhab.caldavio, TestCal:password=, TestCal:preloadTime=1000, TestCal:reloadInterval=60, TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true, TestCal:username=, usedCalendars=TestCal, username=blank})

2019-05-14 21:02:10.474 [DEBUG] [org.apache.felix.configadmin        ] - Updating config org.openhab.caldavio with {GarbagePickup:disableCertificateVerification=true, GarbagePickup:password=, GarbagePickup:preloadTime=2879, GarbagePickup:reloadInterval=10, GarbagePickup:url=[snip], GarbagePickup:username=, password=blank, service.pid=org.openhab.caldavio, TestCal:password=, TestCal:preloadTime=1000, TestCal:reloadInterval=60, TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true, TestCal:username=, usedCalendars=TestCal, username=blank}

2019-05-14 21:02:10.482 [DEBUG] [org.apache.felix.configadmin        ] - Scheduling task Fire ConfigurationEvent: pid=org.openhab.caldavio

2019-05-14 21:02:10.483 [DEBUG] [org.apache.felix.configadmin        ] - Scheduling task Update: pid=org.openhab.caldavio

2019-05-14 21:02:10.483 [DEBUG] [org.apache.felix.configadmin        ] - Running task Fire ConfigurationEvent: pid=org.openhab.caldavio

2019-05-14 21:02:10.484 [DEBUG] [org.apache.felix.configadmin        ] - UpdateConfiguration(org.openhab.caldavio) scheduled

2019-05-14 21:02:10.485 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=115, bundle=9/mvn:org.apache.felix/org.apache.felix.configadmin/1.9.4]

2019-05-14 21:02:10.484 [DEBUG] [org.apache.felix.configadmin        ] - Running task Update: pid=org.openhab.caldavio

2019-05-14 21:02:10.486 [DEBUG] [org.apache.felix.configadmin        ] - Updating configuration org.openhab.caldavio to revision #16

2019-05-14 21:02:10.486 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.openhab.core.karaf.internal.FeatureInstaller, org.osgi.service.cm.ConfigurationListener, id=199, bundle=181/mvn:org.openhab.core/org.openhab.core.karaf/2.4.0]

2019-05-14 21:02:10.487 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=68, bundle=43/mvn:org.apache.karaf.config/org.apache.karaf.config.core/4.2.1]

2019-05-14 21:02:10.487 [DEBUG] [org.apache.felix.configadmin        ] - canReceive=true: bundle=mvn:org.openhab.io/org.openhab.io.caldav/1.13.0; configuration=mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.489 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, org.apache.felix.fileinstall.ArtifactListener, org.apache.felix.fileinstall.ArtifactInstaller, id=39, bundle=10/mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4]

2019-05-14 21:02:10.491 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=?)

2019-05-14 21:02:10.492 [WARN ] [.io.caldav.internal.CalDavLoaderImpl] - Unable to parse configuration parameter: password

2019-05-14 21:02:10.493 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:10.495 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4

2019-05-14 21:02:10.493 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=156, bundle=273/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: password

org.osgi.service.cm.ConfigurationException: CalDAV IO : Unable to parse configuration parameter: password

	at org.openhab.io.caldav.internal.CalDavLoaderImpl.updated(CalDavLoaderImpl.java:183) ~[?:?]

2019-05-14 21:02:10.500 [DEBUG] [org.apache.felix.configadmin        ] - Sending CM_UPDATED event for org.openhab.caldavio to [org.osgi.service.cm.ConfigurationListener, id=40, bundle=14/mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/4.2.1]

2019-05-14 21:02:11.492 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.497 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.499 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.503 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.508 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.510 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.513 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.517 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.519 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.522 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.526 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.528 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.531 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.535 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.537 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.540 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.544 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.547 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

2019-05-14 21:02:11.549 [DEBUG] [org.apache.felix.configadmin        ] - getConfiguration(pid=org.openhab.caldavio, location=null)

2019-05-14 21:02:11.553 [DEBUG] [org.apache.felix.configadmin        ] - Found cached configuration org.openhab.caldavio bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0

2019-05-14 21:02:11.556 [DEBUG] [org.apache.felix.configadmin        ] - Explicit Permission; grant configure permission on configuration bound to mvn:org.openhab.io/org.openhab.io.caldav/1.13.0 to bundle mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.10.0.oh240

==
The relevant section of the CalDavLoader.Impl.java code is (per github):

public void updated(Dictionary<String, ?> config) throws ConfigurationException {
        if (config == null) {
            log.debug("Update was called with a null configuration for CalDAV IO.");
            return;
        }

        log.debug("Update was called for CalDAV IO.");
        CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, true);
        Map<String, CalDavConfig> configMap = new HashMap<String, CalDavConfig>();

        Enumeration<String> iter = config.keys();
        while (iter.hasMoreElements()) {
            String key = iter.nextElement();

            if (key.equals("service.pid")) {
                continue;
            }

            log.trace("processing configuration parameter: {}", key);
            if (key.equals(PROP_TIMEZONE)) {
                String newTimeZoneStr = Objects.toString(config.get(key), null);
                if (StringUtils.isBlank(newTimeZoneStr)) {
                    log.info("The {} setting was configured with an empty value. Default value '{}' will be used instead.",
                             PROP_TIMEZONE, defaultTimeZone);
                    continue;
                }
                DateTimeZone newTimeZone = DateTimeZone.forID(newTimeZoneStr);
                if (newTimeZone == null) {
                    log.warn("Invalid timezone value: {}", newTimeZoneStr);
                    throw new ConfigurationException(PROP_TIMEZONE, "Invalid timezone value: " + newTimeZoneStr);
                }
                log.debug("Overriding default timezone {} with {}", defaultTimeZone, newTimeZone);
                defaultTimeZone = newTimeZone;
                continue;
            }

            String[] keys = key.split(":");
            if (keys.length != 2) {
                log.warn("Unable to parse configuration parameter: {}", key);
                throw new ConfigurationException("CalDAV IO", "Unable to parse configuration parameter: "+key);
            }
            String id = keys[0];
            String paramKey = keys[1];
            CalDavConfig calDavConfig = configMap.get(id);
            if (calDavConfig == null) {
                calDavConfig = new CalDavConfig();
                configMap.put(id, calDavConfig);
            }
            String value = Objects.toString(config.get(key), null);

            calDavConfig.setKey(id);
            if (paramKey.equals(PROP_USERNAME)) {
                calDavConfig.setUsername(value);
            } else if (paramKey.equals(PROP_PASSWORD)) {
                calDavConfig.setPassword(value);
            } else if (paramKey.equals(PROP_URL)) {
                calDavConfig.setUrl(value);
            } else if (paramKey.equals(PROP_RELOAD_INTERVAL)) {
                calDavConfig.setReloadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_PRELOAD_TIME)) {
                calDavConfig.setPreloadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_HISTORIC_LOAD_TIME)) {
                calDavConfig.setHistoricLoadMinutes(Integer.parseInt(value));
            } else if (paramKey.equals(PROP_LAST_MODIFIED_TIMESTAMP_VALID)) {
                calDavConfig.setLastModifiedFileTimeStampValid(BooleanUtils.toBoolean(value));
            } else if (paramKey.equals(PROP_DISABLE_CERTIFICATE_VERIFICATION)) {
                calDavConfig.setDisableCertificateVerification(BooleanUtils.toBoolean(value));
            } else if (paramKey.equals(PROP_CHARSET)) {
                try {
                    Charset.forName(value);
                    calDavConfig.setCharset(value);
                } catch (UnsupportedCharsetException e) {
                    log.warn("Character set not valid: {}", value);
                }
            }
        }

Thoughts?

Try commenting out the username and password instead of having them be blank.

Thanks RIch,
That was actually the first way I had it configured, and I’ve tried switching to and from that.
From my read, if the line is commented out, it doesn’t update the binding settings with that value (some of the logs would display the trial dummy passwords in the trace log if another parameter was updated, even though I now had the line commented out.)

The caldavio.cfg configuration I’ve had since the post above was:

caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-cal$
#caldavio:TestCal:username=
#caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000

#caldavio:usedCalendars=GarbagePickup,TestCal
caldavio:usedCalendars=TestCal

In looking around, I haven’t seen someone who accesses freely available calendars with this binding. This was part of why I found a schedule form a separate geographic location that others may potentially test to confirm if this is a bug or not.

It is frustrating to me, though, that I get the error “Unable to parse configuration parameter: password” regardless of what is put in for the password. Looking at examples of functional config files, it seems that there aren’t any quotations required for the password.
My next step is going to be to set up and then access a google calendar - which multiple people have had success with. It, at least, would be proof that I can get it working…

Interesting discovery - it seems caldavio.config (in /var/lib/openhab2/config/org/openhab/ )

shows an unassociated password parameter that doesn’t fit with the config files.

I removed all the caldavio .config files, updated the caldavio.cfg file in /etc/openhab2/services , and then the same incorrect caldavio.config file showed in the other location.

I then cleared the cache as per Clear the Cache (note, the file permissions had to be restored before openhab would start again - with: sudo openhab-cli reset-ownership ). I also removed the caldavio* files in the .config folder.

Still, the caldavio.config file keeps showing the incorrect and unassociated password variable.

Any ideas where this free parameter may be coming from? I imagine this is where I get my error described above : “Unable to parse configuration parameter: password”

/etc/openhab2/services/
caldavio.cfg

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar

#caldavio:GarbagePickup:url=https://[snip]
#caldavio:GarbagePickup:username=
#caldavio:GarbagePickup:password=
#caldavio:GarbagePickup:reloadInterval=10
#caldavio:GarbagePickup:preloadTime= 2879


caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true
#caldavio:TestCal:username=
#caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000

caldavio:TestGCal:url=https://www.google.com/calendar/dav/[snip]@gmail.com/events
caldavio:TestGCal:username=[snip]@gmail.com
caldavio:TestGCal:password=[snip]
caldavio:TestGCal:reloadInterval=60
caldavio:TestGCal:preloadTime=1000
caldavio:TestGCal:disableCertificateVerification=true

#caldavio:usedCalendars=GarbagePickup,TestCal
caldavio:usedCalendars=TestCal,TestGCal

And, using the above cfg file (plus presumably some old information cached somewhere, not reset by the clear of cache and tmp), the below caldavio.config file was created. Of note, it still has the GarbagePickup calendar in it (which hasn’t been in my active cfg file for a long time), and has the unassociated ‘password=blank’ and a ‘username=blank’. blank was a password that I had briefly put in to see if that would trigger at least some sort of an error that I could trace, and it may have early on been put on an incorrect cfg file without the caldavio:calendarname:password structure.

/var/lib/openhab2/config/org/openhab/
caldavio.config

GarbagePickup:disableCertificateVerification="true"
GarbagePickup:password=""
GarbagePickup:preloadTime="2879"
GarbagePickup:reloadInterval="10"
GarbagePickup:url="https://[snip]"
GarbagePickup:username=""
TestCal:password=""
TestCal:preloadTime="1000"
TestCal:reloadInterval="60"
TestCal:url="https://www.centennialpool.ca/?plugin\=all-in-one-event-calendar&controller\=ai1ec_exporter_controller&action\=export_events&no_html\=true"
TestCal:username=""
TestGCal:disableCertificateVerification="true"
TestGCal:password="[snip]"
TestGCal:preloadTime="1000"
TestGCal:reloadInterval="60"
TestGCal:url="https://www.google.com/calendar/dav/[snip]@gmail.com/events"
TestGCal:username="[snip]@gmail.com"
password="blank"
service.pid="org.openhab.caldavio"
usedCalendars="TestCal,TestGCal"
username="blank"

Any ideas on how to ‘clear’ the caldavio cache, or where caldavio may be getting this old data from?
Thanks

I use Google Calendars for a similar scenario…

I have calendars set up for Recycling, Junk Waste, Tree Waste, and School events that pull into OH. I use the information on a HabPanel display

image

I can tell you the setup process with CalDav was extremely frustrating and the documentation needs quite a bit of work as you seem to spin in circles without getting answers.

I’ll share my config files below in the hope you can gleam some knowledge…it’s been a couple of years so the exact details and hurdles are not so fresh in the brain.

I don’t see mention of your caldavPersonal.cfg file.

Let me know if you have any questions.

Squid

caldavio.cfg

# Trash Calendar
caldavio:Trash:url=https://www.google.com/calendar/dav/xxxxxxxxxxxx@group.calendar.google.com/events
caldavio:Trash:username=user@gmail.com
caldavio:Trash:password=xxxxxxxx
caldavio:Trash:reloadInterval=10
caldavio:Trash:preloadTime=25920
caldavio:Trash:disableCertificateVerification=true
caldavio:Trash:charset=UTF-8
caldavio:Trash:lastModifiedFileTimeStampValid=false

# Recycling Calendar
caldavio:Recycling:url=https://www.google.com/calendar/dav/xxxxxxxxxxx@group.calendar.google.com/events
caldavio:Recycling:username=user@gmail.com
caldavio:Recycling:password=xxxxxxxx
caldavio:Recycling:reloadInterval=10
caldavio:Recycling:preloadTime=25920
caldavio:Recycling:disableCertificateVerification=true
caldavio:Recycling:charset=UTF-8
caldavio:Recycling:lastModifiedFileTimeStampValid=false

# TreeWaste Calendar
caldavio:Tree:url=https://www.google.com/calendar/dav/xxxxxxxxxxxx@group.calendar.google.com/events
caldavio:Tree:username=user@gmail.com
caldavio:Tree:password=xxxxxxxx
caldavio:Tree:reloadInterval=10
caldavio:Tree:preloadTime=93600
caldavio:Tree:disableCertificateVerification=true
caldavio:Tree:charset=UTF-8
caldavio:Tree:lastModifiedFileTimeStampValid=false

# JunkWaste Calendar
caldavio:Junk:url=https://www.google.com/calendar/dav/xxxxxxxxxxxxxxxx@group.calendar.google.com/events
caldavio:Junk:username=user@gmail.com
caldavio:Junk:password=xxxxxxxx
caldavio:Junk:reloadInterval=10
caldavio:Junk:preloadTime=93600
caldavio:Junk:disableCertificateVerification=true
caldavio:Junk:charset=UTF-8
caldavio:Junk:lastModifiedFileTimeStampValid=false

# School Calendar
caldavio:School:url=https://www.google.com/calendar/dav/xxxxxxxxxxxxxx@group.calendar.google.com/events
caldavio:School:username=user@gmail.com
caldavio:School:password=xxxxxxxx
caldavio:School:reloadInterval=10
caldavio:School:preloadTime=93600
caldavio:School:disableCertificateVerification=true
caldavio:School:charset=UTF-8
caldavio:School:lastModifiedFileTimeStampValid=false

# House Calendar
caldavio:House:url=https://www.google.com/calendar/dav/xxxxxxxxxxxxxxx@group.calendar.google.com/events
caldavio:House:username=user@gmail.com
caldavio:House:password=xxxxxxxx
caldavio:House:reloadInterval=10
caldavio:House:preloadTime=93600
caldavio:House:disableCertificateVerification=true
caldavio:House:charset=UTF-8
caldavio:House:lastModifiedFileTimeStampValid=false

caldavPersonal.cfg

caldavPersonal:usedCalendars=Junk,Recycling,Trash,Tree,School,House
caldavCommand:readCalendars=Junk

Having got this too work, anything you can offer as a contribution, filled issue, or tutorial would be appreciated.

Did you, or is it even possible, to configure this binding through PaperUI?

There is a known bug which often gets forgot where remind as parameter from /etc/openhab2/services/*.cfg doesn’t get removed from that config file which OH generates based on the contents of the cfg file.

But deleting the config file and restarting OH should cause the config to be regenerated using the present contents of the cfg file.

I’ve no idea why the fields keep coming back. Do you notice any other words behavior, like log files failing to rotate it the like? When you reboot, do the contents of any file revert to an older version? If so, this could be a sign of a failing SD card.

Thanks for the idea, Rich.
I can’t find anywhere in the PaperUI interface where caldavio can be configured.

I explicitly did a fresh boot, deleted the .config file, and then restarted the RPi again.
This time, I no longer got the password error, and the .config file no longer had the orphaned password field.
I didn’t notice any errors in the log, but wasn’t seeing the strings populate from the binding, so I made a minor change to the caldavio.cfg file (changing the reload interval), and saved the file. Now, I’m seeing an error for the usedCalendars variable.

2019-05-25 14:15:23.162 [WARN ] [.io.caldav.internal.CalDavLoaderImpl] - Unable to parse configuration parameter: usedCalendars

2019-05-25 14:15:23.166 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=160, bundle=249/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: usedCalendars

I haven’t changed the configuration (caldavio.cfg) file at all from the one referenced above.

The new caldavio.config file is:

TestCal:preloadTime="1000"
TestCal:reloadInterval="60"
TestCal:url="https://www.centennialpool.ca/?plugin\=all-in-one-event-calendar&controller\=ai1ec_exporter_controller&action\=export_events&no_html\=true"
TestGCal:disableCertificateVerification="true"
TestGCal:password="[snip]"
TestGCal:preloadTime="1000"
TestGCal:reloadInterval="65"
TestGCal:url="https://www.google.com/calendar/dav/[snip]@gmail.com/events"
TestGCal:username="[snip]@gmail.com"
service.pid="org.openhab.caldavio"
usedCalendars="TestCal,TestGCal"

I then looked at @KidSquid 's config files above and noticed that the usedCalendars variable was only in the caldavPersonal.cfg file, not caldavio.cfg . I commented it out from caldavio, and didn’t get any updates in the logs. I then removed the .config files and restarted. Bootup didn’t show any caldav messages in the logs, but I again made a small adjustment to the refresh in the caldavio.cfg file, and I received a confirmation that the file was configured correctly!

2019-05-25 14:32:45.468 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - CalDAV IO is properly configured.

Unfortunately my strings are still not updating, however it seems that I may have moved on past the initial config problems.


For others with this problem, keep your .cfg files clean. the usedCalendars parameter shouldn’t go in the caldavio.cfg file. (the official documentation is out of date, and doesn’t state what goes in which file. You can infer this usually, though, by paying close attention to the first parameter before the first colon, and that is the .cfg file it should go into. It also seems that whenever you make a significant change, you may need to delete the .config file and restart openhab. (I had done whole system restarts, as that was quicker with my R Pi).

I think the problem with the config file not updating correctly only occurs when the problem was initiated with an incorrect .cfg file in the first place. My first problem (password) was when I had an unassociated password line in the cfg file. My second problem (usedCalendars) was when the usedCalendars parameter was put in the wrong file (caldavi.cfg) [it was also in the correct file, caldavPersonal.cfg]


I’ll keep on working on getting the rest of my setup working. I notice KidSquid has slightly different google addresses used than I that I will try, and I still haven’t gotten the strings to update from the calendar yet.

Cheers

@KidSquid would you be able to post your relevant items file?


Here’s my calendar.items

  • I got the format almost entirely from the caldavio documentation.
String GarbagePickupName0	"Pickup Today? [%s]"		<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime GarbagePickupTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events
String GarbagePickupName1	"Next Pickup [%s]"	<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:NAME" }
DateTime GarbagePickupTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:START" }
String GarbagePickupName2	"Following Pickup [%s]" <calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:NAME" }
DateTime GarbagePickupTime2	"Time [%1$tT, %1$td.%1$tm.%1$tY]" 			<calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:START" }

String TestCalName0	"Item? [%s]"		<calendar>	{ caldavPersonal="calendar:TestCal type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime TestCalTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:TestCal type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events

String TestGCalName0	"Item? [%s]"		<calendar>	{ caldavPersonal="calendar:TestGCal type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime TestGCalTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:TestGCal type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events

and my caldavio.cfg

################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar

caldavio:GarbagePickup:url=https://[snip]
#caldavio:GarbagePickup:username=
#caldavio:GarbagePickup:password=
caldavio:GarbagePickup:reloadInterval=10
caldavio:GarbagePickup:preloadTime= 2879 


caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true
#caldavio:TestCal:username=
#caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000

caldavio:TestGCal:url=https://www.google.com/calendar/dav/[snip]@group.calendar.google.com/events
caldavio:TestGCal:username=[snip]@gmail.com
caldavio:TestGCal:password=[snip]
caldavio:TestGCal:reloadInterval=60
caldavio:TestGCal:preloadTime=1000
caldavio:TestGCal:disableCertificateVerification=true

and my caldavPersonal.cfg:

############################# CalDAV Personal Binding ################################


caldavPersonal:usedCalendars=TestCal,TestGCal,GarbagePickup

Currently the only thing I see in my log, after I update the calendar.items file is:

2019-05-25 15:19:22.815 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'calendar.items'

2019-05-25 15:19:22.958 [vent.ItemStateChangedEvent] - TestCalName0 changed from NULL to UNDEF

2019-05-25 15:19:22.961 [vent.ItemStateChangedEvent] - TestCalTime0 changed from NULL to UNDEF

2019-05-25 15:19:22.964 [vent.ItemStateChangedEvent] - TestGCalName0 changed from NULL to UNDEF

2019-05-25 15:19:22.967 [vent.ItemStateChangedEvent] - TestGCalTime0 changed from NULL to UNDEF

UPDATE:
On reboot and careful watching of the log, this popped up. It appears there is an error.

=======

2019-05-25 15:34:23.516 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - CalDAV IO is properly configured.

2019-05-25 15:34:23.530 [INFO ] [b.core.service.AbstractActiveService] - CalDav Loader has been started

  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.

2019-05-25 15:34:23.838 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: GarbagePickup

2019-05-25 15:34:23.841 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: TestGCal

2019-05-25 15:34:23.849 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - reload job scheduled for: TestCal

2019-05-25 15:34:26.311 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_CA'.

2019-05-25 15:34:49.413 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (405 - Method Not Allowed)

	at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [249:org.openhab.io.caldav:1.13.0]

org.quartz.JobExecutionException: Sardine error while loading calendar entries

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:174) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) ~[?:?]

2019-05-25 15:34:50.074 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'calendar.items'

2019-05-25 15:34:58.543 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (404 - Not Found)

	at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [249:org.openhab.io.caldav:1.13.0]

2019-05-25 15:34:58.561 [INFO ] [org.quartz.core.JobRunShell         ] - Job event-reloader.TestGCal threw a JobExecutionException: 

org.quartz.JobExecutionException: Sardine error while loading calendar entries

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:174) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) ~[?:?]

2019-05-25 15:34:58.623 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Not a valid DAV response (200 - OK)

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:56) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) ~[249:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) ~[249:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[249:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [249:org.openhab.io.caldav:1.13.0]

2019-05-25 15:34:58.628 [INFO ] [org.quartz.core.JobRunShell         ] - Job event-reloader.TestCal threw a JobExecutionException: 

org.quartz.JobExecutionException: Sardine error while loading calendar entries

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:174) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[?:?]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) ~[?:?]

For what it’s worth, I have the google account used already set to allow insecure applications, and have it working with the sendMail functioning.

Can’t be done. That’s why you can’t find it.

Here are my items…

DateTime    Calendar_Upcoming_Junk       "Next Junk Waste Pickup [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:Junk type:EVENT eventNr:1 value:START" }
DateTime    Calendar_Upcoming_Trash      "Next Trash Waste Pickup [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:Trash type:UPCOMING eventNr:1 value:START" }
DateTime    Calendar_Upcoming_Tree       "Next Tree Waste Pickup [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:Tree type:EVENT eventNr:1 value:START" }
DateTime    Calendar_Upcoming_Recycle    "Next Recyling Pickup (start) [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:Recycling type:UPCOMING eventNr:1 value:START" }
DateTime    Calendar_Upcoming_School    "Next School Event (start) [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:School type:UPCOMING eventNr:1 value:START" }
DateTime    Calendar_Upcoming_School_Name    "Name" <calendar> { caldavPersonal="calendar:School type:UPCOMING eventNr:1 value:NAME" }
DateTime    Calendar_Upcoming_House    "Next House Event (start) [%1$tA, %1$tB %1$te, %1$tY at %1$tl:%1$tM%1$tp]" <calendar> { caldavPersonal="calendar:House type:UPCOMING eventNr:1 value:START" }
DateTime    Calendar_Upcoming_House_Name    "Name" <calendar> { caldavPersonal="calendar:House type:UPCOMING eventNr:1 value:NAME" }

If memory serves, you must have the caldavio prefix on all of the items in the cfg file.

Hope this helps…let me know if you need anything.

Squid

2 posts were split to a new topic: Problem installing Caldav binding

Thanks Squid,
It’s taken me a while since I was last able to dive into this. It doesn’t seem to be my items that are the problem.
After doing a bit more of a thorough step through all of this, I was finally able to get one calendar working - the main calendar associated with a google account. To get to this, I ensured that I had the URL correct - by pasting it into a browser bar, typing in the login information, and getting the downloaded file.
I then tried a workaround to get my garbage schedule in and working, similar to what it seems you did. My URL, found from the calendar settings integration section, had a slightly different structure, being @import.calendar.google.com, where you had group.calendar.google.com, and the main calendar for this account was simply the email address associated with the account.
Regardless, both these final URLs pasted into a browser bar (incognito mode, so there weren’t any conflations with being logged in on another account, etc), resulted in the ics file being downloaded after the credentials were entered. The file had all the pertinent information. Check.

The problem is that the secondary calendar, the one with the garbage schedule, doesn’t download with caldavio, and the variables don’t populate as you’d imagine.

So, I still don’t know why the calendars that don’t require usernames and passwords don’t download. The log gives the 405 error as quoted above.

I’m not entirely sure why the secondary google calendar doesn’t download. It’s linked to the same account as the main calendar, so the settings are all the same.

  1. Google Calendar, main calendar. Caldavio downloads the files, and the variables are correctly populated.
    Config:
caldavio:TestGCal:url=https://www.google.com/calendar/dav/**********@gmail.com/events
caldavio:TestGCal:username=**********@gmail.com
caldavio:TestGCal:password=**********
caldavio:TestGCal:reloadInterval=60
caldavio:TestGCal:preloadTime=1000
caldavio:TestGCal:disableCertificateVerification=true
  1. Google Calendar, secondary calendar. Caldavio doesn’t download anything, variables don’t populate. Confirmed URL working, downloads ics file. Also confirmed that the url string with xxx@group.calendar.google.com does NOT work for either, unlike in @KidSquid 's circumstance. I’m guessing this is related to which server the account is on, but it may be pertinent.

Config

caldavio:GarbageGCal:url=https://www.google.com/calendar/dav/*****hash*****@import.calendar.google.com/events
caldavio:GarbageGCal:username=**********@gmail.com
caldavio:GarbageGCal:password=**********
caldavio:GarbageGCal:reloadInterval=10
caldavio:GarbageGCal:preloadTime=8640
caldavio:GarbageGCal:disableCertificateVerification=true

I set the preload time to 6 days to allow for the weekly schedule, and the preload time to 10 minutes as I wasn’t feeling patient. Of note, it had the same lack of success with the same settings as for #1.

  1. Test open calendar as posted above, no credentials required. Caldavio doesn’t download anything, variables don’t populate. Confirmed URL working.

Config

caldavio:TestCal:url=https://www.centennialpool.ca/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true
#caldavio:TestCal:username=
#caldavio:TestCal:password=
caldavio:TestCal:reloadInterval=60
caldavio:TestCal:preloadTime=1000
  1. Direct link to garbage collection schedule, no credentials required. Caldavio doesn’t download anything, variables don’t populate. Confirmed URL working.

Config

caldavio:GarbagePickup:url=*************
#caldavio:GarbagePickup:username=
#caldavio:GarbagePickup:password=
caldavio:GarbagePickup:reloadInterval=10
caldavio:GarbagePickup:preloadTime= 2879

caldavPersonal.cfg

############################# 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)
# usedCalendars=<ids from caldav-io>
#
# 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)
# homeIdentifiers=


caldavPersonal:usedCalendars=TestCal,TestGCal,GarbagePickup,GarbageGCal

calendar.items

String GarbagePickupName0	"Pickup Today? [%s]"		<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime GarbagePickupTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events
String GarbagePickupName1	"Next Pickup [%s]"	<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:NAME" }
DateTime GarbagePickupTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:1 value:START" }
String GarbagePickupName2	"Following Pickup [%s]" <calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:NAME" }
DateTime GarbagePickupTime2	"Time [%1$tT, %1$td.%1$tm.%1$tY]" 			<calendar> { caldavPersonal="calendar:GarbagePickup type:UPCOMING eventNr:2 value:START" }

String TestCalName0	"Item? [%s]"		<calendar>	{ caldavPersonal="calendar:TestCal type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime TestCalTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	{ caldavPersonal="calendar:TestCal type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events

String TestGCalName0	"Item? [%s]"		<calendar> (gCalendar)	{ caldavPersonal="calendar:TestGCal type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime TestGCalTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	(gCalendar) { caldavPersonal="calendar:TestGCal type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events

String TestGCalName1	"Item? [%s]"		<calendar> (gCalendar)	{ caldavPersonal="calendar:TestGCal type:UPCOMING eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime TestGCalTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar>	(gCalendar) { caldavPersonal="calendar:TestGCal type:UPCOMING eventNr:1 value:START" } //eventNr for concurrent events



String GGarbagePickupName0	"Pickup Today? [%s]"		<calendar> (gCalendar)	{ caldavPersonal="calendar:GarbageGCal type:ACTIVE eventNr:1 value:NAME" } //eventNr for concurrent events
DateTime GGarbagePickupTime0	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar> (gCalendar)	{ caldavPersonal="calendar:GarbageGCal type:ACTIVE eventNr:1 value:START" } //eventNr for concurrent events
String GGarbagePickupName1	"Next Pickup [%s]"	<calendar> (gCalendar)	{ caldavPersonal="calendar:GarbageGCal type:UPCOMING eventNr:1 value:NAME" }
DateTime GGarbagePickupTime1	"Time [%1$tT, %1$td.%1$tm.%1$tY]"			<calendar> (gCalendar)	{ caldavPersonal="calendar:GarbageGCal type:UPCOMING eventNr:1 value:START" }
String GGarbagePickupName2	"Following Pickup [%s]" <calendar> (gCalendar) { caldavPersonal="calendar:GarbageGCal type:UPCOMING eventNr:2 value:NAME" }
DateTime GGarbagePickupTime2	"Time [%1$tT, %1$td.%1$tm.%1$tY]" 			<calendar> (gCalendar) { caldavPersonal="calendar:GarbageGCal type:UPCOMING eventNr:2 value:START" }

If I can get #2 working without any new revelations, I’m suspicious that caldav doesn’t work with open calendars. I haven’t seen anyone cite an example of it working without a login, including other similar garbage collection schedules on this site or others. I’ve partially been putting off re-filing a github issue until the openhab development environment issues were sorted out, but also wanted to be sure it was indeed an exception.

I don’t really want to keep flogging a dead horse - especially as it seems so few people are using that horse, but does anyone else have any ideas? I really would like to get this working as it would also include spoken reminders for the garbage day, as well as I would then import the kids’ school schedule to connect to their bedroom lights coming on at the appropriate time to get them going in the morning.

Thanks!

I am struggling with caldav and reading through thousands of posts.
Shouldn’t this above be with caldavio in front:
caldavio:caldavPersonal:usedCalendars=Junk,Recycling,Trash,Tree,School,House
caldavio:caldavCommand:readCalendars=Junk

According to:

Note for openHAB 2

The CalDAV binding is compatible with openHAB 2 just like any other openHAB 1.x binding. There is currently just one bug in the way the configuration file is parsed. Create the configuration file caldavio.cfg with the additional prefix caldavio: . Do the same for caldavCommand.cfg and caldavCommandPersonal.cfg . For more details see the discussion here

EDIT:
I should have read thoroughly: :wink:

caldavPersonal.cfg

caldavPersonal:usedCalendars=caldavio:OH

caldavCommand.cfg

caldavCommand:readCalendars=caldavio:OH

I have seen this as well and deleted old / obsolete stuff

Is this based on OH2 as well? because there seems to be a significant difference.
I am frustrated, too, because there does not seem to be a consistant documentation :frowning: