Caldav component

Man, I’ve tried for a few days and a few different things but cannot get the caldav component working properly. I keep getting errors and the latest one is …

Has anybody been able to get this working with a Synology calendar?

2018-06-25 14:10:11 ERROR (MainThread) [homeassistant.components.calendar] Error while setting up platform caldav
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 129, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/calendar/caldav.py", line 62, in setup_platform
    calendars = client.principal().calendars()
  File "/usr/local/lib/python3.6/site-packages/caldav/davclient.py", line 113, in principal
    return Principal(self)
  File "/usr/local/lib/python3.6/site-packages/caldav/objects.py", line 316, in __init__
    cup = self.get_properties([dav.CurrentUserPrincipal()])
  File "/usr/local/lib/python3.6/site-packages/caldav/objects.py", line 183, in get_properties
    properties = self._handle_prop_response(response, props)
  File "/usr/local/lib/python3.6/site-packages/caldav/objects.py", line 145, in _handle_prop_response
    for r in response.tree.findall('.//' + dav.Response.tag):
AttributeError: 'NoneType' object has no attribute 'findall'

My config is:
- platform: caldav
url: https://xxxxxxx:port
username: !secret calendar_username
password: !secret calendar_password
cert_path: false
calendars:
- Family

Did you find a solution to this?

Unfortunately not. I ended up removing it from my config and will try again later.

1 Like

I had two revery to using Google Calendar for the integration I wanted but would prefer to use Synology Calendar to keep everyone off the cloud. Please update this thread if you ever find a solutions.

:slight_smile:

It works fine with the nextcloud calendar. I suggest you raise an issue here to get it fixed.

@apt Got it working: configuration is as follows:

calendar:
  - platform: caldav
    username: !secret caldav-nas-verjaardagen-user
    password: !secret caldav-nas-verjaardagen-password
    url: https://[redacted]/caldav.php/[your-user]/[id-of-your-calendar]/

Do note that you have to append .php to caldav. So, it is not the exact url synology calendar gives you.

2 Likes

That’s awesome! Finally was able to get it working.

Thanks for your help!

Were you able to show the sensor attributes? I can see the different Synology calendars but none of the attributes.

If there is an event, they will show

OK, makes sense.

I’m testing now but it seems like you have to reboot HASS for any changes to show. Is that something you’ve noticed?

I think the sensor won’t update every min/hour/… as it is a pull type sensor (i.e. the calendar cannot push events to homeassistant).

Do you get full day events working? This does not work with me…

I have my Synology Calendar in HA now many thanks… but I don’t see the events. Do they only show if they are on the day in question?

I can’t get the full day events to work either. I’m still playing around with it and have a few full day events setup for tomorrow to see what it looks like.

Won’t work - I went through the code. All day events are ignored unless you create a custom calendar with search functionality

I created a bug report (https://github.com/home-assistant/home-assistant/issues/20999)

1 Like

They only show up if there is an event happening right now (so only during the duration of an event)

I see, so it’s really just a way to trigger automations based on the entries in the calendar. I actually wanted to display the content of the calendar or specific entires, for example when the next waste collection is. I think I mis understood the meaning the the component :frowning:

Indeed, it is mostly for automations.

If you want to visualize stuff (waste collection, …), take a look at the Lovelace Google Calendar component.That will allow you to do exactly want you want.

Disclaimer: I’m the original developer of that card

Thanks looks good. Because I couldn’t get CalDav working previously I went for an Google Calendar and integrated it into my setup. I was hoping to could use CalDav to keep everything in house. Your lovelace card looks good and it DOES mention CalDav integration from HA, how it that working if the HA CalDav solution only shows sensors?

My current solution.

02%20pm

There is the sensor (which is only true when there is an event right now) but home-assistant also has a rest api which gives you the 5 next events from now. That’s what I use there.

1 Like

Sneaky :slight_smile: