Correct Config for calendar component (caldac, baikal, apache2)

I can’t get my calendar running in home assistant… Works perfect in Thunderbird but not in home assistant.

This is my config:
part of configuration.yaml:

calendar:
  - platform: caldav
    username: !secret caldav_user
    password: !secret caldav_password
    url: http://192.168.10.4:8018/cal.php/calendars/homeassistant/tasks
    calendars: tasks

apache config:

<VirtualHost 0.0.0.0:8018>
        ServerName baikalserver

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/baikal/html

        RewriteEngine on
        RewriteRule /.well-known/carddav /dav.php [R=308,L]
        RewriteRule /.well-known/caldav  /dav.php [R=308,L]

        LogLevel info
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

   <Directory "/var/www/baikal/html">
        Options None
        AllowOverride None
        Require all granted
    </Directory>

    <IfModule mod_expires.c>
        ExpiresActive Off
    </IfModule>
</VirtualHost>

baikal config /var/www/html/baikal/config/baikal.yaml:

system:
    configured_version: 0.7.1
    timezone: Europe/Paris
    card_enabled: false
    cal_enabled: true
    dav_auth_type: Basic
    admin_passwordhash: *CUT*
    auth_realm: BaikalDAV
    base_uri: ''
    invite_from: ''
database:
    sqlite_file: /var/www/html/baikal/Specific/db/db.sqlite
    mysql: true
    mysql_host: localhost
    mysql_dbname: baikal
    mysql_username: baikal
    mysql_password: baikal
    encryption_key:  *CUT*
    configured_version: ''

As stated thunderbird works fine, home assistant tells me:

2020-10-02 19:36:48 ERROR (MainThread) [homeassistant.components.calendar] caldav: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/homeassistant/helpers/entity_platform.py”, line 346, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.8/dist-packages/homeassistant/helpers/entity.py”, line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File “/usr/lib/python3.8/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.8/dist-packages/homeassistant/components/caldav/calendar.py”, line 146, in update
self.data.update()
File “/usr/local/lib/python3.8/dist-packages/homeassistant/util/init.py”, line 239, in wrapper
result = method(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/homeassistant/components/caldav/calendar.py”, line 203, in update
results = self.calendar.date_search(start_of_today, start_of_tomorrow)
File “/home/homeassistant/.homeassistant/deps/lib/python3.8/site-packages/caldav/objects.py”, line 594, in date_search
response = self._query(root, 1, ‘report’)
File “/home/homeassistant/.homeassistant/deps/lib/python3.8/site-packages/caldav/objects.py”, line 167, in _query
raise error.exception_by_methodquery_method
caldav.lib.error.ReportError: 500 Internal Server Error

b’<?xml version="1.0" encoding="utf-8"?>\n<d:error xmlns:d=“DAV:” xmlns:s=“sabre/dav”>\n <s:sabredav-version>4.1.0</s:sabredav-version>\n <s:exception>Sabre\VObject\ParseException</s:exception>\n <s:message>This parser only supports VCARD and VCALENDAR files</s:message>\n</d:error>\n’

and apache2 error and access log tells me this:

==> /var/log/apache2/access.log <==
192.168.10.4 - - [02/Oct/2020:19:51:32 +0200] “PROPFIND /cal.php/calendars/homeassistant/tasks/ HTTP/1.1” 401 1141 “-” “Mozilla/5.0”
192.168.10.4 - homeassistant [02/Oct/2020:19:51:32 +0200] “PROPFIND /cal.php/calendars/homeassistant/tasks/ HTTP/1.1” 207 1098 “-” “Mozilla/5.0”
192.168.10.4 - homeassistant [02/Oct/2020:19:51:32 +0200] “PROPFIND /cal.php/principals/homeassistant/ HTTP/1.1” 207 1086 “-” “Mozilla/5.0”
192.168.10.4 - homeassistant [02/Oct/2020:19:51:32 +0200] “PROPFIND /cal.php/calendars/homeassistant/ HTTP/1.1” 207 2363 “-” “Mozilla/5.0”

==> /var/log/apache2/error.log <==

[Fri Oct 02 19:51:33.785481 2020] [php7:notice] [pid 331104] [client 192.168.10.4:58680] Sabre\VObject\ParseException: This parser only supports VCARD and VCALENDAR files in /var/www/html/baikal/vendor/sabre/vobject/lib/Parser/MimeDir.php:163\nStack trace:\n#0 /var/www/html/baikal/vendor/sabre/vobject/lib/Parser/MimeDir.php(90): Sabre\VObject\Parser\MimeDir->parseDocument()\n#1 /var/www/html/baikal/vendor/sabre/vobject/lib/Reader.php(47): Sabre\VObject\Parser\MimeDir->parse()\n#2 /var/www/html/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php(513): Sabre\VObject\Reader::read()\n#3 /var/www/html/baikal/vendor/sabre/dav/lib/CalDAV/Plugin.php(258): Sabre\CalDAV\Plugin->calendarQueryReport()\n#4 /var/www/html/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\CalDAV\Plugin->report()\n#5 /var/www/html/baikal/vendor/sabre/dav/lib/DAV/CorePlugin.php(685): Sabre\DAV\Server->emit()\n#6 /var/www/html/baikal/vendor/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpReport()\n#7 /var/www/html/baikal/vendor/sabre/dav/lib/DAV/Server.php(470): Sabre\DAV\Server->emit()\n#8 /var/www/html/baikal/vendor/sabre/dav/lib/DAV/Server.php(251): Sabre\DAV\Server->invokeMethod()\n#9 /var/www/html/baikal/vendor/sabre/dav/lib/DAV/Server.php(319): Sabre\DAV\Server->start()\n#10 /var/www/html/baikal/Core/Frameworks/Baikal/Core/Server.php(119): Sabre\DAV\Server->exec()\n#11 /var/www/html/baikal/html/cal.php(74): Baikal\Core\Server->start()\n#12 {main}

and after this:

==> /var/log/apache2/access.log <==
192.168.10.4 - homeassistant [02/Oct/2020:19:51:33 +0200] “REPORT /cal.php/calendars/homeassistant/tasks/ HTTP/1.1” 500 687 “-” “Mozilla/5.0”

First apache gives me a 401 (unauthorized), and lager a internal server error 500… baikal seems to work just fine, but not with home assistant…

Link to home assistant github issue: calendar caldav component unauthorized access with baikal · Issue #41222 · home-assistant/core · GitHub
Link to baikal github issue: baikal not working with homeassistant caldav calendar component: unauthorized access etc. · Issue #982 · sabre-io/Baikal · GitHub