iCalendar binding

Hi

I’m currently using the caldav personal v1 binding to retrieve the next 3 future events from an icloud shared family calendar and displaying these (Date, Day, Title & Location) on a wall mounted tablet running HABPanel. This works well, however, I’m worried that once openHAB 3 is released and support/development of openHAB 2 stops, specifically the compatibility layer, that I will either loose this functionality or will have to remain on openHAB 2.

Is there any plans to increase the functionality of this binding to provide access to more than 1 future event and access to other fields?

Thanks

So I have to loop through the data. I have no idea how to program it. Is there an example of a rule?

Many thanks!

I’m not sure what you mean by looping through the data?? And you don’t need a rule to program it. You just need to put command tags inside the events in your calendar. See the ReadMe file for examples.

The feature is planned, but currently not in development. The user openhab-5iver (afair) at github seemed to have an simliar usecase.

2 Likes

What I don’t understand is: How I could find out and show today (14.07.) that tomorrow (15.07.) two appointments exist?

Using next_start I only find one next appointment out of two. Is there something like a FetchNext() loop?

ideas?

Hmmm. Currently this possibility does not exist. Also i’m not sure how i would implement a possibility to do that. What exactly you try to do?

I have the simple problem of being able to display two appointments for the next day.

Hi,

just started using iCalendar binding as replacement for CalDAV binding. Setup and documentation is straight forward and self explanatory, thanks for the good work.
What I see is that the binding works for a while (I have loglevel TRACE on) and after a while the whole binding seems to stop working at all.
There are neither more messages about fetching new events from the calendar nor does it trigger anything after some while.
Even though when I restart the bundle via karaf console the bindings stays dead.
I have to restart the whole openhab2 service to bring it back to life.

Any ideas for the cause?

This sounds like a problem with the scheduler as nothing happens anymore, at least when restarting the binding it should work again. Do other timebased bindings work well (bindings that use polling)?

Can’t say. Therefor that all other things work as expected I think iCalender is the only binding I use which uses the scheduler for polling.

I just set a new schedule with content:
BEGIN:EdisonLamp:ON
BEGIN:EdisonLamp:OFF

But the binding doesn’t seem to read the calendar anymore.

2020-10-06 09:51:58.468 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 09:53:58.470 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 09:55:58.473 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 09:57:58.476 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 09:59:58.479 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:01:58.482 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:03:58.485 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:05:58.488 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:07:58.491 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:09:58.494 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:11:58.497 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:13:58.500 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:15:58.503 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:17:58.506 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:19:58.509 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:21:58.512 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:23:58.515 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:25:58.518 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:27:58.521 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:29:58.524 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:31:58.527 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null
2020-10-06 10:33:58.531 [WARN ] [g.icalendar.internal.handler.PullJob] - Response for calendar request could not be retrieved. Error message is: null

Then I restarted openhab2 and the calendar entries are being read again:

2020-10-06 10:38:50.724 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: "BEGIN:EdisonLamp:ON" => Fully valid Command Tag!
2020-10-06 10:38:50.725 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: "BEGIN:EdisonLamp:OFF" => Fully valid Command Tag!
2020-10-06 10:38:50.738 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: "BEGIN:EdisonLamp:ON" => Fully valid Command Tag!
2020-10-06 10:38:50.740 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: "BEGIN:EdisonLamp:OFF" => Fully valid Command Tag!

Please check your URL and your frequency (maybe you are running into some limits). The message “Response for calendar request could not be retrieved” is written when downloading the calendar fails. If your URL is http, you can also analyse the traffic with tcpdump/wireshark.

After restarting, the still cached calendar is loaded again.

Hi and thanks for the awesome binding!

One question: My commands are not executed when the scheduled event ist starting/ending but when the icalendar binding refreshes the ical info.

I would have expected the commands to be issued at the start time of the event. Now I have set the refresh interval to 5m because otherwise the commands come worst case 60mins too late for an 60min refresh interval.
Example:
Set Heating Event Begin: 08:45 End: 09:15

2020-10-11 09:18:31.190 [DEBUG] [ar.internal.handler.ICalendarHandler] - Event: Heating Office, Command Tag: END:Set_THPS6_Temp:17°C => Set_THPS6_Temp.postUpdate(QuantityType: 17 °C)

09:18:31 is when the 5-minute refresh ran.
Is this the expected way it’s working? I’m on openhab 2.5.5.

Thank you so much and all the best,

Bob

Correct.

The binding polls the calendar events periodically at the refresh interval (this is actually the meaning of “refresh interval”). At each poll, it checks all the calendar events to discover those that have “just begun” resp. “just ended” during the interval since the last poll: For the “just begun” events, it processes the BEGIN tags; and for the “just ended” events, it processes the END tags.

1 Like

Thanks for the explanation. Maybe it’d be nice if the documentation stated that the refresh interval has an impact on when the actions are executed.
It works like a charm now, thank you for all the work you put into it!

I have suggested a change to Michael’s Pull Request.

1 Like

Hi. I’m really happy to have tried out this binding. Our municipality is publishing the waste tour in an iCal and previously I used http binding with some JS to figure out what’s the next day they come to empty the bins. Now it’s so much easier and I recently pushed automation a step further by setting up a calendar with events to regulate ventilation and blinds. Works perfectly! I had to struggle a bit with iCloud Calendars and couldn’t make it work - maybe this support can be added later. I switches to Office 365 Outlook Calendar and this works fine (even thou I was blocked by MS when I did put the refresh interval too low during the tryout phase).
Could be interesting to have some more channels on the binding, such as previous event, information about the event location, multiple events on the same timeslot and support for categories.

Kudos for your work! Well done!

Hello,
I am glad to see a new binding which is much more easy in calendar configuration. Great work!

Meantime, I try to react with some icons on my HABPanel and I am not sure how can I use Commands Tags for that. Could commands tag be used for the example below?

Example:
whenewer the binding recognizes there is an event next day, with dedicated name in the calendar’s entry, a dedicated switch shall be ON and my icon on a panel will change its status.
If it ends, switch will be OFF and icon will change its status.

Is it possible with this bining?

My Items:

String CalendarName1   "Now [%s]"                                                   <calendar>  { channel="icalendar:calendar:29d480ef:current_title" } 
DateTime CalendarTimeStart1 "Starts [%1$ta, %1$te %1$tb %1$tl:%1$tM%1$tp]"              <calendar>  { channel="icalendar:calendar:29d480ef:current_start" } 
DateTime CalendarTimeEnd1 "Ends [%1$ta, %1$te %1$tb %1$tl:%1$tM%1$tp]"                  <calendar>  { channel="icalendar:calendar:29d480ef:current_end" }
//String CalendarAt1 "At [%s]"                                                            <calendar>  { caldavPersonal="calendar:Garbage type:EVENT eventNr:1 value:PLACE" } 

String CalendarName2   "Coming up [%s]"                                                 <calendar>  { channel="icalendar:calendar:29d480ef:next_title" } 
DateTime CalendarTimeStart2 "Starts [%1$ta, %1$te %1$tb %1$tl:%1$tM%1$tp]"              <calendar>  { channel="icalendar:calendar:29d480ef:next_start" } 
DateTime CalendarTimeEnd2 "Ends [%1$ta, %1$te %1$tb %1$tl:%1$tM%1$tp]"                  <calendar>  { channel="icalendar:calendar:29d480ef:next_end" }

My virtual switch:

Switch  MeetingBegins           "Meeting begins"            <switch>

…I answered the question myself :slight_smile:
Commands tags are defined in the calendar entry description. Look here:
It is imporant you have descritpion without HTML formatting.

Now I am able to change the switch item. I am not sure I will realize my example with this mathod.
Any other ideas, options how to react on the meeting planned next day?

Can someone post short guide how to connect to ios iphone calendar with this binding ? Assuming that connection works with caldav binding so i have all necessary addresses/passwords etc.

I’m afraid that this is not possible as of now.

I tried to use iCloud CalDav first and unfortunately, with all different how-tos Google could provide me in terms of reading an iCloud calendar in 3rd party applications, none of this worked out with iCalendar.

I even tried to publish a calendar to exclude that it might have been an authentication issue, but no success.

I finally published a calendar on my Microsoft Outlook account.

I would appreciate support or a working how-to for iCloud calendars thou.