OH3: iCalendar eventfilter not bringing up tomorrows events

Hi,

I tried the OH3 version of the iCalendar binding today with my Synology NAS as the source for the ics file. It works fine for todays events - but having problems getting updates for the newly introduced eventfilter thing for tomorrows events (described here)

*.things

Bridge icalendar:calendar:private "calendar" @ "Internet" [ url="http://IP:5000/caldav/admin/home/", username="USER", password="PW", refreshTime=60 ]
Thing icalendar:eventfilter:tomorrow "Tomorrows events" (icalendar:calendar:private) [ maxEvents=1, datetimeUnit="DAY", datetimeStart=1, datetimeEnd=2, datetimeRound=true ]

*.items

String   current_event_name     "current event [%s]"                       <calendar> { channel="icalendar:calendar:private:current_title" }
DateTime current_event_until    "current until [%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:calendar:private:current_end" }
String   next_event_name        "next event [%s]"                          <calendar> { channel="icalendar:calendar:private:next_title" }
DateTime next_event_at          "next at [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:calendar:private:next_start" }
String   first_event_name_tomorrow "first event [%s]"                         <calendar> { channel="icalendar:eventfilter:tomorrow:event_0#title" }
DateTime first_event_at_tomorrow   "first at [%1$tT, %1$tY-%1$tm-%1$td]"      <calendar> { channel="icalendar:eventfilter:tomorrow:event_0#begin" }

The event is present in the *.ics-file on manual review, so it doesn’t seem to be a problem with that.

Am I missing something here?!

Opened a github issue on this here

As you’ve opened an issue i think we should close this topic here to avoid comments being out of scope.

Yep, good idea. (as I’m not able to do this, it seems we need a moderator here)

To sum this up, I found the error / fault and post the description here as a last statement:


I looked into it today and I think I found the error. I’m using text-files only for configuration normaly but had a look in the UI today.

There were no linked channels in my thing configuration of the eventfilter visible. I used the example configuration from the docs (which was updated at that time, I think).
The example items config refered to ‘event_0#xy’ as the channel-scheme for the eventfilter - now I recognized that ‘result_0#xy’ would be the correct scheme here.

It’s also mentioned in the decription itself correct now (I’m unsure it was there at the time I looked it up ) but the example item configuration still shows the wrong ‘event_0#xy’ scheme:

String first_event_name_tomorrow “first event [%s]” { channel=“icalendar:eventfilter:feedd0d0:event_0#title” }


Could I help with changig the docs at this point without forking the repo - as I´ve never done this before?! Or maybe another one would be so kind and changing the wording in the example configuration?

Thank you!

Hey @damihe

As I wrote, the general configuration is working now and I get events for the amount of days I’ve configured. But is there a limit in the number of days and events that the binding is able to handle?

For testing purposes I created 3 events per day - for today, tomorrow and the day after. What I get is

  • 3 events for today
  • 2 events for tomorrow (in which one of them does not bring up the start- and end-time)
  • 2 events for day2 (in which one of them does not bring up the start- and end-time)

My *.things looks like:

Bridge icalendar:calendar:private "calendar" [ url="http://192.168.1.35:5000/caldav/admin/home/", username="USERNAME", password="PASSWORD", refreshTime=5 ]
Thing icalendar:eventfilter:today "Today events" (icalendar:calendar:private) [ maxEvents=4, datetimeUnit="DAY", datetimeStart=0, datetimeEnd=1, datetimeRound=true, refreshTime=5 ]
Thing icalendar:eventfilter:tomorrow "Tomorrows events" (icalendar:calendar:private) [ maxEvents=4, datetimeUnit="DAY", datetimeStart=1, datetimeEnd=2, datetimeRound=true, refreshTime=5 ]
Thing icalendar:eventfilter:day2 "Day2 events" (icalendar:calendar:private) [ maxEvents=4, datetimeUnit="DAY", datetimeStart=2, datetimeEnd=3, datetimeRound=true, refreshTime=5 ]

with the following items configured:

String   current_event_name	"current event [%s]"                       <calendar> { channel="icalendar:calendar:private:current_title" }
DateTime current_event_until	"current until [%1$tT, %1$tY-%1$tm-%1$td]" <calendar> { channel="icalendar:calendar:private:current_end" }
String   next_event_name	"next event [%s]"                          <calendar> { channel="icalendar:calendar:private:next_title" }
DateTime next_event_at		"next at [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:calendar:private:next_start" }


// TODAY
String   first_event_name_today         "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:today:result_0#title" }
DateTime first_event_at_today           "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:today:result_0#begin" }
DateTime first_event_until_today        "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:today:result_0#end" }

String   second_event_name_today        "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:today:result_1#title" }
DateTime second_event_at_today          "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:today:result_1#begin" }
DateTime second_event_until_today       "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:today:result_1#end" }

String   third_event_name_today         "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:today:result_2#title" }
DateTime third_event_at_today           "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:today:result_2#begin" }
DateTime third_event_until_today        "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:today:result_2#end" }


// TOMORROW
String   first_event_name_tomorrow      "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#title" }
DateTime first_event_at_tomorrow        "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#begin" }
DateTime first_event_until_tomorrow     "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#end" }

String   second_event_name_tomorrow     "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#title" }
DateTime second_event_at_tomorrow       "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#begin" }
DateTime second_event_until_tomorrow    "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#end" }

String   third_event_name_tomorrow      "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:tomorrow:result_3#title" }
DateTime second_event_at_tomorrow       "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:tomorrow:result_3#begin" }
DateTime second_event_until_tomorrow    "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:tomorrow:result_3#end" }


// DAY 2
String   first_event_name_day2          "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:day2:result_0#title" }
DateTime first_event_at_day2            "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:day2:result_0#begin" }
DateTime first_event_until_day2         "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:day2:result_0#end" }

String   second_event_name_day2         "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:day2:result_1#title" }
DateTime second_event_at_day2           "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:day2:result_1#begin" }
DateTime second_event_until_day2        "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:day2:result_1#end" }

String   third_event_name_day2          "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:day2:result_3#title" }
DateTime second_event_at_day2           "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:day2:result_3#begin" }
DateTime second_event_until_day2        "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:day2:result_3#end" }

I tried it with different refreshTimes and also checked the *.ics file - everything seems fine and all events (and start- and end-times) showing up there.

Did I anything wrong here?

You are overwriting Items by other ones with same name. e.g. second_event_at_day2 is defined multiple times. Also your e.g. third_event_name_day2 is pointing to the fourth result (semantic error - which is likely to lead you to confusion).

Please check these Items very exactly to avoid errors. Alternatively, you can create Items via GUI. This avoids mistakes and you still can use the Items in you rules.

Very stupid mistake… thank you for your quick reponse!

Hi @RGroll, I quite like your calendar widget, would you mind sharing it the config and css?
Currently looking into some html/css widget from searching, not yet wanted until now :slight_smile:

Cheers and happy new year!

Hey @hschulze86 and happy new year!
It’s just a timeline widget with the following YAML, nothing special tbh and just for testing purposes. Its configured to show max. 3 events for the next 2 days (+ today)

uid: Timeline
component: f7-page
config:
  title: Vertical timeline example
slots:
  default:
    - component: f7-col
      config:
        class:
          - timeline
      slots:
        default:
          - component: f7-col
            config:
              class:
                - timeline-item
                - no-margin
            slots:
              default:
                - component: f7-col
                  config:
                    class:
                      - timeline-item-date
                    style:
                      width: 20px
                  slots:
                    default:
                      - component: Label
                        config:
                          text: =dayjs().format('DD')
                          style:
                            font-size: 21px
                            line-height: 21px
                            font-weight: 800
                      - component: Label
                        config:
                          text: =dayjs().format('MMM')
                - component: f7-col
                  config:
                    class:
                      - timeline-item-divider
                - component: f7-col
                  config:
                    class:
                      - timeline-item-content
                  slots:
                    default:
                      - component: Label
                        config:
                          visible: =items.first_event_name_today.state === 'UNDEF' && items.second_event_name_today.state === 'UNDEF' && items.third_event_name_today.state === 'UNDEF'
                          class:
                            - timeline-item-content
                          text: Keine Termine
                      - component: f7-col
                        config:
                          visible: =items.first_event_name_today.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.first_event_at_today.state).format('HH:mm')+' - '+dayjs(items.first_event_until_today.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.first_event_name_today.state
                      - component: f7-col
                        config:
                          visible: =items.second_event_name_today.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.second_event_at_today.state).format('HH:mm')+' - '+dayjs(items.second_event_until_today.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.second_event_name_today.state
                      - component: f7-col
                        config:
                          visible: =items.third_event_name_today.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.third_event_at_today.state).format('HH:mm')+' - '+dayjs(items.third_event_until_today.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.third_event_name_today.state
          - component: f7-block
            config:
              class:
                - timeline-item
                - no-margin
            slots:
              default:
                - component: f7-col
                  config:
                    class:
                      - timeline-item-date
                    style:
                      width: 20px
                  slots:
                    default:
                      - component: Label
                        config:
                          text: =dayjs().add(1,'days').format('DD')
                          style:
                            font-size: 21px
                            line-height: 21px
                            font-weight: 800
                      - component: Label
                        config:
                          text: =dayjs().add(1,'days').format('MMM')
                - component: f7-col
                  config:
                    class:
                      - timeline-item-divider
                - component: f7-col
                  slots:
                    default:
                      - component: Label
                        config:
                          visible: =items.first_event_name_tomorrow.state === 'UNDEF' && items.second_event_name_tomorrow.state === 'UNDEF' && items.third_event_name_tomorrow.state === 'UNDEF'
                          class:
                            - timeline-item-content
                          text: Keine Termine
                      - component: f7-col
                        config:
                          visible: =items.first_event_name_tomorrow.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.first_event_at_tomorrow.state).format('HH:mm')+' - '+dayjs(items.first_event_until_tomorrow.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.first_event_name_tomorrow.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text
                      - component: f7-col
                        config:
                          visible: =items.second_event_name_tomorrow.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.second_event_at_tomorrow.state).format('HH:mm')+' - '+dayjs(items.second_event_until_tomorrow.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.second_event_name_tomorrow.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text
                      - component: f7-col
                        config:
                          visible: =items.third_event_name_tomorrow.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.third_event_at_tomorrow.state).format('HH:mm')+' - '+dayjs(items.third_event_until_tomorrow.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.third_event_name_tomorrow.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text
          - component: f7-block
            config:
              class:
                - timeline-item
                - no-padding
                - no-margin
            slots:
              default:
                - component: f7-col
                  config:
                    class:
                      - timeline-item-date
                    style:
                      width: 20px
                  slots:
                    default:
                      - component: Label
                        config:
                          text: =dayjs().add(2,'days').format('DD')
                          style:
                            font-size: 21px
                            line-height: 21px
                            font-weight: 800
                      - component: Label
                        config:
                          text: =dayjs().add(2,'days').format('MMM')
                - component: f7-col
                  config:
                    class:
                      - timeline-item-divider
                - component: f7-col
                  slots:
                    default:
                      - component: Label
                        config:
                          visible: =items.first_event_name_day2.state === 'UNDEF' && items.second_event_name_day2.state === 'UNDEF' && items.third_event_name_day2.state === 'UNDEF'
                          class:
                            - timeline-item-content
                          text: Keine Termine
                      - component: f7-col
                        config:
                          visible: =items.first_event_name_day2.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.first_event_at_day2.state).format('HH:mm')+' - '+dayjs(items.first_event_until_day2.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.first_event_name_day2.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text
                      - component: f7-col
                        config:
                          visible: =items.second_event_name_day2.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.second_event_at_day2.state).format('HH:mm')+' - '+dayjs(items.second_event_until_day2.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.second_event_name_day2.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text
                      - component: f7-col
                        config:
                          visible: =items.third_event_name_day2.state != 'UNDEF'
                          class:
                            - timeline-item-content
                            - timeline-item-inner
                        slots:
                          default:
                            - component: Label
                              config:
                                class:
                                  - timeline-item-time
                                text: =dayjs(items.third_event_at_day2.state).format('HH:mm')+' - '+dayjs(items.third_event_until_day2.state).format('HH:mm')
                            - component: Label
                              config:
                                class:
                                  - timeline-item-title
                                text: =items.third_event_name_day2.state
                            - component: Label
                              config:
                                class:
                                  - timeline-item-text
                                text: Description text

*.items

Summary
// TODAY

String   first_event_name_today         "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:today:result_0#title" }
DateTime first_event_at_today           "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:today:result_0#begin" }
DateTime first_event_until_today        "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:today:result_0#end" }

String   second_event_name_today        "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:today:result_1#title" }
DateTime second_event_at_today          "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:today:result_1#begin" }
DateTime second_event_until_today       "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:today:result_1#end" }

String   third_event_name_today         "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:today:result_2#title" }
DateTime third_event_at_today           "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:today:result_2#begin" }
DateTime third_event_until_today        "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:today:result_2#end" }

// TOMORROW

String   first_event_name_tomorrow      "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#title" }
DateTime first_event_at_tomorrow        "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#begin" }
DateTime first_event_until_tomorrow     "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:tomorrow:result_0#end" }

String   second_event_name_tomorrow     "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#title" }
DateTime second_event_at_tomorrow       "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#begin" }
DateTime second_event_until_tomorrow    "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:tomorrow:result_1#end" }

String   third_event_name_tomorrow      "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:tomorrow:result_2#title" }
DateTime third_event_at_tomorrow        "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:tomorrow:result_2#begin" }
DateTime third_event_until_tomorrow     "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:tomorrow:result_2#end" }

// DAY 2

String   first_event_name_day2          "first event [%s]"                              <calendar> { channel="icalendar:eventfilter:day2:result_0#title" }
DateTime first_event_at_day2            "first at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:day2:result_0#begin" }
DateTime first_event_until_day2         "first until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:day2:result_0#end" }

String   second_event_name_day2         "second event [%s]"                             <calendar> { channel="icalendar:eventfilter:day2:result_1#title" }
DateTime second_event_at_day2           "second at [%1$tT, %1$tY-%1$tm-%1$td]"          <calendar> { channel="icalendar:eventfilter:day2:result_1#begin" }
DateTime second_event_until_day2        "second until [%1$tT, %1$tY-%1$tm-%1$td]"       <calendar> { channel="icalendar:eventfilter:day2:result_1#end" }

String   third_event_name_day2          "third event [%s]"                              <calendar> { channel="icalendar:eventfilter:day2:result_2#title" }
DateTime third_event_at_day2            "third at [%1$tT, %1$tY-%1$tm-%1$td]"           <calendar> { channel="icalendar:eventfilter:day2:result_2#begin" }
DateTime third_event_until_day2         "third until [%1$tT, %1$tY-%1$tm-%1$td]"        <calendar> { channel="icalendar:eventfilter:day2:result_2#end" }
4 Likes

This looks very nice, but unfurtunately it is not working for me. Do I need something else?

Hello @RGroll
many thanks for that timeline widget! When I place that widget on the overview page I get this small sized widget cell, where not all days are displayed. Do you know how this can be avoid?

image

When I place it on a canvas layout page I get this full (auto) heigth, even how high it is. I would really have the timeline on the overview page to have it at a glance.

Bild_2022-03-25_155518