New CalDAV Binding available

Oh ok,
I think i fixed it, but i will test it tomorrow.
The new build is another binding, which does not resolve this problem.
I will send you an update tomorrow.

Great, thanks!

HI

Iā€™ve got this binding working yesterday and have to say it looks quite good.
But there seems to be one issue with the personal binding which makes the intended use a lot harder than it should be. Let me explain: Iā€™ve created an appointment serie to start my alarm clock as I usually get up every day at the same time. Now Iā€™ve changed the time of one element of the serie to a later time as I would sleep longer that day. What happened now is that I get both appointements for the day, the one from the orignal serie and the changed one (at least thatā€™s what the logfile says, personally, due to time, Iā€™ve only seen the orignal one in Openhab)

This was just the result of a short test yesterday evening, I didnā€™t try the command binding yet but woud expect the same problem there.

Can you please have a look at it? Iā€™m using the ā€œofficalā€ 1.8.0 version from Jenkins (#178) (https://openhab-ci.innoq.io/jenkins/job/openhab-1/org.openhab.binding$org.openhab.binding.caldav-personal/) and use a baikal server.

If you have any other questions, please feel free to post me a message

Thanks & Regards
Dieter

BTW: I my IOS calendar app, the appointment is displayed correctlyā€¦

Can you try setting this to false

# A caldav Server is just a webdav Server which list files. Some servers does not use the valid timestamp for modifications.
# If your calendar does not provide correct timestamps you have to set this false.
# Default is true
# caldavio:<calendarId>:lastModifiedFileTimeStampValid=

http://speedy.sh/cj5sT/org.openhab.persistence.caldav-1.8.0-SNAPSHOT.jar
http://speedy.sh/9vMhf/org.openhab.binding.caldav-command-1.8.0-SNAPSHOT.jar

New version for fixed persistence with futureOffset. I made a simple test and it works.

1 Like

@querdenker2k Thanks for the update. I think this time it is working, but Iā€™m seeing the following error in my logs:

2016-01-10 18:05:41.474 [ERROR] [o.o.i.c.i.job.EventReloaderJob] - error while loading calendar entries: null
java.lang.NullPointerException: null
        at org.openhab.io.caldav.internal.CalDavLoaderImpl.loadEvents(CalDavLoaderImpl.java:484) ~[na:na]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:108) ~[na:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-all-2.1.7.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:na]
2016-01-10 18:05:41.481 [INFO ] [org.quartz.core.JobRunShell   ] - Job event-reloader.openhab threw a JobExecutionException:
org.quartz.JobExecutionException: error while loading calendar entries
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:126) ~[na:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) ~[quartz-all-2.1.7.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:na]
Caused by: java.lang.NullPointerException: null
        at org.openhab.io.caldav.internal.CalDavLoaderImpl.loadEvents(CalDavLoaderImpl.java:484) ~[na:na]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:108) ~[na:na]
        ... 2 common frames omitted

I suspect this may be happening because I deleted all the old .ics files from /etc/caldav/openhab and also deleted the old calendar, so that I could start afresh. Is there anything I can do to fix this?

But itā€™s working now?
Does this happens at the start and then no more errors occur?
Or does this

caldav-persistence:calendarId=openhab

does not match to a configure caldav entry?

The binding is working in that it is creating events 14 days ahead in the calendar correctly. I havenā€™t tested the simulation mode yet, but will do so.

The error above is still happening though every 10 minutes or so. The calendarID in caldav-persistence:calendarId=openhab does correctly match the caldav calendar.

which version of the caldav-io do you have? Itā€™s not an nightly snapshot right?

I was originally using an older org.openhab.io.caldav-1.8.0-SNAPSHOT.jar, I think from one of the previous nightlys towards the end of December. However, since 1.8 was officially released, Iā€™ve been using the caldav-io from this, but the error remains. It seems very regular and similar:

2016-01-15 14:38:07.057 [ERROR] [o.o.i.c.i.job.EventReloaderJob] - error while loading calendar entries: null
java.lang.NullPointerException: null
        at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:244) ~[na:na]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:118) ~[na:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) [quartz-all-2.1.7.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:na]
2016-01-15 14:38:07.059 [INFO ] [org.quartz.core.JobRunShell   ] - Job event-reloader.openhab threw a JobExecutionException:
org.quartz.JobExecutionException: error while loading calendar entries
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:136) ~[na:na]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213) ~[quartz-all-2.1.7.jar:na]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) [quartz-all-2.1.7.jar:na]
Caused by: java.lang.NullPointerException: null
        at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:244) ~[na:na]
        at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:118) ~[na:na]
        ... 2 common frames omitted

Yes its the same error, but another codeline.
Can you see a logentry on which event the loading failed?
Can you try setting this ā€œlastModifiedFileTimeStampValidā€ to false.
Is this calendar on which the error occurs just read via caldav or does the persistence write entry to this as well?

The calendar in question is used for persistence writing. However, adding lastModifiedFileTimeStampValid=false seems to have resolved the issue - the regular error messages have stopped.

Thanks for all your help!

@querdenker2k Thank you for the binding.

It works with OH1.8 release, but the persistence does not put an entry into the calender in the future. With the snapshot it works. The activities are in CalDav with the offset.

I donā€™t understand how I could activate and deactivate the presence simulation.

Could some one please post a sample ?

Thanks for your help.
Richard

Hi @querdenker2k

Sorry for the late reply, I wasnā€™t at home so I couldnā€™t try.

The bad news is that it didnā€™t help, I still get the 2 events (really got both in OH, the original one of the series and the modified one). The not-so-bad news is, that it works with single events (even without your suggested change), so when you create an event (no series), wait until itā€™s loaded and you can move it to another time and it will get updated in Openhab.

What Iā€™m going to try is whether or not it works when I change the time of a series element before itā€™s loaded. When that works I will reduce the preload time for this calendar and have a useable workaround.

Regards
Dieter

Hi,
no, this will not work as well.
I am using a framework to calculate the reccurance and there is this not implemented. It should work if you remove a single event and create a new one for this, i think.
I will look for another framework.

The feature with the offset was implemented after the 1.8 release.
If you want to disable/enable the presence simulation, you have to create an item like this

Switch        Livingroom_Temperature_Set_Disable    "Temperatur Wohnzimmer Auto Deaktiviert"    (Livingroom, Heater)                { caldavCommand="itemName:Livingroom_Temperature_Set type:DISABLE" }

The Item you which to disable must be an Group Item where all Items are inside. But this works as well just with the uploaded caldav-command snapshot.

@querdenker2k

Sorry, I donā€™t understand what you are meaning. Iā€™m not a programmer and so I have some difficulties to understand.

I have some light switches in a group gPS which should be operated with the presencesimulation. I have an other switch to start / stop the execution of the calendar entries.
The simulation is working, I can operate the switches and the events are stored in the calendar with the defined offset and executed at the predefined date/time and again stored with the offset. But I canā€™t disable the simulation with my switch.

My Items file:

// Gruppen

Group All
Group gPS                    "Anwesenheitssimulation"    (All)                                                        // Gruppe mit Elementen fĆ¼r Anwesenheitssimulation
Group gOG                    "Obergeschoss"              (All)                                                        // Gruppe mit Lampen Obergeschoss
Group gST                    "Steuerung"                 (All)                                                        // Gruppe mit Scjhaltern fĆ¼r Steuerungsfunktionen

/*Schalter*/
Switch Licht_Buero           "BĆ¼ro"                      (gOG, gPS)   {zwave="4:0:command=switch_binary"}             //    Licht BĆ¼ro
Switch Licht_Schlafzimmer    "Schlafzimmer rechts"       (gOG)        {zwave="12:0:command=switch_binary"}            //    Licht Schlafzimmer oben rechts
Switch Licht_Gaestezimmer    "GƤstezimmer"               (gOG, gPS)   {zwave="15:command=switch_binary"}              //    Licht GƤstezimmer

Switch PresenceSimulation    "Anwesenheitssimulation"    (gST)        {caldavCommand="itemName:gPS type:DISABLE" }    // Software-Switch fĆ¼r Anwesenheitssimulation ein/aus

My Sitemap:

sitemap richi label="Main Menu"
{
    Frame {
        Group item=gOG label="Obergeschoss"     icon="firstfloor"
    }

    Frame {
        Group item=gST label="Steuerung"         icon="house"
    }
}

I think I make a failure with my presencesimulation switch item, but what ?
Could you please tell me whats wrong with my presencesimulation switch item ?

Thank you for your help
Richard

No, it looks good.
Are you using this Snapshot?
http://speedy.sh/9vMhf/org.openhab.binding.caldav-command-1.8.0-SNAPSHOT.jar

@querdenker2k

Thank you for the information. It looks like I had a wrong snapshot.

With the provided one it works sometime. I donā€™t see a logic behind working and not working.

The only thing I see is the state of the PresenceSimulation Switch is unstable:

After start (PresenceSimulation Switch OFF) I see the following messages in the DOS Box (it runs under Windows 7)

2016-01-24 14:48:35.273 [INFO ] [runtime.busevents             ] - PresenceSimulation state updated to Undefined

If I set the Presencesimulation switch ON and afterwards to OFF, I get the following information:

2016-01-24 15:05:54.702 [INFO ] [runtime.busevents             ] - PresenceSimulation state updated to Undefined
2016-01-24 15:06:36.978 [INFO ] [o.o.b.c.internal.CalDavBinding] - execution for 'gPS' disabled
2016-01-24 15:06:36.978 [INFO ] [runtime.busevents             ] - PresenceSimulation received command ON
2016-01-24 15:06:40.363 [INFO ] [o.o.b.c.internal.CalDavBinding] - execution for 'gPS' enabled
2016-01-24 15:06:40.379 [INFO ] [runtime.busevents             ] - PresenceSimulation received command OFF
2016-01-24 15:06:54.044 [INFO ] [runtime.busevents             ] - PresenceSimulation state updated to Undefined

Also if I set it to ON, shortly after that it goes back to OFF and I get the message:

2016-01-24 15:24:14.324 [INFO ] [runtime.busevents             ] - PresenceSimulation state updated to Undefined
2016-01-24 15:24:27.584 [INFO ] [o.o.b.c.internal.CalDavBinding] - execution for 'gPS' disabled
2016-01-24 15:24:27.585 [INFO ] [runtime.busevents             ] - PresenceSimulation received command ON
2016-01-24 15:24:34.806 [INFO ] [runtime.busevents             ] - PresenceSimulation state updated to Undefined

So I canā€™t test the function realy. I have set the caldavio:command:reloadInterval=1

Other question:
Is it possible to invert the switch, so that if it is ON, the simulation is active and if the switch is OFF the simulation is disabled ?
How could I get a stable switch state (without changing wihin a minute) ?

Thank you for your patience and your help.
Richard

The problem is that the DISABLE type is initially developed to disable the automatic execution of events from the calendar. E. g. to disable execution if you are in holidays or something else. The presence simulation wasnā€™t a planned use case initially.
Feel free to make a configuration suggestion for your use case.

But nonetheless i am confused because of the ā€œPresenceSimulationā€ update to ā€œUndefinedā€. You are just toggle this item?
Switch PresenceSimulation "Anwesenheitssimulation" (gST) {caldavCommand="itemName:gPS type:DISABLE" }
or does it change because of a calendar reload?