I’m using caldav for my garbage-calendar. Sometimes it does work and mostly not.
I’ve tried version 1.8 and now version 1.12 but stil get errrors in the log:
2018-08-14 13:35:50.556 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.caldav-personal-1.12.0.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.caldav-personal [257]
Unresolved requirement: Import-Package: org.openhab.io.caldav
at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]
If you have tried two version it may help to check that you don’t have stale caldav config files in: /var/lib/openhab2/config/org/openhab and make sure that you have specified the calendar to use in: caldavpersonal.cfg
Or do it manually, stop openhab then delete whats in cache and temp file, not the actual files just whats inside.
If your still having the issue, please post your openhab info. What version of openhab, what your running openhab on and how you installed and set the log to DEBUG or TRACE to help provide more info for troubleshooting.
Thanks
Well, I did ask for DEBUG info. Just not on the entire server. You might want to remove that link to your logs…ASAP…TMI
When debugging its best to debug only what your having an issue with, else your eyes start to bleed reading thru it all. I didn’t look at everything but I did see (as your original post shows) an issue with caldav-personal. So try this:
Create a cfg file: sudo nano /etc/openhab2/services/caldavPersonal.cfg
and place this inside then save: caldavPersonal:usedCalendars=Afvalkalender
You can test, but most likely need an addition cfg file like:
sudo nano /etc/openhab2/services/caldavCommand.cfg
and place this inside and save: caldavCommand:readCalendars=Afvalkalender
Shouldn’t have issues with permissions but check if still having problems.
Hope this helps.
2018-08-14 22:55:17.987 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.caldav-personal-1.12.0.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.caldav-personal [252]
Unresolved requirement: Import-Package: org.openhab.io.caldav
at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [9:org.apache.felix.fileinstall:3.6.4]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [9:org.apache.felix.fileinstall:3.6.4]
I just installed the caldav-command binding with the jar-file but I get the same error
I started up another server with openhab and installed the caldav as you described and received the same errors. The missing file needed can be found here:
You need to install the org.openhab.io.caldav/1.12.0.jar file (9th one from the top). Install this in /usr/share/openhab2/addons folder then: sudo /etc/init.d/openhab2 restart
Good deal, glad to see its working. If you would, click the box on the post I sent with the link to the org.openhab.io.caldav/1.12.0.jar file (post #12 I think it was). This will help others with similar issues find the solution faster. Thanks
I got an error from the rule but I didn’t change the rule. Last time it worked:
2018-08-15 14:35:28.287 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Afvalcontainer.rules' is either empty or cannot be parsed correctly!
2018-08-15 14:35:30.076 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Afvalcontainer.rules' has errors, therefore ignoring it: [51,1]: no viable alternative at input
and this is my rule. I looked into it with vs code but no errors:
rule "Tage bis Abfall berechnen"
when
Time cron "0 5 * 1/1 * ? *" or
Item Restmuell changed or
Item Biomuell changed or
Item Papiermuell changed
then
logInfo("all.rules", "Tage bis Abfall berechnen")
//Restmuell
val DateTime varRestmuellDatum = new DateTime((Restmuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
val Long varRestmuellDiff = Math::round((varRestmuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
if ( varRestmuellDiff == 0 ) {
RestmuellTage.postUpdate("vandaag")
} else if ( varRestmuellDiff == 1 ) {
RestmuellTage.postUpdate("morgen")
} else {
RestmuellTage.postUpdate(String::format("(%1$d T.)", varRestmuellDiff))
}
//Biomuell
val DateTime varBiomuellDatum = new DateTime((Biomuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
val Long varBiomuellDiff = Math::round((varBiomuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
if ( varBiomuellDiff == 0 ) {
BiomuellTage.postUpdate("vandaag")
} else if ( varBiomuellDiff == 1 ) {
BiomuellTage.postUpdate("morgen")
} else {
BiomuellTage.postUpdate(String::format("(%1$d T.)", varBiomuellDiff))
}
//Papiermuell
val DateTime varPapiermuellDatum = new DateTime((Papiermuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli).withTimeAtStartOfDay
val Long varPapiermuellDiff = Math::round((varPapiermuellDatum.millis - now.withTimeAtStartOfDay.millis) / (86400000.0))
if ( varPapiermuellDiff == 0 ) {
PapiermuellTage.postUpdate("vandaag")
} else if ( varPapiermuellDiff == 1 ) {
PapiermuellTage.postUpdate("morgen")
} else {
PapiermuellTage.postUpdate(String::format("(%1$d T.)", varPapiermuellDiff))
}
end
rule "Abfalltermine sortieren"
when
Item Restmuell received update or
Item Biomuell received update or
Item Papiermuell received update or
Item RestmuellTage changed or
Item PapiermuellTage changed or
Item BiomuellTage changed or
//Time cron "0 8 0 1/1 * ? *" or
then
Thread::sleep(3000)
var DateTime varTempDatum
var DateTime varAbfall1Datum = new DateTime((Restmuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
var DateTime varAbfall2Datum = new DateTime((Biomuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
var DateTime varAbfall3Datum = new DateTime((Papiermuell.state as DateTimeType).zonedDateTime.toInstant.toEpochMilli)
var String varTempArt
var String varAbfall1Art = "Restafval"
var String varAbfall2Art = "Groenafval"
var String varAbfall3Art = "Plasticafval"
var String varTempTage
var String varAbfall1Tage = RestmuellTage.state.toString
var String varAbfall2Tage = BiomuellTage.state.toString
var String varAbfall3Tage = PapiermuellTage.state.toString
var i = 1
while ((i=i+1) < 6) {
if (varAbfall1Datum > varAbfall2Datum) {
varTempDatum = varAbfall1Datum
varAbfall1Datum = varAbfall2Datum
varAbfall2Datum = varTempDatum
varTempArt = varAbfall1Art
varAbfall1Art = varAbfall2Art
varAbfall2Art = varTempArt
varTempTage = varAbfall1Tage
varAbfall1Tage = varAbfall2Tage
varAbfall2Tage = varTempTage
if (varAbfall2Datum > varAbfall3Datum) {
varTempDatum = varAbfall2Datum
varAbfall2Datum = varAbfall3Datum
varAbfall3Datum = varTempDatum
varTempArt = varAbfall2Art
varAbfall2Art = varAbfall3Art
varAbfall3Art = varTempArt
varTempTage = varAbfall2Tage
varAbfall2Tage = varAbfall3Tage
varAbfall3Tage = varTempTage
}
}
if (varAbfall2Datum > varAbfall3Datum) {
varTempDatum = varAbfall2Datum
varAbfall2Datum = varAbfall3Datum
varAbfall3Datum = varTempDatum
varTempArt = varAbfall2Art
varAbfall2Art = varAbfall3Art
varAbfall3Art = varTempArt
varTempTage = varAbfall2Tage
varAbfall2Tage = varAbfall3Tage
varAbfall3Tage = varTempTage
}
}
Abfall_1_Datum.postUpdate(varAbfall1Datum.toString)
Abfall_2_Datum.postUpdate(varAbfall2Datum.toString)
Abfall_3_Datum.postUpdate(varAbfall3Datum.toString)
Abfall_1_Art.postUpdate(varAbfall1Art)
Abfall_2_Art.postUpdate(varAbfall2Art)
Abfall_3_Art.postUpdate(varAbfall3Art)
Abfall_1_Tage.postUpdate(varAbfall1Tage)
Abfall_2_Tage.postUpdate(varAbfall2Tage)
Abfall_3_Tage.postUpdate(varAbfall3Tage)
end
rule "Abfall steht an - Blinkeding"
when
Time cron "0 0 17 1/1 * ? *"
then
if (Abfall_1_Tage.state.toString == "morgen") {
Abfall_Steht_An.postUpdate(ON)
}
end
rule "Abfall steht an - Informiere Jochen"
when
Time cron "0 30 20 1/1 * ? *"
then
if ((Abfall_Steht_An.state == ON) && (Abfall_1_Art != "RaWeg")) {
sendTelegram("jeroen", "%s moet je nog aan straat zetten", Abfall_1_Art.state.toString)
}
end
rule "Abfall steht an - Informiere -Frau- und Jochen"
when
Time cron "0 30 21 1/1 * ? *"
then
if ((Abfall_Steht_An.state == ON) && (Abfall_1_Art != "RaWeg")) {
sendTelegram("jeroen", "Oh oh staat het %s nog niet buiten!", Abfall_1_Art.state.toString)
sendTelegram("thuis", "%s staat nog steeds niet buiten", Abfall_1_Art.state.toString)
}
end
With all the file changing you might need to do this step again. You can change the last part from sudo reboot to sudo restart if you prefer not rebooting.
rule "Abfalltermine sortieren"
when
Item Restmuell received update or
Item Biomuell received update or
Item Papiermuell received update or
Item RestmuellTage changed or
Item PapiermuellTage changed or
Item BiomuellTage changed or
//Time cron "0 8 0 1/1 * ? *" or
then
Thread::sleep(3000)
var DateTime varTempDatum
Also need to remove the “or” at the end of the “Item BiomuellTage changed” in your second rule.