Local_calendar ics file import option

Doesn’t have to be off. I simply added a dummy event to make HA write the ics file to disc initially, then opened it in the FileEditor addon and replaced the contents with the ones from my ics file. Then restarted HA and my events were all “imported”. A native option is nicer of course.

3 Likes

In which folder do you find the correct file? I’d like to do the same as the topic starter, since I’m planning to make some automations based on the trash collection. I’d like to do it local with the ical file.

Makes total sense, so we could download ics files from locations and import them. I see huge potential for school calendars and also trash calendars

3 Likes

@daywalker03 @Soukyuu what is the file name in that location? I don’t see anything obvious i.e. *.ics

Thanks, that worked, easy fix! For info the file name and path will be /config/.storage/local_calendar.name_of_your_calendar.ics

1 Like

I’d like this with live calendars,

  • Trash changes sometimes
  • F1 calendar to inform me a session starts
  • Birthday calendar so every user in the house gets notifications
  • School calendar for important events for the children (changes by the day)

Is there a way to script a refresh every x hours so the
/config/.storage/local_calendar.name_of_your_calendar.ics
gets live data from an ICS url? Can’t think of a way to push data into that location.

Hello all - trying to import my local ics calendar into HA. I’ve checked the above location “/config/.storage/” but there is no calendar there even though I have one configured. Can I just copy or upload a file for HA to automatically recognize?

Hi!

just copy / upload your .ics file to path (example)
/config/.storage/local_calendar.school_bell.ics

goto http://homeassistant.local:8123/developer-tools/service

execute
service: homeassistant.reload_config_entry
data: {}
target:
  entity_id: calendar.school_bell

where calendar.school_bell is name of calendar identity

That’s all.

Okay I copied the file to the location described:
/config/.storage/local_calendar.RHS23-24.ics

Then I went developer-tools/services and input the following:

But I get an error - Failed something. What am I missing? Do I need to create the local calendar entry first?

Ok. Let’s go step by step, ok?
Go to UI and create manually empty calendar. Just create a new calendar. You may create a new item here as well.
A new calendar also you can see at the left menu at your HA dashboard.
At this step in HASS folder /config/.storage/ you can see a new .ics file with name entity what you create a 1 minutes ago.
Please do not move next while you a not pretty sure :wink: what you can see a new brand file :wink: in HASS folder.
The next step is very easy - just replace - override this file with own. Attention again :wink: please keep name as is! Do not need to rename etc file. Ok?
The last step is reloading calendar in HASS. Just GOTO to dev menu and make a some magic like you show before in the screenshot.
That’s all talks :wink: (c)

2 Likes

And btw. Keep in mind what name in Unix is case sensitive!
RHS23-24.ics And rhs23-24.ics and rHs23-24.ICS two big differences

1 Like

Thank you for the complete explanation. I guess I missed the fact that I needed to use the UI to create the calendar in the first place. Now everything is working!!

1 Like

Hi guys, I followed @10der his instructions but somehow something goes wrong.

I had an empty calendar and put the ics in place with the same name: no result.
Then I created a new calendar and put the ics in place with the new name: no result either. (it seems I had to add an event so that the ics file in HA gets created)
Next, deleted all calendars and started over again: no result.

What happens also: after reloading the service the calendar is gone from the calendar application whereas it still shows up in the integration but the entity is unavailable.
I checked the linux file permissions and they are OK so it’s not that.

What am I missing?

A two question here =)

  1. do you reload calendar (via dev service console) after replacement file?
  2. r u sure what your calendar is OK? Yep, a strange question but alas. Can you upload your calendar for example to google or for example again to this service click (not ads! sorry for link)?

thank you @10der for explaining this.

but honestly… why is there no simple import button?! is almost unbelievable

Hi, local calendar developer here. It just needs to be designed and added. Keep in mind this is done in volunteer time, so someone has to be motivated to do this.

I personally don’t have a use case for this so I haven’t done it myself yet, but it’s been on the bark burner " Todo list" for awhile. (I put time on Todo lists instead)

4 Likes

Sir, hi
First of thank you :wink:
Second, thank u a very much for this component :wink:
And last. My IMHO one feature is absent: can’t able to setup RRULE :frowning:

Hi, thanks!

Can you elaborate? Rrules are supported. Maybe you mean via service calls is a gap? Yeah that’s true, only supported in the UI right now.

yep! Lack of calling API.

I searched for a similar thing.
Once a year we get a new trash day calendar via a PDF file from a company that is taking the trash.
Then I must manually add all entries to 5 calendars (mix, plastic, glass, paper, bio).
Ideally, I’d like to enter those days in a csv file and import them via a service call.

Ideally, I need two services:

  • clear all events from a given calendar for a given time
  • bulk import/insert events to a given calendar

This way I could import all the events, clear the entire year, and reimport events (when I make a mistake or the company sends an update).