ICS Calendar platform

@Bill_Stork Can you send the calendar file to me, or post a link to it? If it contains sensitive data, can you scrub the sensitive material first? If so, that would help me track down the problem.
Thanks!

its from my kids school
- name: “School Calendar”
url: “https://calendar.google.com/calendar/ical/9ocnrnsu4lc912jcl77u8hrjtg%40group.calendar.google.com/public/basic.ics

Thanks. At a high level, I suspect I know what’s wrong – there’s about 2000 events in there, and the file is nearly 30,000 lines long. That takes almost a minute to process on one of my systems, so I imagine that it’s just too much on anything but the largest Pi. I’ll be taking a look at what I can do to address that. In the meantime, I’m afraid it’s just not going to work for that calendar. :frowning:

@franc6 I have the same problem with andrew.vint . This is the url for the calendar i’m trying to use
F1 ICS

@Stefos I’m not seeing anything wrong with the file. andrew.vint’s problem was a malformed ICS from Family Wall. Family Wall has corrected their issue and no longer produces malformed files. Are you seeing symptoms similar to Bill_Stork or j0dan? If so, I’m planning to change out the underlying library to see if that works better. It’ll take a day or two (mostly to ensure times are in the proper timezone), once I have time to get back to it.
Your patience is much appreciated!

I’m getting this. Didn’t spend much time troubleshooting, i didn’t know what to do. The configuration was ok, the ICS file is ok and accessible so i don’t really have an idea of what is going on

state: off
attributes: offset_reached: false

@bbrendon @Bill_Stork @andrew.vint @j0dan I’ve created a pre-release which might fix the open issues. If you’ve reported a problem in this thread, please install the 2.0.0-beta3 pre-release version, and let me know if it works for you or not.

@stefos I have no reason to believe this will fix anything for you, because I couldn’t reproduce any problems with the file you sent. However, it might be worth a try, anyway.

Thanks!

@franc6

Thanks for getting back to this! I’m getting this with 2.0.0-beta3.
Previously I was getting : https://github.com/franc6/ics_calendar/issues/8

2020-04-18 12:20:03 ERROR (MainThread) [homeassistant.helpers.entity] Update for calendar.brendoncal fails
Traceback (most recent call last):
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/opt/hass-prod-cfg/custom_components/ics/calendar.py", line 96, in update
    self.data.update()
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/opt/hass-prod-cfg/custom_components/ics/calendar.py", line 166, in update
    events = icalparser.parse_events(content=calendar_data, end=now)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/icalevents/icalparser.py", line 352, in parse_events
    rule = parse_rrule(component, cal_tz)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/icalevents/icalparser.py", line 409, in parse_rrule
    dtstart=rdtstart)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/dateutil/rrule.py", line 1731, in __call__
    return self._parse_rfc(s, **kwargs)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/dateutil/rrule.py", line 1653, in _parse_rfc
    tzinfos=tzinfos)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/dateutil/rrule.py", line 1560, in _parse_rfc_rrule
    return rrule(dtstart=dtstart, cache=cache, **rrkwargs)
  File "/opt/python-venvs/hass/lib/python3.7/site-packages/dateutil/rrule.py", line 470, in __init__
    'RRULE UNTIL values must be specified in UTC when DTSTART '
ValueError: RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware

@bbrendon
:frowning: I goofed; I was using a truncated version of your data when testing. The new library has a similar problem with your data. Basically, it doesn’t like the fact that you’ve got all-day events with an repeat rule that ends on a date and time. The error message isn’t quite right. I’m trying to determine if it’s something wrong with the data or not. It certainly looks weird, especially since most of the similar events have a repeat rule that ends on a date (no time). You could try deleting and re-adding those events to see if they get saved more logically, but I’m not sure that would fix anything, and it would probably be a lot of work to find every instance of a problem (I do know that it happens more than once). :frowning:

Considering my ICS file is 500kb, I think I’ll just wait to hear more from you on this. :slight_smile: Thanks for the update.

1 Like

There’s a new pre-release, 2.0.0-beta4, which only fixes the lack of asynchronous I/O. I’m pretty sure it’s been wrong since the first release, as a copy/paste error (i.e. I pasted the synchronous call over top the asynchronous one). It should be more efficient now, and Home Assistant 0.109.x won’t complain about it. :slight_smile:

Please if there’s any opportunity for that, add authenticated access to upcoming feature list. I’m afraid till I get my hands around it there gonna be flying cars in the streets

What’s the use case? My initial expectation was that most users wouldn’t need authenticated access for this, and instead would be able to use the built-in CardDAV platform. I just want to be sure it’s worth the time, and that your use case would be covered before I start making changes. :slight_smile:

I’m using Google Calendar and my corporate calendar. The latter one is password protected ical, so the only place I can view my whole schedule and plan my day correctly is the macbook and frankly it’s a bit annoying.
After some time the company I’m working with issued an app for android, so I could sync it with my phone calendar app alongside with gcal, so my life got a little easier.
But now I started using morning automations (mainly lights automation and triggering radio on the smart speaker - as the morning alarm) and I’d reeealy like to make those automations considering the first scheduled meeting I have.
Already searched for some kind of proxifying tool from password protected ical to regular one - but so far no luck

What kind of authentication are they using? Or do you not know? If you don’t know, it might take some back-and-forth to determine if the case is covered. Fortunately, this ought to be easier than finding a parser that’s not broken for somebody. :frowning:

Sorry for vanishing like that - remote work just eats all of my time.
Couldn’t find any relevant information regarding authentication type, but there are articles about configuring it for different platforms. Unfortunately it’s all in russian =(
Anyway if I can help - you can obviously count on me, but not on my fast reaction(

The service is located here https://calendar.mail.ru/ and it is a part of mail.ru services

https://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fhelp.mail.ru%2Fcalendar-help%2Fsynchronization%2Fandroid%2Finstall

Given that the English translation references CalDAV, I’m guessing that’s what the service is using. In which case, it would be more appropriate to use the caldav platform instead of this. See https://www.home-assistant.io/integrations/caldav/ for more information. It’s buggy with all-day events*, but otherwise seems to work well.

* All-day events are interpreted as being UTC instead of local time, while other events are correctly interpreted for their time zone.

@franc6 Dude, thank you so much for this! finally I am able to sync my Outlook.com calendars! Much love :heart: to you!

1 Like

This is a really lazy request…
Can you show me your config for getting this to work with Outlook please.
(hiding private info of course)

Thanks.

HI,

can one help me pls?

i have now 4 Sensors:

I don’t manage to show them in lovelace.

How do you show it on Lovelace?

Does anyone have an example?

Thank you