[SOLVED] Use CalDav to decide day "type"

I haven’t found a tutorial for this, so I ask for opinions on how should I do this:

I want to calculate if the current day is a “normal” working day, weekend, red-letter day or I’m on a vacation.

What I have:

  • A calendar with all the red-letter days in my country.
  • A calendar with my vacations and other not related events.

Calculating that it is a weekend or not is not that hard and there are several tutorial for it here on the forum

What I would really need:

  • Filter my vacation calendar based on some regex, to only get events which has “Vacation” or other words in it
  • Get if it is an ongoing event
  • From my other calendar containing the red-letter days, only a solution which turns on a switch when there is an ongoing event would be enough.

Can someone give me some examples on how you did this if you have a similar rule?


You should look at the newish Ephemeris capability. Start here. This is now built into OH directly.

That should get you everything except for the vacation days. I’ve no direct experience with the CalDav binding yet so can’t be of much help there. But there was a tutorial posted not to long ago that did something similar that you might be able to use.

Thanks, I’ll look into it. I saw the ephemeris before, but not a documentation for it, or real experiences with it.
Is this caldav issue is general? I haven’t seen anybody reporting that it stopped working and is working fine for me even on 2.5M3.


Not sure if I got exactly what you want to achieve but if I got it right I’m doing something similar.

I have one group:switch item that should be ON whenever it is a non-working day. Sure it is OFF if I unluckily have to work:

Group:Switch:OR(ON,OFF)  Christian_Arbeitsfrei "Arbeitsfrei [MAP(ja_nein.map):%s]"             <none>

To this group I add other switches which are on if it is e.g. a public holiday or weekend. Evaluating this can be done different ways like a caldav calendar or a rule set.

To evaluate if I’m on vacation I also have appointments in my calendar. To filter for these there is no rule needed. It can be done using the filter functionality of caldav binding:

Switch  Christian_Urlaub   "Urlaub [MAP(ja_nein.map):%s]"    <vacation> (Christian_Arbeitsfrei)         {caldavPersonal="calendar:'christian' type:'PRESENCE' filter-name:'Freizeit|Urlaub'"}

This will result in a Switch which receives ON command whenever an appointment is active that has “Urlaub” or “Freizeit” in it’s title.

Hope this helps solving your problem and the German titles are not too much problem.