I have a question regarding the caldav command binding. I was able to successfully set it up so that items are updated based on a caldav calendar. However I now would like to be able to turn on/off the automatic calendar based updates. In the documentation of the caldav binding a disable command is mentioned. However I did not figure out how to really use it. Does anyone have an example for that?
This switch would when enabled disable caldav updates to all items belonging to group gPresenceSimulation.
I had this on my test openHAB installation and it seemed to work most of the time, but not all of the time unfortunately. I have the impression that it worked when the switch was set manually after openHAB had started, but not when the setting was restored by persistance. YMMV.
if i switch gTest_Enabled oder gTest1_Enabled to ON i see the following entries in the log
2017-10-18 11:55:54.271 [INFO ] [aldav_command.internal.CalDavBinding] - execution for 'gTest' disabled
2017-10-18 11:55:54.276 [ome.event.ItemCommandEvent] - Item 'gTest_Enabled' received command ON
2017-10-18 11:55:54.284 [vent.ItemStateChangedEvent] - gTest_Enabled changed from OFF to ON
2017-10-18 11:55:56.048 [INFO ] [aldav_command.internal.CalDavBinding] - execution for 'gTest1' disabled
2017-10-18 11:55:56.053 [ome.event.ItemCommandEvent] - Item 'gTest1_Enabled' received command ON
2017-10-18 11:55:56.066 [vent.ItemStateChangedEvent] - gTest1_Enabled changed from OFF to ON
so for me everything looks OK, however even its showing “execution for 'xxxx” disabled, its still getting executed.
Haven’t tried that yet, but if you configure a persistence service for that item it should work because the state can be restored during restart via restoreOnStartup:
I’m aware of the restoreOnStartup persistence setting. When I tried the caldav command binding sometime last year it seemed to make a difference if the item was set manually vs. being set by persistence on system startup.
Maybe the disable item’s state is not checked on every execution and this is a timing issue if the restore on startup runs when the caldav binding is not ready yet set the right internal flag that prohibits the execution of commands?!