home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.07k stars 29.73k forks source link

caldav synchronizes recurring all day events one day too early #113454

Open stehlifn opened 5 months ago

stehlifn commented 5 months ago

The problem

What version of Home Assistant Core has the issue?

core-2024.3.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

caldav

Link to integration documentation on our website

https://www.home-assistant.io/integrations/caldav/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 5 months ago

caldav documentation caldav source

stehlifn commented 3 months ago

behaviour still present in core-2024.5.5

stehlifn commented 3 months ago
andarotajo commented 2 months ago

I think my problem goes into the same category. I have a weekly recurring all-day event for 2 days. So this week it would be from the 11th to 12th, always Tuesday and Wednesday.

When using calendar.get_events I'm getting an additional day for the end time. So it says the start time is 2024-06-11 (correct) and the end time is 2024-06-13 (wrong).

Edit: If it helps, this is my debug log for the service call. I requested the events from 2024-06-13 01:00:00 to 2024-06-13 23:00:00. Timezone is also Europe/Berlin and the Server I get my calendar from is my Synology NAS.

Path expected: /caldav/, path found: ['/caldav.php/'] Please raise an issue at https://github.com/python-caldav/caldav/issues or reach out to t-caldav@tobixen.no, include this error and the traceback and tell what server you are using.
Continuing, probably everything will be fine
2024-06-13 08:29:34.231 ERROR (SyncWorker_0) [root] Ical data was modified to avoid compatibility issues
(Your calendar server breaks the icalendar standard)
This is probably harmless, particularly if not editing events or tasks
(error count: 4 - this error is ratelimited)
NoneType: None
2024-06-13 08:29:34.232 ERROR (SyncWorker_0) [root] --- 
+++ 
@@ -26,7 +26,6 @@
 LAST-MODIFIED:20240613T062034Z
 DESCRIPTION:
 RECURRENCE-ID;VALUE=DATE:20240611
-DURATION:P2D
 END:VEVENT
 END:VCALENDAR

2024-06-13 08:29:46.877 DEBUG (SyncWorker_1) [caldav] sending request - method=REPORT, url=https://192.168.178.21:5001/caldav.php/hassio/roman--ummuuv/, headers={'User-Agent': 'Mozilla/5.0', 'Content-Type': 'application/xml; charset="utf-8"', 'Accept': 'text/xml, text/calendar', 'Depth': '1'}
body:
<?xml version='1.0' encoding='utf-8'?>
<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><C:calendar-data><C:expand start="20240612T230000Z" end="20240613T210000Z"/></C:calendar-data></D:prop><C:filter><C:comp-filter name="VCALENDAR"><C:comp-filter name="VEVENT"><C:time-range start="20240612T230000Z" end="20240613T210000Z"/></C:comp-filter></C:comp-filter></C:filter></C:calendar-query>
2024-06-13 08:29:47.014 DEBUG (SyncWorker_1) [caldav] server responded with 207 Multi-Status
2024-06-13 08:29:47.014 DEBUG (SyncWorker_1) [caldav] response headers: {'Server': 'nginx', 'Date': 'Thu, 13 Jun 2024 06:29:47 GMT', 'Content-Type': 'text/xml; charset="utf-8"', 'Content-Length': '752', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=20', 'DAV': '1, 2, 3, access-control, calendar-access, calendar-schedule, extended-mkcol, bind, addressbook, calendar-auto-schedule', 'ETag': '"8874e0b11b6fe1f2d76e1c217f03ad1d"', 'X-DAViCal-Version': 'DAViCal/1.1.12; DB/1.2.12'}
2024-06-13 08:29:47.014 DEBUG (SyncWorker_1) [caldav] response status: 0
2024-06-13 08:29:47.014 DEBUG (SyncWorker_1) [caldav] b'<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">\n  <response>\n    <href>/caldav.php/hassio/roman--ummuuv/1e4ubvscu9qnd0u52ssvfq8eoj.ics</href>\n    <propstat>\n      <prop>\n        <C:calendar-data>BEGIN:VCALENDAR\nPRODID:-//davical.org//NONSGML AWL Calendar//EN\nVERSION:2.0\nCALSCALE:GREGORIAN\nBEGIN:VEVENT\nDTSTAMP:20240613T062034Z\nUID:1e4ubvscu9qnd0u52ssvfq8eoj\nSUMMARY:Firma\nSEQUENCE:8\nDTSTART;VALUE=DATE:20240611\nDTEND;VALUE=DATE:20240613\nCREATED:20240607T083927Z\nLAST-MODIFIED:20240613T062034Z\nDESCRIPTION:\nRECURRENCE-ID;VALUE=DATE:20240611\nDURATION:P2D\nEND:VEVENT\nEND:VCALENDAR\n</C:calendar-data>\n      </prop>\n      <status>HTTP/1.1 200 OK</status>\n    </propstat>\n  </response>\n</multistatus>\n'
2024-06-13 08:29:47.014 DEBUG (SyncWorker_1) [caldav] b'<?xml version="1.0" encoding="utf-8" ?>\n<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">\n <response>\n  <href>/caldav.php/hassio/roman--ummuuv/1e4ubvscu9qnd0u52ssvfq8eoj.ics</href>\n  <propstat>\n   <prop>\n    <C:calendar-data>BEGIN:VCALENDAR\r\nPRODID:-//davical.org//NONSGML AWL Calendar//EN\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nDTSTAMP:20240613T062034Z\r\nUID:1e4ubvscu9qnd0u52ssvfq8eoj\r\nSUMMARY:Firma\r\nSEQUENCE:8\r\nDTSTART;VALUE=DATE:20240611\r\nDTEND;VALUE=DATE:20240613\r\nCREATED:20240607T083927Z\r\nLAST-MODIFIED:20240613T062034Z\r\nDESCRIPTION:\r\nRECURRENCE-ID;VALUE=DATE:20240611\r\nDURATION:P2D\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n</C:calendar-data>\n   </prop>\n   <status>HTTP/1.1 200 OK</status>\n  </propstat>\n </response>\n</multistatus>\n'