CalDav not loading events

Hello all,

i thought i could work a little on my openHAB these days as we are all forced to stay at home but I am little annoyed because of the CalDav Binding is not working as intended :face_with_symbols_over_mouth:. Maybe you could help me a little flattening the curves at home :wink: Let me shortly explain.

I am using the CalDav Binding as well as CalDav Personal to get my calendar items from my Synology NAS DS216+ii. I had several start problems, but somewhen it was working fine and i was able to pull the calender items. I displayed them on the sitemap and worked with them in rules for push messages and lightning at home.

This morning i installed lsof which i required. Therefore i needed to sudo apt-get update && sudo apt-get upgrade && sudo apt-get install lsof which pulled also the new openHAB version 2.5.3-1. After the system was online again, i recognized that the CalDav items are not pulled again. I did a lot to figure out, what was leading to this issue.

I did the following (always checked status in between):

  • Rechecked my caldav*.cfg files in /srv/openhab2-conf/services/
    => all good
  • Deleted all caldav*.config files in /var/lib/openhab2/config/org/openhab/
    => were new created as a copy of the *.cfg files (but no differences to the ones before)
  • Moved the folder /var/lib/openhab2/caldav/ to a _bak to clear the old items (the folder was full with events, from when it was previously working)
  • Raised the log level to TRACE for bindings org.openhab.io.caldav, org.openhab.binding.caldav-personal, org.openhab.binding.caldav-command
  • Restarted the bindings via karaf:
    bundle:restart 230
    bundle:restart 260
    bundle:restart 229
  • Restarted openHAB via sudo systemctl restart openhab2.service
  • Restarted RaspberryPi via sudo shutdown -r now

So nothing at all was pointing me to some root cause or even a starting point where i could start to investigate the problem step by step. I am at the end of my knowledge right now and my mood is at the very bottom.

I would be very thankful if any could give me a hint how to tackle this issue. Thanks in advance,
Patrick

Here are the additional informations:
.
.
.
.
.
.

bundle list from karaf:

openhab> bundle:list | grep -i caldav
229 │ Active │ 80 │ 1.14.0 │ openHAB CalDav Command Binding
230 │ Active │ 80 │ 1.14.0 │ openHAB CalDav Binding
260 │ Active │ 80 │ 1.14.0 │ openHAB CalDav Calendar

The openHAB version is as:

[15:59:25] admin@openhabpi:/var/lib/openhab2/etc$ apt show openhab2 | grep -i version
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Version: 2.5.3-1

During bootup the log was giving NOTHING for caldav except:

[16:14:04] admin@openhabpi:/srv/openhab2-conf$ vi /var/log/openhab2/events.log
2020-03-21 08:42:11.834 [thome.event.ExtensionEvent] - Extension ‘binding-caldav-personal1’ has been installed.
2020-03-21 08:42:11.931 [thome.event.ExtensionEvent] - Extension ‘binding-caldav-command1’ has been installed.
(REMARK: 08:40 was when sudo apt-get update was done)

When i restarted openHAB or rebooted the System it was giving output as:

[16:15:04] admin@openhabpi:/srv/openhab2-conf$ /var/log/openhab2/openhab.log
2020-03-21 13:23:20.982 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘caldav.items’
2020-03-21 13:24:11.303 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘caldav.rules’
2020-03-21 13:25:00.955 [INFO ] [script.RULE: CalDav Next Muellevents] - Rule started
2020-03-21 13:25:00.969 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne1.state: NULL
2020-03-21 13:25:00.972 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne2.state: NULL
2020-03-21 13:25:00.974 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne3.state: NULL
2020-03-21 13:25:00.964 [INFO ] [.eclipse.smarthome.model.script.RULE] - --> Init weather widget condition icon change
2020-03-21 13:25:01.011 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne4.state: NULL
2020-03-21 13:25:01.022 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne5.state: NULL
2020-03-21 13:25:01.027 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne6.state: NULL
2020-03-21 13:25:01.031 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne7.state: NULL
2020-03-21 13:25:01.035 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne8.state: NULL
2020-03-21 13:25:01.039 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne9.state: NULL
2020-03-21 13:25:01.043 [INFO ] [script.RULE: CalDav Next Muellevents] - CalDav_Muelltonne10.state: NULL
2020-03-21 13:25:01.064 [INFO ] [script.RULE: CalDav Next Muellevents] - Keine Muelltonne ist schwarz: FEHLER !!!
2020-03-21 13:25:01.081 [INFO ] [script.RULE: CalDav Next Muellevents] - Keine Muelltonne ist gelb: FEHLER !!!
2020-03-21 13:25:01.099 [INFO ] [script.RULE: CalDav Next Muellevents] - Keine Muelltonne ist blau: FEHLER !!!
2020-03-21 13:25:01.141 [INFO ] [script.RULE: CalDav Next Muellevents] - Keine Muelltonne ist braun: FEHLER !!!
2020-03-21 13:25:01.145 [INFO ] [script.RULE: CalDav Next Muellevents] - Resette ungenutzte Muelldates. Ende der Rule

When i just restarted the bindings it was giving something like

[13:17:04] admin@openhabpi:/srv/openhab2-conf$ /var/log/openhab2/openhab.log
2020-03-21 12:56:52.716 [ERROR] [org.openhab.io.caldav ] - bundle org.openhab.io.caldav:1.14.0 (260)[org.openhab.io.caldav.caldavloader(305)] : Error during instantiation of the imp
java.lang.reflect.InvocationTargetException: null

openhab.log after restarted of caldav bindings

[13:17:04] admin@openhabpi:/srv/openhab2-conf$ /var/log/openhab2/openhab.log
2020-03-21 12:56:52.716 [ERROR] [org.openhab.io.caldav ] - bundle org.openhab.io.caldav:1.14.0 (260)[org.openhab.io.caldav.caldavloader(305)] : Error during instantiation of the imp
java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedConstructorAccessor451.newInstance(Unknown Source) ~[?:?]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_222]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_222]
at org.apache.felix.scr.impl.inject.ComponentConstructor.newInstance(ComponentConstructor.java:309) ~[bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:277) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:982) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:955) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:900) [bundleFile:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [org.eclipse.osgi-3.12.100.jar:?]
at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_222]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) [org.eclipse.osgi-3.12.100.jar:?]
at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:86) [bundleFile:?]
at org.apache.felix.scr.impl.inject.BindParameters.getServiceObject(BindParameters.java:47) [bundleFile:?]
at org.apache.felix.scr.impl.inject.methods.BindMethod.getServiceObject(BindMethod.java:664) [bundleFile:?]
at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2308) [bundleFile:?]
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.prebind(DependencyManager.java:1154) [bundleFile:?]
at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1568) [bundleFile:?]
at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:1029) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:935) [bundleFile:?]
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:900) [bundleFile:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [org.eclipse.osgi-3.12.100.jar:?]
at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_222]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [org.eclipse.osgi-3.12.100.jar:?]
at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) [org.eclipse.osgi-3.12.100.jar:?]
at org.apache.felix.cm.impl.helper.BaseTracker.getRealService(BaseTracker.java:207) [bundleFile:?]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:102) [bundleFile:?]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [bundleFile:?]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1118) [bundleFile:?]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1074) [bundleFile:?]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [bundleFile:?]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [bundleFile:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.lang.IllegalStateException: something went wrong, the loader service should be singleton
at org.openhab.io.caldav.internal.CalDavLoaderImpl.(CalDavLoaderImpl.java:106) ~[?:?]
… 42 more

My caldavCommand.cfg

caldavCommand.cfg
################################ 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)
# readCalendars=<ids from caldav-io>

#caldavCommand:readCalendars=openHAB
caldavCommand:readCalendars=openHAB

This is an excerpt of my caldavio.cfg

caldavio.cfg
################################### CalDAV IO Binding ###################################
#
# Used to connect to Cal DAV.
# Path to the calendar
#<calendarId>:url=

# 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
#<calendarId>:reloadInterval=

# This defines which events are relevant for execution. Unit is in minutes.
# Default is 1 Day (1440 minutes)
#<calendarId>:preloadTime=

# 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

# Es funktioniert NICHT mit:
#caldavio:Muellkalender:url=https://192.168.178.4:5001/caldav/patrick
#caldavio:Muellkalender:url=https://192.168.178.4:5001/homes/patrick/Muellkalender
#caldavio:Muellkalender:url=https://192.168.178.4:38443/caldav.php/patrick/


caldavio:Patrick:url=https://192.168.178.4:5001/caldav/patrick/home/
caldavio:Patrick:username=myuser
caldavio:Patrick:password=mypassword
caldavio:Patrick:reloadInterval=60
caldavio:Patrick:preloadTime=44640
caldavio:Patrick:disableCertificateVerification=true

caldavio:Muellkalender:url=https://192.168.178.4:5001/caldav/patrick/abcdef/
caldavio:Muellkalender:username=myuser
caldavio:Muellkalender:password=mypassword
caldavio:Muellkalender:reloadInterval=5
caldavio:Muellkalender:preloadTime=44640
caldavio:Muellkalender:disableCertificateVerification=true

caldavio:openHAB:url=https://192.168.178.4:5001/caldav/patrick/xyzxyz/
caldavio:openHAB:username=myuser
caldavio:openHAB:password=mypassword
caldavio:openHAB:reloadInterval=15
caldavio:openHAB:preloadTime=44640
caldavio:openHAB:disableCertificateVerification=true

My caldavPersonal.cfg

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=Muellkalender,Patrick,NiPaRa
caldavPersonal:usedCalendars=Muellkalender,Patrick

This is an excerpt of my home.sitemap

home.sitemap
    // Kalender 
    Frame label="Kalender" {
        Text item=CalDav_Muelltonne1
        Text item=CalDav_MuellDate1
        Default item=CalDav_Patrick
        Default item=CalDav_PatrickDate
    }

This is an excerpt of my caldav.items

caldav.items
/* Müllkalender */
Group			gCalDavMuell
String		CalDav_Muelltonne1				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:1 value:NAME"}
DateTime	CalDav_MuellDate1					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:1 value:START"}
String		CalDav_Muelltonne2				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:2 value:NAME"}
DateTime	CalDav_MuellDate2					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:2 value:START"}
String		CalDav_Muelltonne3				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:3 value:NAME"}
DateTime	CalDav_MuellDate3					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:3 value:START"}
String		CalDav_Muelltonne4				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:4 value:NAME"}
DateTime	CalDav_MuellDate4					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:4 value:START"}
String		CalDav_Muelltonne5				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:5 value:NAME"}
DateTime	CalDav_MuellDate5					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:5 value:START"}
String		CalDav_Muelltonne6				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:6 value:NAME"}
DateTime	CalDav_MuellDate6					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:6 value:START"}
String		CalDav_Muelltonne7				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:7 value:NAME"}
DateTime	CalDav_MuellDate7					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:7 value:START"}
String		CalDav_Muelltonne8				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:8 value:NAME"}
DateTime	CalDav_MuellDate8					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:8 value:START"}
String		CalDav_Muelltonne9				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:9 value:NAME"}
DateTime	CalDav_MuellDate9					"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:9 value:START"}
String		CalDav_Muelltonne10				"Tonne [%s]"															<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:10 value:NAME"}
DateTime	CalDav_MuellDate10				"Datum der Abholung [%1$td.%1$tm.%1$tY]"	<calendar>	(gCalDavMuell)		{caldavPersonal="calendar:Muellkalender type:EVENT eventNr:10 value:START"}
// generic items
String		CalDav_externalTrigger																													(gCalDavMuell)
String		CalDav_MuellTypeSelect1
String		CalDav_MuellTypeSelect2
String		CalDav_MuellTypeSelect3
String		CalDav_MuellTypeSelect4
String		CalDav_MuellTypeSelect5
String		CalDav_MuellTypeSelect6
String		CalDav_MuellTypeSelect7
String		CalDav_MuellTypeSelect8
String		CalDav_MuellTypeSelect9
String		CalDav_MuellTypeSelect10
DateTime	CalDav_MuellDateSelect1
DateTime	CalDav_MuellDateSelect2
DateTime	CalDav_MuellDateSelect3
DateTime	CalDav_MuellDateSelect4
DateTime	CalDav_MuellDateSelect5
DateTime	CalDav_MuellDateSelect6
DateTime	CalDav_MuellDateSelect7
DateTime	CalDav_MuellDateSelect8
DateTime	CalDav_MuellDateSelect9
DateTime	CalDav_MuellDateSelect10
//DateTime	date_today				"Heute [%1$td.%1$tm.%1$tY]"								<calendar>			{channel="ntp:ntp:local:dateTime"}
String		CalDav_Patrick						"Patrick [%s]"														<calendar>										{caldavPersonal="calendar:Patrick type:EVENT eventNr:1 value:NAME"}
DateTime	CalDav_PatrickDate				"[%1$td.%1$tm.%1$tY %1$tH:%1$tM]"					<none>										{caldavPersonal="calendar:Patrick type:EVENT eventNr:1 value:START"}

This is an excerpt of my caldav.rules:

caldav.rules
rule "Next Muellevents"
when
  Member of gCalDavMuell changed or
  System started
then

  logInfo("RULE: CalDav Next Muellevents", "Rule started")    
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne1.state: " + CalDav_Muelltonne1.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne2.state: " + CalDav_Muelltonne2.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne3.state: " + CalDav_Muelltonne3.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne4.state: " + CalDav_Muelltonne4.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne5.state: " + CalDav_Muelltonne5.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne6.state: " + CalDav_Muelltonne6.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne7.state: " + CalDav_Muelltonne7.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne8.state: " + CalDav_Muelltonne8.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne9.state: " + CalDav_Muelltonne9.state)
  logInfo("RULE: CalDav Next Muellevents", "CalDav_Muelltonne10.state: " + CalDav_Muelltonne10.state)
  
  // Variablendeklaration
  val String gelb="Gelbe Tonne / Container in XYZ"
  val String schwarz="Restmülltonne 2-wöchentliche Leerung in XYZ"
  val String braun="Biotonne in XYZ"
  val String blau="Papiertonne / Container in XYZ"

  var Boolean MuellSchwarz=false
  var Boolean MuellGelb=false
  var Boolean MuellBlau=false
  var Boolean MuellBraun=false

  var Boolean Select1=false
  var Boolean Select2=false
  var Boolean Select3=false
  var Boolean Select4=false
  var Boolean Select5=false
  var Boolean Select6=false
  var Boolean Select7=false
  var Boolean Select8=false
  var Boolean Select9=false
  var Boolean Select10=false

  // Set Restmuell (black)
  if ((CalDav_Muelltonne1.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect1.postUpdate(CalDav_MuellDate1.state)
    CalDav_MuellTypeSelect1.postUpdate(CalDav_Muelltonne1.state)
    MuellSchwarz=true
    Select1=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne1 ist schwarz")    
  } else if ((CalDav_Muelltonne2.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect2.postUpdate(CalDav_MuellDate2.state)
    CalDav_MuellTypeSelect2.postUpdate(CalDav_Muelltonne2.state)
    MuellSchwarz=true
    Select2=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne2 ist schwarz")    
  } else if ((CalDav_Muelltonne3.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect3.postUpdate(CalDav_MuellDate3.state)
    CalDav_MuellTypeSelect3.postUpdate(CalDav_Muelltonne3.state)
    MuellSchwarz=true
    Select3=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne3 ist schwarz")    
  } else if ((CalDav_Muelltonne4.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect4.postUpdate(CalDav_MuellDate4.state)
    CalDav_MuellTypeSelect4.postUpdate(CalDav_Muelltonne4.state)
    MuellSchwarz=true
    Select4=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne4 ist schwarz")    
  } else if ((CalDav_Muelltonne5.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect5.postUpdate(CalDav_MuellDate5.state)
    CalDav_MuellTypeSelect5.postUpdate(CalDav_Muelltonne5.state)
    MuellSchwarz=true
    Select5=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne5 ist schwarz")    
  } else if ((CalDav_Muelltonne6.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect6.postUpdate(CalDav_MuellDate6.state)
    CalDav_MuellTypeSelect6.postUpdate(CalDav_Muelltonne6.state)
    MuellSchwarz=true
    Select6=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne6 ist schwarz")    
  } else if ((CalDav_Muelltonne7.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect7.postUpdate(CalDav_MuellDate7.state)
    CalDav_MuellTypeSelect7.postUpdate(CalDav_Muelltonne7.state)
    MuellSchwarz=true
    Select7=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne7 ist schwarz")    
  } else if ((CalDav_Muelltonne8.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect8.postUpdate(CalDav_MuellDate8.state)
    CalDav_MuellTypeSelect8.postUpdate(CalDav_Muelltonne8.state)
    MuellSchwarz=true
    Select8=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne8 ist schwarz")    
  } else if ((CalDav_Muelltonne9.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect9.postUpdate(CalDav_MuellDate9.state)
    CalDav_MuellTypeSelect9.postUpdate(CalDav_Muelltonne9.state)
    MuellSchwarz=true
    Select9=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne9 ist schwarz")    
  } else if ((CalDav_Muelltonne10.state == schwarz) && (MuellSchwarz == false)) {
    CalDav_MuellDateSelect10.postUpdate(CalDav_MuellDate10.state)
    CalDav_MuellTypeSelect10.postUpdate(CalDav_Muelltonne10.state)
    MuellSchwarz=true
    Select10=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne10 ist schwarz")    
  } else {
    logInfo("RULE: CalDav Next Muellevents", "Keine Muelltonne ist schwarz: FEHLER !!!!")
  }

  // Set Gelbe Tonne (gelb)
  if ((CalDav_Muelltonne1.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect1.postUpdate(CalDav_MuellDate1.state)
    CalDav_MuellTypeSelect1.postUpdate(CalDav_Muelltonne1.state)
    MuellGelb=true
    Select1=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne1 ist gelb")    
  } else if ((CalDav_Muelltonne2.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect2.postUpdate(CalDav_MuellDate2.state)
    CalDav_MuellTypeSelect2.postUpdate(CalDav_Muelltonne2.state)
    MuellGelb=true
    Select2=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne2 ist gelb")    
  } else if ((CalDav_Muelltonne3.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect3.postUpdate(CalDav_MuellDate3.state)
    CalDav_MuellTypeSelect3.postUpdate(CalDav_Muelltonne3.state)
    MuellGelb=true
    Select3=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne3 ist gelb")    
  } else if ((CalDav_Muelltonne4.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect4.postUpdate(CalDav_MuellDate4.state)
    CalDav_MuellTypeSelect4.postUpdate(CalDav_Muelltonne4.state)
    MuellGelb=true
    Select4=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne4 ist gelb")    
  } else if ((CalDav_Muelltonne5.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect5.postUpdate(CalDav_MuellDate5.state)
    CalDav_MuellTypeSelect5.postUpdate(CalDav_Muelltonne5.state)
    MuellGelb=true
    Select5=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne5 ist gelb")    
  } else if ((CalDav_Muelltonne6.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect6.postUpdate(CalDav_MuellDate6.state)
    CalDav_MuellTypeSelect6.postUpdate(CalDav_Muelltonne6.state)
    MuellGelb=true
    Select6=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne6 ist gelb")    
  } else if ((CalDav_Muelltonne7.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect7.postUpdate(CalDav_MuellDate7.state)
    CalDav_MuellTypeSelect7.postUpdate(CalDav_Muelltonne7.state)
    MuellGelb=true
    Select7=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne7 ist gelb")    
  } else if ((CalDav_Muelltonne8.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect8.postUpdate(CalDav_MuellDate8.state)
    CalDav_MuellTypeSelect8.postUpdate(CalDav_Muelltonne8.state)
    MuellGelb=true
    Select8=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne8 ist gelb")    
  } else if ((CalDav_Muelltonne9.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect9.postUpdate(CalDav_MuellDate9.state)
    CalDav_MuellTypeSelect9.postUpdate(CalDav_Muelltonne9.state)
    MuellGelb=true
    Select9=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne9 ist gelb")    
  } else if ((CalDav_Muelltonne10.state == gelb) && (MuellGelb == false)) {
    CalDav_MuellDateSelect10.postUpdate(CalDav_MuellDate10.state)
    CalDav_MuellTypeSelect10.postUpdate(CalDav_Muelltonne10.state)
    MuellGelb=true
    Select10=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne10 ist gelb")    
  } else {
    logInfo("RULE: CalDav Next Muellevents", "Keine Muelltonne ist gelb: FEHLER !!!!")
  }

  // Set Papier (gelb)
  if ((CalDav_Muelltonne1.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect1.postUpdate(CalDav_MuellDate1.state)
    CalDav_MuellTypeSelect1.postUpdate(CalDav_Muelltonne1.state)
    MuellBlau=true
    Select1=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne1 ist blau")    
  } else if ((CalDav_Muelltonne2.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect2.postUpdate(CalDav_MuellDate2.state)
    CalDav_MuellTypeSelect2.postUpdate(CalDav_Muelltonne2.state)
    MuellBlau=true
    Select2=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne2 ist blau")    
  } else if ((CalDav_Muelltonne3.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect3.postUpdate(CalDav_MuellDate3.state)
    CalDav_MuellTypeSelect3.postUpdate(CalDav_Muelltonne3.state)
    MuellBlau=true
    Select3=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne3 ist blau")    
  } else if ((CalDav_Muelltonne4.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect4.postUpdate(CalDav_MuellDate4.state)
    CalDav_MuellTypeSelect4.postUpdate(CalDav_Muelltonne4.state)
    MuellBlau=true
    Select4=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne4 ist blau")    
  } else if ((CalDav_Muelltonne5.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect5.postUpdate(CalDav_MuellDate5.state)
    CalDav_MuellTypeSelect5.postUpdate(CalDav_Muelltonne5.state)
    MuellBlau=true
    Select5=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne5 ist blau")    
  } else if ((CalDav_Muelltonne6.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect6.postUpdate(CalDav_MuellDate6.state)
    CalDav_MuellTypeSelect6.postUpdate(CalDav_Muelltonne6.state)
    MuellBlau=true
    Select6=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne6 ist blau")    
  } else if ((CalDav_Muelltonne7.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect7.postUpdate(CalDav_MuellDate7.state)
    CalDav_MuellTypeSelect7.postUpdate(CalDav_Muelltonne7.state)
    MuellBlau=true
    Select7=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne7 ist blau")    
  } else if ((CalDav_Muelltonne8.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect8.postUpdate(CalDav_MuellDate8.state)
    CalDav_MuellTypeSelect8.postUpdate(CalDav_Muelltonne8.state)
    MuellBlau=true
    Select8=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne8 ist blau")    
  } else if ((CalDav_Muelltonne9.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect9.postUpdate(CalDav_MuellDate9.state)
    CalDav_MuellTypeSelect9.postUpdate(CalDav_Muelltonne9.state)
    MuellBlau=true
    Select9=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne9 ist blau")    
  } else if ((CalDav_Muelltonne10.state == blau) && (MuellBlau == false)) {
    CalDav_MuellDateSelect10.postUpdate(CalDav_MuellDate10.state)
    CalDav_MuellTypeSelect10.postUpdate(CalDav_Muelltonne10.state)
    MuellBlau=true
    Select10=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne10 ist blau")    
  } else {
    logInfo("RULE: CalDav Next Muellevents", "Keine Muelltonne ist blau: FEHLER !!!!")
  }

  // Set Biomuell (braun)
  if ((CalDav_Muelltonne1.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect1.postUpdate(CalDav_MuellDate1.state)
    CalDav_MuellTypeSelect1.postUpdate(CalDav_Muelltonne1.state)
    MuellBraun=true
    Select1=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne1 ist braun")    
  } else if ((CalDav_Muelltonne2.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect2.postUpdate(CalDav_MuellDate2.state)
    CalDav_MuellTypeSelect2.postUpdate(CalDav_Muelltonne2.state)
    MuellBraun=true
    Select2=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne2 ist braun")    
  } else if ((CalDav_Muelltonne3.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect3.postUpdate(CalDav_MuellDate3.state)
    CalDav_MuellTypeSelect3.postUpdate(CalDav_Muelltonne3.state)
    MuellBraun=true
    Select3=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne3 ist braun")    
  } else if ((CalDav_Muelltonne4.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect4.postUpdate(CalDav_MuellDate4.state)
    CalDav_MuellTypeSelect4.postUpdate(CalDav_Muelltonne4.state)
    MuellBraun=true
    Select4=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne4 ist braun")    
  } else if ((CalDav_Muelltonne5.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect5.postUpdate(CalDav_MuellDate5.state)
    CalDav_MuellTypeSelect5.postUpdate(CalDav_Muelltonne5.state)
    MuellBraun=true
    Select5=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne5 ist braun")    
  } else if ((CalDav_Muelltonne6.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect6.postUpdate(CalDav_MuellDate6.state)
    CalDav_MuellTypeSelect6.postUpdate(CalDav_Muelltonne6.state)
    MuellBraun=true
    Select6=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne6 ist braun")    
  } else if ((CalDav_Muelltonne7.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect7.postUpdate(CalDav_MuellDate7.state)
    CalDav_MuellTypeSelect7.postUpdate(CalDav_Muelltonne7.state)
    MuellBraun=true
    Select7=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne7 ist braun")    
  } else if ((CalDav_Muelltonne8.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect8.postUpdate(CalDav_MuellDate8.state)
    CalDav_MuellTypeSelect8.postUpdate(CalDav_Muelltonne8.state)
    MuellBraun=true
    Select8=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne8 ist braun")    
  } else if ((CalDav_Muelltonne9.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect9.postUpdate(CalDav_MuellDate9.state)
    CalDav_MuellTypeSelect9.postUpdate(CalDav_Muelltonne9.state)
    MuellBraun=true
    Select9=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne9 ist braun")    
  } else if ((CalDav_Muelltonne10.state == braun) && (MuellBraun == false)) {
    CalDav_MuellDateSelect10.postUpdate(CalDav_MuellDate10.state)
    CalDav_MuellTypeSelect10.postUpdate(CalDav_Muelltonne10.state)
    MuellBraun=true
    Select10=true
    logInfo("RULE: CalDav Next Muellevents", "Muelltonne10 ist braun")    
  } else {
    logInfo("RULE: CalDav Next Muellevents", "Keine Muelltonne ist braun: FEHLER !!!!")
  }

  // Reset values, which are not used anymore
    logInfo("RULE: CalDav Next Muellevents", "Resette ungenutzte Muelldates. Ende der Rule")    
  if (!Select1) {
    CalDav_MuellDateSelect1.postUpdate(NULL)
    CalDav_MuellTypeSelect1.postUpdate(NULL)
  }
  if (!Select2) {
    CalDav_MuellDateSelect2.postUpdate(NULL)
    CalDav_MuellTypeSelect2.postUpdate(NULL)
  }
  if (!Select3) {
    CalDav_MuellDateSelect3.postUpdate(NULL)
    CalDav_MuellTypeSelect3.postUpdate(NULL)
  }
  if (!Select4) {
    CalDav_MuellDateSelect4.postUpdate(NULL)
    CalDav_MuellTypeSelect4.postUpdate(NULL)
  }
  if (!Select5) {
    CalDav_MuellDateSelect5.postUpdate(NULL)
    CalDav_MuellTypeSelect5.postUpdate(NULL)
  }
  if (!Select6) {
    CalDav_MuellDateSelect6.postUpdate(NULL)
    CalDav_MuellTypeSelect6.postUpdate(NULL)
  }
  if (!Select7) {
    CalDav_MuellDateSelect7.postUpdate(NULL)
    CalDav_MuellTypeSelect7.postUpdate(NULL)
  }
  if (!Select8) {
    CalDav_MuellDateSelect8.postUpdate(NULL)
    CalDav_MuellTypeSelect8.postUpdate(NULL)
  }
  if (!Select9) {
    CalDav_MuellDateSelect9.postUpdate(NULL)
    CalDav_MuellTypeSelect9.postUpdate(NULL)
  }
  if (!Select10) {
    CalDav_MuellDateSelect10.postUpdate(NULL)
    CalDav_MuellTypeSelect10.postUpdate(NULL)
  }
end

P.S.: To make it even worse: When i did the output of the karaf bundle:list for this topic here, i detected in the afternoon, that the status was Resolved. I did then a bundle:start 260 for all bindings at it started working again! I don’t know what it was now and why it is running again. My careful doubts are, that it was the cleanup of the /var/lib/openhab2/caldav/plus the restart of the caldavio binding. Please please please help me out with this!

P.P.S.: When i want to restart all caldav bindings, which is the right order? first caldavio, then caldavPersonal and then caldavCommand?

caldavio first. The order of the other two don’t matter.

Ay luck here?

I am trying to set get caldav working again with google calendar and am struggling with poor documentation or me being too stupid to understand it!

For me it is somehow working again without doing anything. With google calendar, the documentation is quite good. Where are your problems? Can you specify it a little more in detail?