Request for CalDAV Calendar Component

It is nice to see Google Calendar is finally supported by HA. However there are people like me who prefer to host their own data in their own server.

For Calendar service, I am using CalDAV calendar. It is hosted on my home network. So I don’t have to worry if I lose Internet connection. My calendar automation will still work.

I can see there is a caldav client library in python.

Please consider support this. Thanks.

2 Likes

I use NextCloud to sync my calendar using CalDAV, so would also be interested in this.

1 Like

Me too :hand_splayed:

Caldav support would be very neat! as i use nextcloud too.

oh yeah, need this too

The problem I have with calendar support in HA is that none of them look like… well, calendars. That and non-locale formatting of the date and time.

You mean a calendar on the front-end? Actually, it doesn’t have to look like a calendar. It is the events in the calendar that matters. From there, I can do all sorts of automations like appointments reminder, holiday greetings, birthday wishes, etc… I would use my existing calendar app to view and manage my calendar.

1 Like

Sure; any calendar support in HA works great as a source of triggers, I won’t dent that. But I like a proper display in the UI. I have seen Jinja projects that had actual calendars, like a month view display page. Nice, but I don’t need that level of interactivity.

Textual display of information like this in HA is kind of terse and lacking. For me, a text based calendar shouldn’t need title legends and there’s no way around this with sensors and HA.

Just a large date display along with an event times and the descriptions and descriptions below it. The way any calendar is displayed. I guess it’s a moot point as I’ll probably be doing this in HADashboard instead where it may be more appropriate.

I just feel it’s one of those things that serves automation triggers only. Like RSS support. You can use it for triggers (kinda) but nothing else. To have an RSS component and not even be able to display the feed in any configurable way seems like someone missed the point…

That is all that I would want it for. For me HA is a way to automate my house. If I have to use the front end, HA is failing me.

As masterkenobi says, I have plenty of calendar apps to look at my calendar, I don’t need HA to do it and HA would be the last place I look for it. There is a great danger in wasting resources trying to make HA do everything, instead of specialising in what it needs to be doing.

I respect your personal opinion, but remember it is just that. Some people really like and rely on the UI as a way of knowing what’s going on and interacting.

For example, I may not use MQTT switches at all but I am always grateful for improvements to the platform that make it more useful to people.

Yes, and the main reason for my post was that my opinion is different from yours. I am sorry if it came across as a rant, but for a component such as a calendar I do feel that a UI is unnecessary.

Similarly, this sentence from your post

I disagree with. The point of HA is home automation, not displaying RSS feeds, I have an rss reader for that. I think the developer had exactly the right idea.

I quite understand that people may want to use the front end more than I do, but that is not a reason to turn HA into an rss reader or a calendar app. Adding unnecessary ‘features’ will simply make it bloated and unwieldy (a bit like OpenHAB).

I’ve ended up sounding more strident that I wanted to again. Suffice to say our opinions differ on this one.

I’m ok with tons of useless features as long as it doesn’t effect the stability and speed of the system when I don’t install them.

Anyway, back to the topic.

Do anyone knows any progress on this request? Any whisper that this might get supported?

3 Likes

i use caldav with nextcloud and ia
caldav support will be very usefull

I’m currently working on a caldav component.

The first implementation is already done and I have it running on my home assistant instance in connection with nextcloud. The next steps are to add automated tests as well as documentation. As soon as I’m ready, I will commit the changes to the community (hopefully by the end of August).

I’d be glad if you help me test it. You can download the file from my personal GitHub Fork

4 Likes

thanks for the good news. i have copied calendar/caldav.py to my custom_components folder. but what do I put in the configuration file?

Sorry, I totally forgot to add a sample configuration.

The component works like the google calendar component. It allows you to create sensors for some events containing a keyword or to any event.

calendar:
  - platform: caldav
    url: '<dav url>' (e.g. https://mycloud.com/nextcloud/remote.php/dav)
    user: '<username>'
    password: '<password>'
    cert_path: <path to certificate (or False = no verification or True = trusted CA)>
    entities:
      - cal_id: <calendar_name> (e.g. Personal, the name visible on the nextcloud/owncloud WebUI)
        sensors:
          - device_id: <sensor_id>
            name: <friendly name>
            search: <keyword>
            track: True

More information on sensor configuration can be found here.

Thanks. But I received this error…

2017-07-20 14:07:21 ERROR (Thread-7) [homeassistant.util.package] Unable to install package caldav==0.5.0: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-88pgtog4/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mm9u9m53-record/install-record.txt --single-version-externally-managed --compile --home=/tmp/tmp4fwatnvh" failed with error code 1 in /tmp/pip-build-88pgtog4/lxml/
2017-07-20 14:07:21 ERROR (MainThread) [homeassistant.setup] Not initializing calendar.caldav because could not install dependency caldav==0.5.0
2017-07-20 14:07:21 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform calendar.caldav: Could not install all requirements.

This is what I have in my configuration…


calendar:
  - platform: caldav
    url: 'http://192.168.1.200/nextcloud10/remote.php/dav'
    user: 'XXXXXXXXXXX'
    password: 'XXXXXXXXXXXXX'
    cert_path: false
    entities:
      - cal_id: Personal
        sensors:
          - device_id: personal
            name: Personal
            track: true
      - cal_id: Holidays
        sensors:
          - device_id: holidays
            name: Holidays
            track: true
      - cal_id: School
        sensors:
          - device_id: school_events
            name: School Events
            track: true
            search: "School Events"
          - device_id: school_holiday
            name: School Holiday
            track: true
            search: "Holiday"
      - cal_id: Family
        sensors:
          - device_id: family
            name: Family
            track: true

Hey, Thanks for this component!

I installed it and it “technically” works.

Is it normal, that it doesn’t show any Appointments here:

how do you make it works? what do you put in your configuration? what HA version are you on?

calendar:
  - platform: caldav
    url: 'https://cloud.domain.tld/remote.php/dav'
    user: 'username'
    password: 'pa$$word'
    cert_path: false
    entities:
     - cal_id: Personal
       sensors:
         - device_id: Personal
           name: Kalender
           track: True

I didn’t do anything other than this:
Put the py File in /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/calendar/

1 Like