Skip to content

Office365 ics file download stopped working, might need a different User Agent header #72

@siebert

Description

@siebert

The integration fails to download a shared Office365 ics file. Apparently Microsoft is now more strict evaluating the User Agent Header, see this discussion for an Android App which also now fails with the same link:

bitfireAT/icsx5#654

Here is the error from the HASS log file:

============ ICS Integration Error ================
2025-08-20 09:57:36.649 ERROR (MainThread) [custom_components.ics.sensor] unfortunately ICS hit an error, please open a ticket at
2025-08-20 09:57:36.649 ERROR (MainThread) [custom_components.ics.sensor] https://github.com/KoljaWindeler/ics/issues
2025-08-20 09:57:36.649 ERROR (MainThread) [custom_components.ics.sensor] and paste the following output:
2025-08-20 09:57:36.650 ERROR (MainThread) [custom_components.ics.sensor] Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/icalendar/parser.py", line 326, in parts
validate_token(name)
~~~~~~~~~~~~~~^^^^^^
File "/usr/local/lib/python3.13/site-packages/icalendar/parser.py", line 115, in validate_token
raise ValueError(name)
ValueError:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/ics/sensor.py", line 179, in get_data
cal = Calendar.from_ical(cal_string)
File "/usr/local/lib/python3.13/site-packages/icalendar/cal.py", line 410, in from_ical
name, params, vals = line.parts()
~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/icalendar/parser.py", line 340, in parts
raise ValueError(
f"Content line could not be parsed into parts: '{self}': {exc}")
ValueError: Content line could not be parsed into parts: '':
2025-08-20 09:57:36.650 ERROR (MainThread) [custom_components.ics.sensor]
thanks, Kolja

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions