ICS Calendar platform

I’ve seen some bugs with parsing time zones properly. You could try switching to the beta version (or back from it) to see if that resolves the problem. Also, if you’d like, you can send me the ics file (scrub details you don’t want me to see, please), and I can check if it matches any known bugs, and add it to my list for when fixes are available.

Unfortunately, most of these types of problems are in the libraries I’m using, and I don’t have enough time to try something better. The beta and non-beta versions both have bugs, just different bugs. :slight_smile:

Please note that I probably won’t have time to look into anything you send me for several days, so please be patient.

Hello Tom, thanks for your fast reaction. I’ll just post the part of the ics file concerned hereunder:

BEGIN:VEVENT
DESCRIPTION:xxx\n
UID:040000008200E00074C5B7101A82E0080000000054CF99F279FAD601000000000000000
010000000503F5F596CF43C419C23B7EDA44E6985
SUMMARY:Bet
DTSTART;TZID=Romance Standard Time:20210701T190000
DTEND;TZID=Romance Standard Time:20210701T193000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20210701T193149Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION:L39
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-BUSYSTATUS:BUSY
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT

Thanks in advance!
Frederik.

Earlier in the file, do you see a VTIMEZONE entry for “Romance Standard Time”? If so, is it correct? There’s a known problem with some timezone entries being ignored, and it reverting to use UTC, but this appears to be adding 2 hours, not subtracting 1 hour (which is what I would expect given the bug). The other possibility I can think of is that the one library might be interpreting the timezone based on what’s defined in the system, rather than what’s in the ics file. But that just really seems unlikely. :frowning: I’ll add this to my test suite, and try to figure it out later. In the meantime, I’m really sorry it’s broken for you. Oh, and if you can post the VTIMEZONE entry (if it exists), I’d appreciate having that, too.

Hello Tom,

Indeed, the parser is adding 2h. I found the following VTIMEZONE attribute:
"
BEGIN:VTIMEZONE
TZID:Romance Standard Time
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
"
I can see OffsetTo +2h. But since i don’t know how this works, no idea what this means. Since it is generated by outlook.live.com I can’t change these values.

Thanks in advance in helping me out! If you want me to test something, let me know!
Frederik.

1 Like

Hi,

I’ve installed the platform and added some calendars but the events don’t show up in the calendar.
What am I doing wrong?

Here is my config:

calendar:
- platform: ics
  calendars:
      - name: "Afval"
        url: "https://afvalkalender.ilva.be/nl/calendar/ical/2021/8/12/97788"
        includeAllDay: True

(I try to add and ics from Ilva - trash collection)

Thanks in advance
Dries

A quick check suggests the calendar should work. Do you see any error messages in the home assistant log? And how are you checking the calendar?

Hi,

Since I’ve added calendars in my config, there is a calendar item in de sidebar where I can see the calendar (after a restart). I see the calendar but no events.
Also, when I add a calender card, no events are shown

Nothing special is shown in the log
UPDATE: In the log file i found the following:
Failed to open url: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
Also if I remove the ‘s’ in https

Thanks

I solved the problem by placing the .ics on an other webserver. Everything works fine now…
Probably it was the website of Ilva who caused the problem

Dries

I suspect the root certificates on HA are out of date. I’ve seen multiple reports like this, and sometimes up-to-date web browsers work just fine. :frowning:

Is it just me or is this plugin slowing Home assistant down drastically? Is it due to some initial loading of events or what do you suggest?

Can you exclude historical events to speed things up? And maybe limit coming events too? (e.g 30 days)

I have added a Office 365 calendar (work) that has a lot of history in it so perhaps thats why?

It has to parse the entire file before it can know what is old. It can’t even just skip X number of lines, because of recurring events. The current parsers are slow, but they do run asynchronously, so it shouldn’t be causing any large problem, unless, of course, you are running HA on a small system, like a raspberry pi. Both parsers also use lots of RAM, and the larger the file, the more RAM will be used. And that’s probably the cause of slowness with a large file.
I am working on another parser, but it doesn’t handle time zones at all, and I don’t think it calculates recurring events. So it’s got a ways to go. But I won’t have time for personal projects until next month, and you’re kinda stuck with “it’s good enough for me,” so it’s not at the top of my priority list. If anyone wants to help, I’ll gladly accept the help. :slight_smile:

1 Like

Hi!
First of all - Thanks for creating your code and making it available to everyone! Highly appreciated! :slight_smile:

So I think that my problem is that the calendar is simply too large. I have a pretty large x86/64 system running HA OS but this code simply makes everything sluggish. And when I go to the Calendar view I sometimes see the calendar entries, but sometimes they are gone or getting repopulated over and over.

How does it really work? Do you fetch and store it in a database locally?

Honestly i dont think its slowing HA due to the number of events or length; I imported a subscribed ics with literally only 8 days of events, and my entire HA system has slowed to a crawl since. I cant explain why either. Motion sensors take 15-25 seconds to trigger events, lights take around the same. It seems like this intergration is taking up resources constantly for some reason. I’ve gone through the code a few times, and i still cant figure out why it would be. But as soon as i remove the component, everything is back to normal. Super strange e

Hi There
could anybode let me know how to integrate a local stored calender into ICS. It’s stored on my SDD (use HA on a PI4), so how to address the local folder? I have tried several options as described, but no success. Even not with the external link stored/showed in the description. Thank you for any help.
On an external link I get: “The downloaded file can not be parsed, not a valid ICS file.”
Any help??

JJ

That doesn’t quite look like an error message from my ics_calendar project. I do know my project isn’t designed for reading from local files, largely because it’s difficult to make a file local to most types of HA installations. If you can make it a truly local file, try file:///absolute/path/to/ics/file. Note the three slashes after “file:”. I am curious about the error message, though. Can you send me the actual log output privately?

Hi, thank you for our reply. It looks I have been able to solve the issue. Following local link does work with my configuration HA on PI4 running: http://localhost:8123/local/calendar.ics

regards JJ

1 Like

I’ve started using ICS to pull through my work schedule for shifted days…I can see the date and times of the next upcoming 3 dates but the time is showing as UTC rather than my native timezone of Europe/London. All other times are correct apart from this particular HACS integration…is this a bug…or does it need some sort of another fix that I need to implement myself?

There a few possibilities here. Can you post your calendar to me privately? Please remove any personal info, e.g. just change the description, summary, etc to something generic, numbered so I can distinguish them. Also, please send me your config; I don’t need the URL, username, or password, just the other fields. That will help me figure out where the problem is. I suspect a bug somewhere, just not sure if it’s in my code, the parser, or even the calendar. A lot of programs might think your time zone is UTC, as that’s a common mistake. :frowning:

Works perfect. Just remember to put the file into ./config/www/

Hello,

I got a weird problem concerning the ICS calendar platform and all day events that last one single day.
I managed to connect my Kopano calendar to HomeAssistant via SSL (Let’s encrypt).

Everything else works fine:

  • umlauts
  • all day events that last two or more days
  • events that last a certain period of time, e. g. 8 am to 7 pm

As soon as I create an all day event that lasts one day, it is recognized for the day before.
Example:

  • event is created for 2022/09/11, all day
  • my mobile phone recognizes that event for 2022/09/11, all day
  • Kopano WebApp recognizes that event for 2022/09/11, all day
  • HomeAssistant recognizes that event for 2022/09/10, all day

This is an excerpt from the .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:20220907T230853Z
LAST-MODIFIED:20220907T230901Z
DTSTAMP:20220907T230901Z
DTSTART;VALUE=DATE:20220910
DTEND;VALUE=DATE:20220911
SUMMARY:Test WebApp ganztägig 11.09.
PRIORITY:5
CLASS:PUBLIC
UID:
040000008200E00074C5B7101A82E008000000008064F3D00EC3D801000000000000000001
 000000C5EA678954DE4A9D840365DFBE14C377
X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20220908T075343Z
X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20220908T075343Z
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:-1
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
END:VEVENT


Does anybody know how to troubleshoot this?

Thanks in advance,
David