CalDAV binding stopped working

Hi,

I’m using the CalDAV binding for quite a while now to get notifications from a Google Calendar.
But since a 2 weeks or so it all of a sudden doesn’t refresh the items anymore.

Anybody with a similar problem?

Here, the message in my openhab.log:

2015-11-14 08:24:47.293 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule ‘Set Muell Countdown’: Invalid format: “Undefined”
2015-11-14 08:39:47.405 [INFO ] [org.openhab.model.script.DEBUG] - MuellCal rule started: Undefined

Items-Definition:

// Kalender
String muellCal_next “[%s]” {caldavPersonal=“calendar:muell type:UPCOMING eventNr:1 value:NAME”}
DateTime muellCal_next_Date “[%1$tA, %1$td.%1$tm.%1$tY]” {caldavPersonal=“calendar:muell type:UPCOMING eventNr:1 value:START”}
String muellCal_next2 “[%s]” {caldavPersonal=“calendar:muell type:UPCOMING eventNr:2 value:NAME”}
DateTime muellCal_next_Date2 “[%1$tA, %1$td.%1$tm.%1$tY]” {caldavPersonal=“calendar:muell type:UPCOMING eventNr:2 value:START”}
DateTime Date “[%1$tA, %1$td.%1$tm.%1$tY]” {ntp=“Europe/Berlin:de_DE” }
String muellCal “!!! MORGEN !!! [%s]”

Config:

# Müllkalender
caldavio:muell:url=https://www.google.com/calendar/dav/...
caldavio:muell:username=User
caldavio:muell:password=Password
#caldavio:muell:reloadInterval=1440
caldavio:muell:reloadInterval=360
#caldavio:muell:preloadTime=2880
caldavio:muell:preloadTime=10080
caldavio:muell:disableCertificateVerification=true
caldavio:timeZone=Europe/Berlin
# 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=<calendar-id>
caldavPersonal:usedCalendars=muell

And rule:

// Müllkalender
rule "Set Muell Countdown"
when
	Item Date changed or
	Item muellCal_next_Date changed
then
logInfo("DEBUG", "MuellCal rule started: " + muellCal_next_Date.state.toString)
	var next_date_value = parse(muellCal_next_Date.state.toString).millis
	countdown = (next_date_value - now.millis) / 1000 / 3600
	if (countdown < muellCal_hours) {
		muell_Text = muellCal_next.state.toString
		next_date_value = parse(muellCal_next_Date2.state.toString).millis
		countdown = (next_date_value - now.millis) / 1000 / 3600
		if (countdown < muellCal_hours) {
			muell_Text = muell_Text + " & " + muellCal_next2.state.toString
		}	
		postUpdate(muellCal, muell_Text)		
	} else {
		postUpdate(muellCal, "")
	}
end

No one with a similar problem?

What I also just realised is, that I get the error message every 15 minutes, although I set the reload interval to 6 hours.
Really strange…

No more log entries that the calendar is refreshed and no exception before that?

Not the same, but maybe similar problem:

which calendar implementation are you using?
Ah sorry, owncloud, ok.
Do you have logfiles?
What about the next day, does it works again without a restart?
You have one event which repeats daily at 8:00?

Can you try this as well (version 25.10.): https://github.com/openhab/openhab/wiki/CalDAV
This is the last before i changed from Executors to Quartz.

I am using openHAB 1.7.1, but it shouldn’t be a problem.

Hi querdenker2k, thanks for your reply (and thanks for your work with the binding)!
So far I only have standard logging (no debug) enabled and there are log entries on the first day, each time the number item changes, e.g.:
2015-12-19 08:00:00.731 [INFO ] [o.caldav.internal.job.EventJob] - event BEGIN for: 223B0702-8BDD-4951-B99E-855E1BDF510F(Heizzeit@19.12.2015/08:00-19.12.2015/21:30) 2015-12-19 21:30:00.368 [INFO ] [o.caldav.internal.job.EventJob] - event END for: 223B0702-8BDD-4951-B99E-855E1BDF510F(Heizzeit@19.12.2015/08:00-19.12.2015/21:30)

The event is a separate event for each day, repeating “every week”. On weekdays, it should start at 8:00. After one day however, it does not work anymore. I will change the binding now to the 25.10. and report.

Are there files under openhab-root/etc/caldav?

I am not sure about your question. I am running OpenHAB on a debian (ARM) system. Config file location is /etc/openhab/configurations and program location is /usr/share/openhab. I put the addons in /usr/share/openhab/addons. The owncloud instance is running on a different machine.

etc is not inside the configuration folder so the path should be /usr/share/openhab/etc/caldav. Can you please check if this folder exists and what is inside

Ok, now I see. In etc, there’s a folder with 6D08D4AE-A8C0-4239-A0D6-A180B48F7366.ics inside, and a folder named heizung, inside a number of *.ics files.

Have you installed with a debian package?
There is an ics file directly inside the caldav folder?

Sorry, I hadn’t been notified about your message. I had installed OpenHAB with apt-get, but added most of the add-ons manually. Inside the caldav folder, there’s a folder named “” (without the quotation marks), and inside this there’s one ics file. Furthermore, there’s the folder “heizung” with several ics files inside:
openhab/etc/caldav/<calendar-id>/6D08D4AE-A8C0-4239-A0D6-A180B48F7366.ics openhab/etc/caldav/heizung/*.ics
I have used now the version 24.10. for several days, and it behaves the same, after 24h of changing the number’s value, it ceases to work.

Can you extend the logging and send me the log file. I’m using the same settings, ownCloud server with weekly repeating events. I am confused about the ics file directly inside in the caldav folder. What is inside? Can you send it to me?

I extended the logging and will wait now for 24h to pass. I will then do a cat openhab.log | grep caldav > logfile.log and send the logfile.log to you as personal message, right?
There’s no ics file directly inside the caldav folder, see above message. There’s a folder with the strange name <calendar-id> though. The ics files seem to be correct, formatted like they should be anyhow.

Ah you realy mean “” so i think you have not edited the default settings and started openHAB so the folder has been created. The last modification date of this folder should be old. You can delete this manually.

Yes this is ok, are personal messages possible here?

I thing i got the problem. Can you change the preloadTime to a value higher or equals the maximum repeating time of an item. (In your case it should be one, so 10080, for weekly repeating events)

I’ll try this and report to you. I prepared the log file anyhow, maybe it gives you some extra information.

This was it! The preloadTime at 10080, it works now for two days in a row without an issue! Do I have any limitations through this, I would not think? I am looking forward very much to schedule my heater through the calendar, this is something that has been lacking badly in OpenHAB.

Hi,
just a side question? How did you configure Google with the caldav binding? I’ve tried multiple ways (even trying to setup an API) but without success…what is the way?

Thanks

This is my configuration for testing…

caldavio:openhab_tasks:url=https://www.google.com/calendar/dav/email@gmail.com/events
caldavio:openhab_tasks:username=email@gmail.com
caldavio:openhab_tasks:password=passwort
caldavio:openhab_tasks:reloadInterval=10
caldavio:openhab_tasks:preloadTime=20000
1 Like