šŸ“… Calendar Add-On + some calendar designs

You seem to be looking at getting an automated card in your interface?
That is not supported.

There is also no need to create that entry in configuration.yaml

This add-on will give you the raw data in a sensor (that can be viewed via states overview under developer tools). You then have to manually add the data to a card (via templating or javascript), thereā€™s an example template in the docs.

Clear. Thank you!

Some how my configuration does not give me a sensor.

The caldav-server I try to connect to is a Synology Calendar implementation. It supports synchronization with CalDAV clients such as Thunderbird, macOS, and iOS that are compatible with the CalDAV protocol. I tried both URL-strings for Thuinderbird and iOS.

The iOS integration URL-string works fine in HA Calender with de HA standard CalDAV integration and with CalDAV Synchroniser in Outlook365 .

I hope someone out here has experience with this Synology Calendar environment and how to connect to HASS Calendar Addon.

With this config in the HASS Calendar addon I do not get the sensor.tonneke in Development Tools > States

- calName: tonneke
  calType: caldav
  username: "!secret calendar_caldav_username_ton"
  password: "!secret calendar_caldav_calendar_caldav_password_ton"
  caldavUrl: http://xxx.xxx.xxx.xxx:20002/caldav.php/ton/

image

Overall HA Log does not show sensor.tonneke either.

HASS Calendar Log has no errors:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Hass Calendar Addon
 Addon to consume caldav and google calendars and make calendar events available as sensordata in Home Assistant.
-----------------------------------------------------------
 Add-on version: 0.300
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.3  (amd64 / generic-x86-64)
 Home Assistant Core: 2022.11.2
 Home Assistant Supervisor: 2022.10.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started

Your add-on log is not complete, it only shows the Docker start-up logging and none of the add-on specific logging. The add-on specific logging starts with locale and timezone information, then further logs all ics files that get processed.

If no furhter logging is present then either your caldavUrl is not correct or my add-on is incompatible with your Synology calendar. As I donā€™t have a Synology device myself, you would have to debug and document example caldav queries yourself. If youā€™re up for that then please do so via a github issue, thatā€™s a better place for that kind of stuff than this forum.

1 Like

I have released a new version:

# Changelog

## 0.301 | 2022-11-19

Bugfix for sorting of caldav calendar events.

## 0.300 | 2022-11-15

šŸŽ NEW
- Now with proper recurring events support for caldav calendars (limited to yearly, monthly, weekly, daily recurring). Check out the docs for more details.
- Added option to fetch calendar items from the past as well.
- Start- and end-dates are presented in localised format as standard. An extra field with the unlocalized ISO-date is also available.

šŸ› BUGFIXES
- There should hopefully be no more errors in the date/time offset as the add-on uses new libraries for parsing the ical-data and for formatting dates. I also did some extra testing with sample data and had no more issues myself. If a faulty date/time still appears for you, then open a Github issue and provide a sample ICS file.

šŸš§ BREAKING CHANGES
- I renamed some of the data fields, they all use camelCase now. You might have to rename them in your YAML code too if you use these fields. The new standard formatting for start- and end-dates might also impact your existing implementation.
- **Baikal support untested!** If you use this add-on with a Baikal calendar and use the 'baikal' type in stead of 'caldav' in the add-on options, then **I'd advise you don't update the add-on immediately and first test out this new version by installing it locally.** Also non of the new features have been applied to the baikal option. If someone wants to volunteer to debug and develop the Baikal part of the add-on feel free to reach out on Github.

To Baikal calendar users that use the jcal-export plugin and the ā€˜baikalā€™ option: I would refrain from updating (see changelog).

I did a lot of undocumented trials with the URL binding to the Synology Calendar. It turned out that:

  1. With HASS Calendar v3.01, this URL works:
caldavUrl: http://xxx.xxx.xxx.xxx:20002/caldav/ton/home/
  1. I have to be more patient before the sensor shows up
  2. It is beter to test the connection by testing it with a limited nummer of days (instead of 365ā€¦ :joy: )

Anyhow: it did make query log files (info-log as well as debug-log with Outlook CalDAV Synchronizer addon for Outlook desktop application) . Though not necessary at the moment, I can send them to you. If you are interested, let me know and let me know how (as private as possible, rather not public.)

I can also grant you an account on my Synology Calendar platform for remote testing.

Iā€™m using a google calendar but I canā€™t seem to get all the information in the data attribute.
Missing summary and label, everything else is there. Any idea as to why?

Using this card code on GitHub I want to add below card to my Lovelace dashoard.

image

However on my dashboard it looks like this with ā€œundefinedā€.
What am I doing wrong?

image

My configuration of the addon is:

locale: nl-NL
timeZone: Europe/Amsterdam
fetchDays: 14
fetchDaysPast: -14
fetchCRON: "*/30 * * * *"
calendarList:
  - calName: agenda_ton
    calType: caldav
    username: "!secret calendar_caldav_username_ton"
    password: "!secret calendar_caldav_calendar_caldav_password_ton"
    caldavUrl: http://xxx.xxx.xxx.xxx:20002/caldav/ton/home/

In editting mode the yaml of the card looks like this:

The development tools is showing correct date attributes:

HASS Environment:
Hass Calendar Addon version: 0.301
Home Assistant 2022.11.4
Supervisor 2022.10.2
Operating System 9.3
Frontend-versie: 20221108.0 - latest

You are using an outdated version of that example card code. Your link points to an older git version. The updated code with the new datafield names is here: hassio-addons/onePersonNext4.yaml at 37638798994b67541061f059350e7fac15eb5136 Ā· kdw2060/hassio-addons Ā· GitHub

1 Like

SOLVED

With the newest code: works like a breeze! Thank you @kdw2060 Kris!

Just one more strange thing: The output of the sensor gives me a lot of entire day - recurring items.

When I use them in the card :

  • they appear in the selection (+14 <> -14) eventhough they should not be according to their dates.
  • they appear sorted on top eventhough they should not be according to their dates.

The states in thge development tools show: recurring ā€˜falseā€™ but in Synology Calendar (and outlook via CardDAV Synchorizer addon) they actualy are recurring

SOLUTION:

If you can download some ics files of those events, I can have a look at the cause. Please open an issue on Github for this and include the files there. btw, no promises time-wise as to when I might find time for this.

1 Like

I compared a good functioning good_event.ics with a bad functioning bad_event.ics in Visual Stucio Code. It turned out the bad functioning bad_event.ics is missing the tag:

X-MS-OLK-AUTOSTARTCHECK:FALSE

I added this tag mannually to the event.ics-file and imported the corrected event in MS Outlook. Now it shows up allright HASS Callendar Add-on well. Cause identified.

Over the years I used many Caldav / Calendar services and clients. I guess these are ghosts from the past. I will correct all disobedient events manually with a firm hand.

Your offer to inspect the bad *.ics-files inspired me to do it myself @kdw2060. Thank you for that and for your support. If you have any questions or want to inspect the *.ics yourself, do let me know.

This post is a solution to post :

1 Like

Lovely card!
I finally managed to get the sensor.
Is there a way to insert one card into multiple calendars? for example, I have my work-mail calendar and personal calendar.

Thatā€™s surely possible, but youā€™ll have to adapt the javascript code to achieve this. Custom button card can do anything you can imagine because it allows you to write your own html/css/javascript and work with the entities-data that Home Assistant provides. But that off course assumes you have some web-development skills and know how to write code.

If you donā€™t then the easiest would be to just duplicate my button card template and render 2 cards side by side.

1 Like

hi!

I finally managed to get the sensor working with a google calendar. I am a bit of a newbee, so Iā€™m happy this works!

However, the next step is to add the cards. I thought this would be easy using the code Ton van Loon and you wrote about last November. Now I end up with this:

image

Iā€™m probably missing something easy, but maybe you guys can help me out?

Thanks!

I can see two things:

  • you probably donā€™t have card-mod installed which is necesarry for the styling. You can find card-mod in HACS.
  • you have not updated the image-url to point to a photo/image that you want to use. Either upload to the www folder of Home Assistant and adapt the example link or you could also link to some image on some website.
1 Like

Thanks! That worked!

Some other questions. Is there a simple way to only show items for the next 24 hours?

And within the same account I have various calendars (birthdays, different people of the family), can this card show events from all calendars? This may have been asked before, but maybe if itā€™s in the same account itā€™s possible?

Thanks again!

Ps. Iā€™ll start learning python soon, hopefully thatā€™ll help a bit :slight_smile:

Some other questions. Is there a simple way to only show items for the next 24 hours?

Yes, just limit the amount of days to fetch to 1 in the addon settings, or alternatively write a template that contains the necessary logic

And within the same account I have various calendars (birthdays, different people of the family), can this card show events from all calendars? This may have been asked before, but maybe if itā€™s in the same account itā€™s possible?

Euhm, just look at the question right before yours. Youā€™ll need to configure a calendar in the calendarList for every calendar.

Ps. Iā€™ll start learning python soon, hopefully thatā€™ll help a bit :slight_smile:

Not necessary for working with the add-on data. Though the jinja templating syntax that Home Assistant uses is related to python, so wonā€™t hurt to learn python.
Personally I prefer writing javascript in a custom button card. I find javascript easier to understand and work with, but thatā€™s personal preference.

1 Like

Hi All,
Hoping I may get some insights here - I have installed the addon, and restarted HA. The addon starts but then stops with the below logs.
I have a ā€œfeelingā€ that it may have to do with the system locale being set to en-US, while Iā€™m in IE, but I canā€™t seem to get the system to reflect reality - I have updated the system settings.

If anyone can help would greatly appreciate it!
thanks in advance

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Hass Calendar Addon
 Addon to consume caldav and google calendars and make calendar events available as sensordata in Home Assistant.
-----------------------------------------------------------
 Add-on version: 0.301
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.2.5
 Home Assistant Supervisor: 2023.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
added 80 packages, and audited 81 packages in 24s
23 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 9.1.2 -> 9.5.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.5.1>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
System locale: en-US
Luxon locale set to: en-IE
System timeZone: Europe/Dublin
Luxon timezone set to: Europe/Dublin
node:internal/fs/utils:347
    throw err;
    ^
Error: ENOENT: no such file or directory, open '/data/allFutureEvents.json'
    at Object.openSync (node:fs:590:3)
    at Object.readFileSync (node:fs:458:35)
    at Object.<anonymous> (/index.js:509:30)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/data/allFutureEvents.json'
}
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Has nothing to do with the timezone. Thereā€™s a bug I need to fix. See this issue on Github that also contains a workaround.

Thank you for your quick response! Got that fixed, but then got the below error:

Calendar(s) queried at: Fri Mar 03 2023 18:30:00 GMT+0000 (Greenwich Mean Time)
postEventsAllCalendars error: TypeError: Cannot read properties of undefined (reading 'length')
Events posted to sensor(s) at: Fri Mar 03 2023 18:30:00 GMT+0000 (Greenwich Mean Time)
There was an error loading the gcal data: Error: Not Found

So after reviewing instructions found I had not added the service account to access the calender. Checked the instructions, and there does not seem to be a way to add the service account to a google ā€œfamilyā€ calender.
The is a way to give family members access, but not individuals (which is visible for my own personal account).
Tried to add the service account to the family account - but it needs to be validated - something which Iā€™ve read cannot be done.
Anyone have any sucess in adding a family calender?