ICS Calendar platform

Typically, the best way to contact me with such problems is through opening an issue on GitHub, but I do notice posts here, too. :slight_smile: Looking at that excerpt, I fail to see how anything interprets that event as anything other than all day on 2022-09-10. Note the line that reads:

DTSTART;VALUE=DATE:20220910

That pretty clearly indicates the event is to start on 2022-09-10. Is this the wrong excerpt? I also see a lot of custom properties in the event, which is usually a good sign of something that’s non-standard. You can send me the whole ics file privately (with any summaries, descriptions, and locations redacted), and we can work on figuring this out more specifically.

Unless, of course, that really is the correct excerpt. In which case, I can only point to RFC 5545, in particular section 3.6.1, and the last example, which specifically points out that since DTEND as a date is not inclusive, in your excerpt above with DTEND set to 20220911, that the event ends on 2022-09-10.

Thanks for your reply and sorry for not having opened an issue on GitHub!

I’ve started another test with an empty calendar.
Here is the complete ics file:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Kopano//11.0.2//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
TRANSP:TRANSPARENT
X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
CREATED:20220908T213511Z
LAST-MODIFIED:20220908T213511Z
DTSTAMP:20220908T213511Z
DTSTART;VALUE=DATE:20220911
DTEND;VALUE=DATE:20220912
SUMMARY:appointment test 2022-09-12\, all day
PRIORITY:5
CLASS:PUBLIC
UID:
 040000008200E00074C5B7101A82E00800000000800564E4CAC3D801000000000000000001
 00000035A1B8102AFD4AE9AC9D0C575AFC4F57
X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20220908T213519Z
X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20220908T213519Z
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:-1
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
END:VEVENT
END:VCALENDAR

The all day event was created with Kopano WebApp for 2022/09/12 and is correctly shown there.
It is also correctly synchronized to my iPhone via z-push / ActiveSync.

I can confirm that all timezones (Debian / MariaDB / z-push / Kopano) are properly set to “Europe/Berlin”.

Thanks for your help and best regards,
David

Thanks for the reply, and the more information. As earlier, that ICS file clearly indicates the start date of the event is 2022/09/11, not 2022/09/12. If you’re viewing it on your iPhone via z-push/ActiveSync, then my guess is that Kopano doesn’t natively store the data in ICS format. ActiveSync doesn’t use ICS to exchange data, so if it’s right on your server, then it makes sense that anything which gets the data via ActiveSync will also be correct. I think Kopano has a bug when it generates the ICS file. :frowning: In a quick look, I do see some references to Kopano & CalDAV. Normally, I recommend using CalDAV because it’s more efficient (and moves most of the work onto the server). In this case, though, it’s important to note that CalDAV does use ICS, so the chances are that it wouldn’t help. If you can report the problem, and want somebody who can reference the RFCs to say that what was produced is wrong, I’d be happy to do that. I’m sorry I can’t fix the issue, though.

Thanks for your support and your kind offer!

Your explanation seems absolutely sensible to me.
There is a Kopano community forum where I’ve opened a thread:
Kopano Community Forum

There is also a plugin called “Kopano kDAV” (kDAV) that is based on SabreDAV and adds CalDAV and CardDAV to Kopano. I’ve already installed it, but that strange behaviour also happens with kDAV and not only with the iCal interface that is built-in into Kopano server…

1 Like

Unfortunately, I didn’t get any response to my Kopano GitHub issues until today.

But I made an interesting observation:
I recently set up a Univention server (open source) which also contains a free Kopano Groupware setup in its AppStore that does not show the observed ical bug.

I compared the Kopano settings to those of my “hand-built” server and couldn’t find any differences concerning configuration or timezone settings. Still, the Kopano version offered by Univention is older than the one I got from the Kopano community sources.

As nobody related to Kopano was willing to answer my requests, I decided to switch to the Univention platform. I will move my AD controller and my email server to that one in the next days and have another test run afterwards.

I will report my findings when it’s finished.
Tom, thanks for your kind support concerning this issue!

For the record. I have been able to successfully add calendars from Webcal Guru for official holidays and flag days.

Is there a way to import an ICS calendar into an existing google calendar rather than creating a new calendar?

I use an ICS calendar provided by my work scheduling tool for my shifts. My issue is that the events imported from the ICS calendar aren’t kept once “today” passes. My ICS calendar provides shift schedules for 3 weeks in adavance from this weeks current Monday. When the ICS calendar rolls over to next Monday and the ICS calendar is updated then the past weeks shift schedules are no longer displayed on the calendar. Hopefully that makes sense.

I’d like to import the ICS calendar to allow them to be static ie. still exist after the ICS calendar has been updated.

Hopefully this post can save someone the time it took me to figure this out.

To get the link for a Family Wall calendar, open the calendar page, and on the right side of the screen, click the arrow on the right side of the calendar you want to add. That will let you create a sharing link. It’s an iCal file, so you’ll need to add the iCal integration not the ics one.

2 Likes

The https://www.home-assistant.io/integrations/local_calendar/stores an .ics file underneath for what it’s worth. You may be able to clobber it with your own file and see what happens. (It does not support import /yet/)

Hello,
i installed the custom component via HACS.
After that i added this to my configuration.yaml

ics_calendar:
  calendars:
    - name: "Feiertage (Sachsen)"
      url: "http://i.cal.to/ical/51/sachsen/feiertage/dd7b6116.ed5153b5-0c527e40.ics"

If i click check configuration files on the developer site, the wheel is spinning infinite. Without the code above i get a success message.

Any idea what the problem could be?

Don’t know what the problem was. It works now.

Hi,
I successfully installed the extension, and got my Outlook 365 Calendar integrated.

ics_calendar:
  calendars:
    - name: "Juergen Calender"
      url: "https://outlook.office365.com/owa/calendar/[email protected]/be0b4c869348/S-1-8-32814.....01693-3112447535-1891374732-1524315815/reachcalendar.ics"
      days: 1

(I changed the URL for more privacy, so the URL is not working in this example here.)

I have two questions:
a.) I use the calendar card, and wonder, why I see the full calendar and not only the actual day. as I though “days: 1” shows only one day.

b.) At the end, I want to transfer the ONE calendar day to my ESP32 ePaper and show it on the ePaper.

My idea is to ready make a text sensor with all the data, that I than can transfer to the ESP.

Has anyone a pointer for me, on how to do this?

Basically all the data you see above, just as a small text string, that I can send to the ESP.

thank you
Juergen

2:
Here’s how I do it but with multiple calendars and next 7 days. Create a template sensor and send it to your esp

 - trigger:
     - platform: time_pattern
       minutes: 45
     data:
         duration:
           hours: 168
           minutes: 0
           seconds: 0
       target:
         entity_id:
           - calendar.family
           - calendar.holidays
           - calendar.garbage
       response_variable: scheduled_events
     - variables:
         events: >
           {{ scheduled_events["calendar.family"].events + scheduled_events["calendar.holidays"].events + scheduled_events["calendar.garbage"].events }}
   sensor:
     - name: Calendar Scheduled Events
       unique_id: calendar_scheduled_events
       state: "{{ events | count() }}"
       attributes:
         scheduled_events: "{{ events }}"
       icon: mdi:calendar

Hi @Zinken

I put

- trigger:
    - platform: time_pattern
      minutes: 45
      data:
        duration:
          hours: 24
          minutes: 0
          seconds: 0
      target:
        entity_id:
          - calendar.juergen_calender
      response_variable: scheduled_events
    - variables:
        events: >
          {{ scheduled_events["calendar.juergen_calender"].events }}
  sensor:
    - name: Calendar Scheduled Events
      unique_id: calendar_scheduled_events
      state: "{{ events | count() }}"
      attributes:
        scheduled_events: "{{ events }}"
      icon: mdi:calendar

in my config.yaml

But it gives errors. I have no idea how to fix it. Or am I on the totally wrong trip?

thanks
Juergen

You need to put it under “template:” in your config.

Hi,
if I try to test the above at (by adding template: above and correcting the indentation)
developertools->template I get the error:

UndefinedError: 'scheduled_events' is undefined

I don’t understand it.
thanks you
Juergen

HI,
I don’t see a big difference to

template:
  - trigger:
      - platform: time_pattern
        minutes: "/5"
    action:
      - service: calendar.get_events
        data:
          duration:
            hours: 24
            minutes: 0
            seconds: 0
          start_date_time: "{{ today_at() }}"
        target:
          entity_id: calendar.juergen_calender
        response_variable: raw_events
      - variables:
          scheduled_events: "{{ raw_events['calendar.juergen_calender'] }}"
    sensor:
      - name: Calendar Scheduled Events
        unique_id: calendar_scheduled_events
        state: "{{ scheduled_events.events | count() }}"
        attributes:
          scheduled_events: "{{ scheduled_events.events }}"
        icon: mdi:calendar'

but this works. Maybe only due to the fact, that the trigger happens more often and I was too impatient. Many thanks @Zinken , you pushed me in the right direction.

thanks
Juergen

I am struggle to add a calendar in HA. I use the HACS ICS Calendar Integration

ics_calendar:
  calendars:
    - name: "Feiertage"
      url: "http://192.168.178.124:8123/local/ics/feiertage.ics"

I see the calendar in the calendar menu but the calendar is empty.

Anyone an idea waht causes this issue?

Please check your logs, and look at Calender Recently Started Failing Due to "recurring_ical_events.InvalidCalendar: The event definition for [...] only contains modifications." · Issue #145 · franc6/ics_calendar · GitHub There’s a known problem, that I’ve not had the time to fully track down yet. If your logs show the same as the logs that were posted, then its the same problem. If you see something with a different error or backtrace, please open a new issue.

Thanks!

I’m new to HA: I have created a new calendar with the UI. How can I change the config later? (I hope not to delete the calendar-entity and create a new one).
Thank you for your help

I’m sorry, but for now it’s a work-in-progress. Slow work, as I’ve got a lot on my plate, and this project isn’t a priority. For now, you need to delete and create a new one. OR, you can configure it via YAML, then instead of removing the yaml configuration after restarting HA, simply comment it out. When you want to change something, delete the entry through the UI, uncomment the YAML, make your change, and restart HA. Finally, comment out the YAML again. That’s probably a little faster than re-creating something through the UI, especially, if, like me, you tend to get interrupted a lot, and can’t remember what you had previously set. :slight_smile: