📅 Calendar Add-On + some calendar designs

I’m trying to use in a button-card the other script also, the family planner, I guess if there’s something to change due to card-mod new version.
For example, using this part of the code:

let calFabioState = states['sensor.fabio'].state;
      let calFabioData = states['sensor.fabio'].attributes.data;
      for (let i = 0; i < calFabioState; i++) {
        if (calFabioData[i].start_month == currentMonth) {
          let day = calFabioData[i].start_day;
          let summary = calFabioData[i].summary.replace(/'/g,'&apos;');
          let label = '';
          let startTime = calFabioData[i].start_time;
          if (calFabioData[i].whole_day) {startTime = 'Tutto il giorno';}
          if (calFabioData[i].label !== undefined) {label = '<span class="label">'+calFabioData[i].label+'</span>';}
          
          calendar = calendar.replace(`<div style="grid-area: c1_${day}" id="c1_${day}" class="event"></div>`, `<div style="grid-area: c1_${day}" id="c1_${day}" class="event"><span>${startTime} - ${summary}</span>${label}</div>`);
        }
      }

I can’t see the calendar events in the grid, i.e.:

PS: please note that I’m changing the calendar grid as I like :wink:

I really haven’t put any effort into that family planner design since my original post in this thread. Probably the entity atributes don’t match any more.
I’d advise you to look at this thread instead, that user has made a really beautiful family calendar solution.

1 Like

I cant figure out whats going wrong… as far as I can tell no sensors were created


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.500
You are running the latest version of this add-on.
System: Home Assistant OS 12.3 (amd64 / qemux86-64)
Home Assistant Core: 2024.5.4
Home Assistant Supervisor: 2024.05.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
System locale: en-US
Luxon locale set to: nl-BE
System timeZone: Europe/Amsterdam
Luxon timezone set to: Europe/Brussels
Number of calendars: 1
No previously stored events found
Error in getEvents: Error: ENOENT: no such file or directory, open ‘/config/366492799286-nmj0cqgp0umpe72luh596k90fgimgv3g.apps.googleusercontent.com’
at Object.openSync (node:fs:596:3)
at Object.readFileSync (node:fs:464:35)
at /app/index.js:320:37
at new Promise ()
at getEvents (/app/index.js:65:10)
at Task._execution (/app/index.js:495:27)
at Task.execute (/app/node_modules/node-cron/src/task.js:17:25)
at ScheduledTask.now (/app/node_modules/node-cron/src/scheduled-task.js:38:33)
at Scheduler. (/app/node_modules/node-cron/src/scheduled-task.js:25:18)
at Scheduler.emit (node:events:517:28) {
errno: -2,
syscall: ‘open’,
code: ‘ENOENT’,
path: ‘/config/366492799286-nmj0cqgp0umpe72luh596k90fgimgv3g.apps.googleusercontent.com’
}
Error posting events to sensor(s) at: Sat May 18 2024 22:30:00 GMT+0200 (Central European Summer Time)
Error: ENOENT: no such file or directory, open ‘/config/366492799286-nmj0cqgp0umpe72luh596k90fgimgv3g.apps.googleusercontent.com’
at Object.openSync (node:fs:596:3)
at Object.readFileSync (node:fs:464:35)
at /app/index.js:320:37
at new Promise ()
at getEvents (/app/index.js:65:10)
at Task._execution (/app/index.js:495:27)
at Task.execute (/app/node_modules/node-cron/src/task.js:17:25)
at ScheduledTask.now (/app/node_modules/node-cron/src/scheduled-task.js:38:33)
at Scheduler. (/app/node_modules/node-cron/src/scheduled-task.js:25:18)
at Scheduler.emit (node:events:517:28) {
errno: -2,
syscall: ‘open’,
code: ‘ENOENT’,
path: ‘/config/366492799286-nmj0cqgp0umpe72luh596k90fgimgv3g.apps.googleusercontent.com’
}

The error is quite readable here:

So you’re trying to work with a google calendar but have made an error with the service account keyfile. That filename looks odd and should be ending in .json.
And it also looks like you didn’t place the file in the right folder. Regarding the location I did notice on my own system that Home Assistant added a prefix to the addon config folder, so watch out for that.

Please read all instructions in the docs and the linked tutorials regarding obtaining and configuring the keyfile carefully and you should be able to get it working then.

Any idea how to share calendar with service account? Because when I try to share calendar it requeires other invited email to accept invite.

I just tested and for me the sharing option under google calendar settings still looks and behaves the same as in the screenshot in this post. I didn’t get the invitation expires text when I added another e-mail address.

I juat figured it out. The problem was I was trying to share family calendar which must be accepted by the invited side. Switched to non family calendar and it works.

Thanks for reply