OH3 Google Calendar Scheduler Alternative


I started to migrate from OH2.5 to OH3.

I used to use “Google Calendar Scheduler” to trigger my coffee-machine in the morning, but that option seems no longer to be available in OH3.
A possible solution seems to be the ICalendar Binding, but then you need to configure the icalendar bridge to refresh/poll your calendar every 1 minute if I want my coffee on time ?!

Does anyone knows a better way?

I would like to:

  • Check the calendar once a day (instead of every minute).
  • Send a command trigger based on the calendar entry scheduled time (instead of the calendar poll interval time)

Looking forward to your suggestions!!
Thanks for your support!

I also use the Google Calendar binding, and started looking into the iCal binding.

iCal does support command options for OH:


Calendar_Test_Switch I believe is your item name.

Yes, indeed.
I managed to get it working, but the fact that I need to set the retrieve interval to 1 minute bothers me.
If you set it to 1 hour for example, the commands will only run once an hour, even if the calendar entry is set every 15 minutes.

in iCal commands are executed at calendar retrieval interval, instead of the start and end time of the calendar entry itself.

1 Like

I’m actually looking into this today so I can’t relate (yet), I would assume with having options for BEGIN and END it would use the starting times with the ending times of the calendar entry.

I also can’t talk to the refresh time as my ISP is currently having issues with packet loss in the 60% plus ranges and see a lot of DNS related logs in OH for a 10 min refresh period.

Alright now with Internet working I was able to fire off a test event and the BEGIN/END commands in the entry does work, but only if you strip the formatting (highlight everything and hit the crossed T). At 13:15 a light in the room I’m in turned on and at 13:30 it turned off, currently I have the refresh time set to 5; going to change it back to 60 after another test event gets picked up.

If you set the log level for the binding to TRACE it clearly shows in the log that the commands are executed at the refresh interval.

openhab> log:set TRACE org.openhab.binding.icalendar
1 Like

A trigger option would indeed be a valuable improvement.
Maybe this could be solved with a special thing listening to the next filtered event.

Or a trigger channel for a filtered event.

@damihe Thank you for all the effort you are putting in to this!

Currently commands are all queued up and triggered at the calendar bridge retrieval interval, right?
Would it be possible to trigger the BEGIN command at the calendar entry START time and the END command at the calendar entry STOP time instead?

1 Like

Commands should be executed at beginnings and ends of events, already. But they also can get executed when the calendar gets updated in refreshTime-Interval. The last execution time is used for ensuring the commands are not executed multiple times.

If this is not working, please check the logs for warnings and errors. Maybe something is breaking while scheduling the updates properly.

1 Like

This is exactly what it does.

1 Like

I just restarted from scratch and indeed this works as expected.
I don’t know what went wrong initially.

Apologies for the fuzz…

Am i right that the execution of an tagged (BEGIN:… END:…) event should also occur when the calendar is reloaded? Well when i add a new event for Start at 7:00 and end at 9:00 and it is initially loaded at 8:00 the BEGIN command should be triggered?
This is not working for me. If i missunderstood this could it be a feature request?

My config

2020-12-28 11:14:24.332 [TRACE] [ar.internal.handler.ICalendarHandler] - reloading calendar of icalendar:calendar:heating
2020-12-28 11:14:24.334 [DEBUG] [ar.internal.handler.ICalendarHandler] - Scheduled update in 35136 seconds
2020-12-28 11:14:24.335 [TRACE] [ar.internal.handler.ICalendarHandler] - updating states of icalendar:calendar:heating
2020-12-28 11:14:24.339 [TRACE] [ar.internal.handler.ICalendarHandler] - Notifying icalendar:eventfilter:heating_bathog about fresh calendar.
2020-12-28 11:14:24.340 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: “BEGIN:Temperature_Target_BathOG:20” => Fully valid Command Tag!
2020-12-28 11:14:24.340 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: “END:Temperature_Target_BathOG:18” => Fully valid Command Tag!
2020-12-28 11:14:24.340 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: “BEGIN:Temperature_Target_BathOG:20” => Fully valid Command Tag!
2020-12-28 11:14:24.340 [TRACE] [.icalendar.internal.logic.CommandTag] - Command Tag Trace: “END:Temperature_Target_BathOG:18” => Fully valid Command Tag!

Maybe yes, maybe no. But probably no.

The binding searches for “justBegun” and “justEnded” events, and executes and BEGIN resp. END statements in those events.

The definition of a “justBegun” event is one whose start time is later than the last time that the binding refreshed itself “lastRefreshed”, and earlier than or equal to the current time. The definition of “justEnded” is similar.

So, for the example that you cite, in all likelihood the binding will execute the END statements but not the BEGIN statements.

If you want to post process the BEGIN statements of a newly created event like the example you cite, then you probably need to stop and restart the binding. (This resets the “lastRefreshed” time to zero. So your event then matches the “justBegun” definition, even though strictly it has not really “just begun”…)

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.