iCalendar Binding triggering time offset

Hi there! I’ve just started to use the iCalendar Binding to retrieve ICS data from a Google Calendar and i use the current_presence channel of the calendar bridge to set a switch item on/off whenever there’s an active event in that calendar. No need for filtering in this case. That works great.

However I plan to implement an OpenHAB Switch item that reflects the occurrence of events in a different calendar. It’s a Google Calendar for a work schedule. Now, the tricky part comes when I want to do something before the event is actually scheduled. Let’s say I’d like to start up an engine heater 40 minutes before my work is scheduled in my calendar. And then I’d like to brew me a cup of coffee at a different offset, let’s say 20 minutes before the event is scheduled. This must be a very common use case. Of course I could solve it by setting up 3 different calendars but it would be much better solution if I could put a time offset (e.g. something like -nn minutes) on an iCalendar bridge.

Any ideas how to solve this?

Hi @RRoe,

Currently this behaviour is not implemented in the public code. But code already exists in preparation. Please test the pre-build linked there:

This is no PR as i currently don‘t have regular access to a machine that is able to build, test the addon and executing the ide. But a replacement is ordered. Until then, as much feedback as possible is nice, especially as i did not test the usecase in the wild up to now (in my synthetic test it worked). Please comment in the issue to keep everything together.

1 Like

As this is not my regular use case, please test the available PR and provide some feedback there.

In case it’s working that feedback for is nice for the reviewer. In case it’s not working the feedback is nice for me. Please note you need a openHAB 4.0 snapshot to test it, the changes make use of a new openHAB framework feature.

1 Like

Thanks! I haven’t upgraded to OpenHAB 4 yet. I’m looking forward to the new functionality and I appreciate your work with this!

Finally, I’ve managed to upgrade to OpenHAB 4.0.1 and I see that the code has become a pull request on GitHUB. I’ll be happy to test when it merges.

Great you were able to upgrade to OH4. Unfortunately nobody did have the time to review - so a merge won’t be happen soon. But you can boost the process by testing the build i’m currently preparing (what a nice timing!) and posting the results in the pull request. If you need help with setting up the test-build in your instance, you can just message me directly.