Icalendar used to drag homeoffice days and free days

Hi everybody,

hope someone can help me with the correct configuration. I want to use icalendar binding to manage free days and homeoffice days of my wife and me.

What I did so far, was to create a new smarthome calendar on my nextcloud and insert some testdata

Freeday only for me on 15.12.2021
Freedays from 24.12.2021 to 31.12.2021
Freedays only for me 02.01.2022 to 09.01.2022
Homeoffice Days for me 01.12.2021 to 31.01.2022

My problem no is how can I check that today the 26.12.2021 is a freeday (and a homeoffice day)?

I have successfully add the bridge thing and get the content of the calendar. And for my freedays I added an eventfilter thing to filter SUMMARY with a REGEX “^Urlaub( Johannes)?$” which seems to filter correctly freeday events specially for me or both of us.

Now my problem begins. Adding properties “datetimeUnit”: “DAY”, “datetimeStart”: 0 to the eventfilter doesn’t show the event from 24.12.2021 to 31.12.2021 but shows the event from 02,01.2022 to 09.01.2022. But not using this properties will show up the 15.12.2021 which is already in the past.

Any idea how to get rid of this situation?

The result should be a switch per person for freedays being ON when there is a current event with “Urlaub (NAME)” in the summary and a switch for homeoffice per person which is ON if there is an event with summary “Homeoffice NAME” and freeday switch is not ON. The rules logic in python rules will be no problem for me to set the switches correctly if the eventfilter result0#begin holds the correct begin date for those events filtered by the working REGEX.

Thanks in advantage
Johannes

You can set the switch directly within the calendar record using command tags, e g.

BEGIN:Calendar_Test_Switch:ON
END:Calendar_Test_Switch:OFF

If you want to go with event filter, I had similar issues that not the events I want to see (and that are currently ongoing) are included and I changed the datetimeunit from DAYS to HOURS (eg. 72 hours instead of 3 days) which solved my problem on how current ongoing events are filtered.

But it would maybe help if you can show your full Eventfilter configuration.

I thought about this as well and then decided to make it really smart: I ping the notebook which I use to work during homeoffice times every minute with the network binding. If it is reachable Openhab triggers my Homeoffice scenario. No calendar to be maintained anymore

You could also use multiple calendars. The binding does not have a filtered presence of events.

Thanks for the idea. But unfortunately this is not working because of the security guidelines of my company the notebook is running in separated network segment.

I have seen the command tags but I want my wife to be able to maintain the calendar as well and for this want it to keep as simple as putting in an event with title “Urlaub NAME”.

My things configuration looks like this:

Thing eventfilter Johannesurlaub “Kalender Johannes Urlaub (Johannesurlaub)” @ “equipment” [
maxEvents=1,
refreshTime=15,
datetimeUnit=“DAY”,
datetimeStart=0,
textEventField=“SUMMARY”,
textEventValue="^Urlaub( Johannes)?$",
textValueType=“REGEX”]
Thing eventfilter Johanneshomeoffice “Kalender Johannes Homeoffice (Johanneshomeoffice)” @ “equipment” [maxEvents=1,
refreshTime=15,
datetimeUnit=“DAY”,
datetimeStart=0,
textEventField=“SUMMARY”,
textEventValue="^Homeoffice( Johannes)?$",
textValueType=“REGEX”]

I think setting the datetimeStart to the past will noch work as well. Because how long should it be to the past to hit long and short periods.

I don’t see why to use multiple calendars, the REGEX filtering is working correctly? only the time intervals not working as I want.

Maybe the solution will be a new feature request.

An eventfilter boolean flag “includecurrent” which will make the filter to include events which are running at the the time defined by datetimeStart or datetimeEnd.

Concret condition for this flag could be:

event begin < datetimeStart < event end OR event begin < datetimeEnd < event end

I had a look into the binding documentation again and it clearly says:

Time based filtering is done by each event’s start

Therefore if you have a multi-day event that started in the past, it looks like by design this is not included in the filter.

Maybe as a workaround

  1. try to setup a one day event, that will repeat every day or
  2. instead of maintaining a calendar record maintain start and end of your next home office / vacation period directly within openhab via a nice widget

Sure that it does not get a ip from the router?

Yes I’m Sure because it has its own subnet with separate gateway between.