📅 Calendar Add-On + some calendar designs

Looked into it as I don’t use Apple calendar myself. Like usual Apple makes it quite hard for you to use it outside their ecosystem. If you didn’t do this already, you need to obtain your caldav url through the steps layed out in the highest voted answer here: caldav - How to sync ICloud Calendar? - Ask Ubuntu
And then also generate an app-specific password like explained there.

I tested in Postman and the requests my add-on makes work as expected then. But the xml-response you get from the icloud server is slightly different from the one I’m getting from GMX I see, which makes that indeed the events will not be loaded. I need to adapt my code to make it work. I’ll see if I can find time in one of the next weekends.

1 Like

The solution wasn’t that complicated, I pushed an update to Github that should improve compatibility for different caldav providers.
For your Apple icloud calendar, your calendarUrl should look like https://*******.icloud.com/{dsid}/calendars/{calendarName}/ (Don’t forget to include the trailing forward slash)

2 Likes

Hey, thanks for your elaborated reply and i will definitively look into that =) this would be so awesome :slight_smile:

Edit: This solved the issue - i also had to start new calendars, because my old ones seemed not to work - now everything setup and running - thank you :*

Lil time in your addon, and it seems that the startDate of all my entries is about one day wrong (2/9/22 → 2/10/22). is there a way around?

Hiya…

I’m struggling to get this up and running on a Google calendar. I’ve followed most instructions with no problem(I think).
The step I’m unsure about is where you store the .json file on Ha, I had no folder named “share”. So I created 1 in the config directory and used that, I also copied the file to the config directory. These 2 options don’t appear to work, any pointers greatly appreciated :pray:

The easiest way would be to use the official Samba addon (install from addon-store in HA), this should expose the /share folder as a network folder. Just copy the file into the shared folder then.
I personally use ssh to connect to my HA install, the folder then shows up here in my case (supervised install on debian):
ksnip_20220201-161552

Did you change the locale from its default ‘nl’ setting in the config? My guess is this causes the issue.

Thanks Kris,

I’ve found the share folder now and copied the .json to that location, I’m a step further forward now but not quite there.

This is my config.

And this is the error.

I suspect I’ve made an error on the google side of things, I shall do some more tinkering In a bit :wink:

That could do the trick, changed it to de but will try out some. Thanks for your answer :slight_smile:

Edit: Still persisting - and is probably something with the icloud integration. its not for every event true, and for those events the endDate is correct and also start_day is correct and for recurring events start & endDate are correct - i dont get the point, sorry for bothering you with this. I

This probably happens because you have not yet shared your calendar with the service-account.
Give acces to the service-account client_email (it can be found inside the json file if you don´t remember) here in the calendar settings (screenshot shows dutch language, but you’ll be able to deduce I guess):

That fixed It … Thanks

Could very well be an issue with my code as well, I only have my own data to test against of course. Are you familiar with how to install an addon locally? I could then give you a version of the code that will log the data to the console.

How is it supposed to work with nextcloud? my config is:

calendarList:
  - calName: Events / Appointments and Birthdays
    calType: caldav
    locale: fr
    username: thorsten
    password: xxxxxxxxxxxxx
    caldavUrl: https://cloud-space.ddns.net/remote.php/dav

But logs only show:

[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
added 62 packages, and audited 63 packages in 7s
21 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities```

may additional info: my password starts with a % and i put it in config like :password: '%%xxxxxx'

im sorry i never did this bevor, but if you have a website with a how-to i will try to get it working.Perhaps a easy fix would be to change the format of “start_month” to a more generic “02” instead of “Feb.”, with that i could imagine to build a sensor for the sensor:D

The information on how to install an addon locally is available in the developer docs: Tutorial: Making your first add-on | Home Assistant Developer Docs

But instead of creating a new hello_world folder in your local /addons folder you need to copy the files of my addon there. Easiest is to download my repo as a zipfile from github, then unpack the hass-addon-calendar folder to your local /addons folder.

Now delete index.js and rename indexWithExtraLogging.js to index.js.

Then follow step 2 of the tutorial. You don’t need the next steps or the other info pages.

To eliminate confusion uninstall the addon that you installed previously via my repository.

Now upon running the locally installed add-on the logs should show the raw data of your calendar. If the information there is too private you can send it to me via a direct message.

I have no nextcloud install to test against so I hope you can debug yourself what is going wrong.
The log you posted seems to indicate you didn’t wait long enough for the addon to query and post your caldavprovider. As explained in the docs it queries only every 30 minutes, so you might have to wait up to 30 minutes.

As for the password: in yaml the ’ ’ is not needed normally, though it could be that including them is accepted as well.

You could also try to follow the advice I gave Flipso about installing the addon locally with extra logging.

Earlier before updating the add-on I strangely had data in the sensor…after not … well I downgraded and will wait tomorrow if it fills up with my data again

Hey there, sorry for my slow replay here - will come to this at the weekend and will try to get everything to logging and send it to you then. thanks for all you effort here=)

It may help to delete the json file with backup of your calendar when you change the configuration. I still need to improve the code when it comes to dealing with changed config. You can find that file here in the HA filesystem:
ksnip_20220205-210321