Is there a way to get the number of calendar events for ātodayā? Iāve tried ā0ā days in the config, but Iām getting this error:
Calendar(s) queried at: Tue Mar 07 2023 14:30:00 GMT+0000 (Greenwich Mean Time)
postEventsAllCalendars error: TypeError: Cannot read properties of undefined (reading 'length')
Events posted to sensor(s) at: Tue Mar 07 2023 14:30:00 GMT+0000 (Greenwich Mean Time)
0 entries found in google calendar
There is an entry for today scheduled, so if it worked would expect it to pull in that entry, as it has done sucessfully for days into the future?
You can leave the fetchDays parameter set to however much days in the future as you wish, what you should do in this case is use scripting in the card you use to display the calendar.
My add-on gives you the data in all kinds of easy to work with formats, but some knowledge of scripting is required to use the data. Like it says in the add-on docs use either the Home Assistant templating syntax (jinja2) or javascript (in a custom button card) to parse/filter/transform the data.
I canāt find any info if this addon works with build in home assistant local calendar. I already have the local calendar conficured to sync with icloud. Is there a way to configure it to use local data?
- calName: home
calType: caldav
username: username
password: password
caldavUrl: http://something (only for caldav/baikal)
calId: googleCalendarId (only for Google Calendar)
googleServiceAccountKeyfile: yourServiceAccountJsonKeyfile (only for Google Calendar)
What would be the url for local calendar? Struggling to find an example.
The addon was made before the advent of the local calendar in Home Assistant and is meant as an alternative to the calendar integration. So no, wonāt work with a local calendar.
In this thread it is mentioned there is an undocumented api endpoint for the local calendar for which you could set up REST api calls. You could go that route or if you want to use my add-on then follow the docs about apple icloud that are available on the addonās github repo.
Iām currently using it to parse my calander events for today to display on the dashboard.
This works but is there a more efficient way to do this?
{% set day_sec = 86400 %}
{% set today_start=as_timestamp(today_at().isoformat()) %}
{% set day_end = day_sec +today_start %}
{% for calendar_item in state_attr('sensor.apple_bins_calendar','data') %}
{% set meeting_start =as_timestamp(calendar_item.startDateISO) %}
{% if meeting_start >= today_start and meeting_start <= day_end %}
ā»ļø {{calendar_item.summary}}
{%endif %}
{% endfor%}
Then to take this further I have several calendars for each member of the family, lets call them sensor.apple_calendar1, sensor.apple_calendar2, sensor.apple_calendar3, sensor.apple_calendar4
What is the most efficient way to loop through all these and then get todayās events in start time order?
Hello everyone,
I have installed āHASS Calendar Addonā, but I canāt see a sensor anywhere, what am I doing wrong.
Can someone help me with this?
Thanks for every response
Hi Bart, I see you have also asked this question in another thread. I will answer here however, because I donāt want to pollute the other thread thatās about more than just my addon.
So after the second fetch run the 401 error is visible in your logs. 401 means āunauthorizedā, so something is not correct with your login/password or your google service account access.
You have not posted any information about what type of calendar youāre using (caldav or google).
If itās caldav: review the login/password and the caldav-url options.
If itās a google calendar: be sure to follow all instructions in the addon documentation about setting up the serviceaccount and also granting it access rights to the calendar.
400 is bad request, but concentrate on fixing the authorization issue first. As youāre using iCloud, have you generated an app-specific password as required by Apple? You cannot use the password you login to iCloud for the addon, but need to generate that extra password.
Be sure to read all the info on the 2 pages I link to under āApple icloud caldavā in the addon docs.
Iām trying to install this for my google calendar but I cannot get it to work. I think I followed all steps but I get this error:
postEventsAllCalendars error: TypeError: Cannot read properties of undefined (reading ālengthā)
Events posted to sensor(s) at: Mon Apr 24 2023 16:20:00 GMT+0200 (Central European Summer Time)
There was an error loading the gcal data: Error: Not Found
things I did:
Install the addon
created a service-account and put the json file in the share folder. I did this via uploading the file via āStudio code serverā and then moving it via the terminal in HA. I do not have a screen that I can connect to my raspberry so I had to use this workaround to get in the share folder.
I also search this topic for people that have the same Issue and I found that I had to share my calender to the specific google server mail that I created. I forgot this in the first place but now that iāve shared it it still doensāt work. I used the private calID btw since this is not a public calendar.
note that I edited the calID and keyfile name on purpose for this printscreenā¦
Hi Remco,
I thinkt that calId is wrong. For me that is an e-mail adress, visible under that specific calendarās settings and not a url. Eg. something like [email protected]
Yes you need that second one, thatās labelled āagenda-idā, hence the abreviated ācalIdā name in the addon settings. That other one you used is labelled as a ācalendar-adressā.
Dear All,
I think it works now, but still no sensor. my-calendar. What am I still doing wrong?
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 10.0 (amd64 / qemux86-64)
Home Assistant Core: 2023.4.6
Home Assistant Supervisor: 2023.04.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 13s
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.6.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
System locale: en-US
Luxon locale set to: nl-BE
System timeZone: Europe/Brussels
Luxon timezone set to: Europe/Brussels
Calendar(s) queried at: Mon Apr 24 2023 23:45:00 GMT+0200 (Central European Summer Time)
postEventsAllCalendars error: TypeError: Cannot read properties of undefined (reading 'length')
Events posted to sensor(s) at: Mon Apr 24 2023 23:45:00 GMT+0200 (Central European Summer Time)
4 entries found in caldav calendar
Fetching caldav calendar entry CE07297B-3E5B-4C4C-8CAE-6B87BA5AF659.ics
Fetching caldav calendar entry 3478F43F-9CB3-42E6-82EF-960D788BEF85.ics
Fetching caldav calendar entry E0438C0D-12AD-4827-96B0-84FB5C31BDD8.ics
Fetching caldav calendar entry A8950638-6EF0-419C-B678-A3BE7D98A884.ics
sorting events of calendar: my-calendar
Calendar(s) queried at: Mon Apr 24 2023 23:50:00 GMT+0200 (Central European Summer Time)
postEvents error with: Error: Request failed with status code 500
Events posted to sensor(s) at: Mon Apr 24 2023 23:50:00 GMT+0200 (Central European Summer Time)
4 entries found in caldav calendar
Fetching caldav calendar entry CE07297B-3E5B-4C4C-8CAE-6B87BA5AF659.ics
Fetching caldav calendar entry 3478F43F-9CB3-42E6-82EF-960D788BEF85.ics
Fetching caldav calendar entry E0438C0D-12AD-4827-96B0-84FB5C31BDD8.ics
Fetching caldav calendar entry A8950638-6EF0-419C-B678-A3BE7D98A884.ics
sorting events of calendar: my-calendar
Iāve noticed that I used nl_NL and others use nl-NL so Iāve changed that and tried again. Now Iām getting the following error:
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 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2023.4.6
Home Assistant Supervisor: 2023.04.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 16s
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.6.5
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.5>
npm notice Run `npm install -g [email protected]` to update!
npm notice
System locale: en-US
Luxon locale set to: nl-NL
System timeZone: Europe/Amsterdam
Luxon timezone set to: Europe/Amsterdam
Previously stored events posted to sensor(s) at: Tue Apr 25 2023 05:54:02 GMT+0200 (Central European Summer Time)
/node_modules/node-cron/src/convert-expression/month-names-conversion.js:10
expression = expression.replace(new RegExp(items[i], 'gi'), parseInt(i, 10) + 1);
^
TypeError: Cannot read properties of undefined (reading 'replace')
at convertMonthName (/node_modules/node-cron/src/convert-expression/month-names-conversion.js:10:37)
at interprete (/node_modules/node-cron/src/convert-expression/month-names-conversion.js:16:27)
at interprete (/node_modules/node-cron/src/convert-expression/index.js:54:26)
at validate (/node_modules/node-cron/src/pattern-validation.js:117:32)
at new TimeMatcher (/node_modules/node-cron/src/time-matcher.js:14:9)
at new Scheduler (/node_modules/node-cron/src/scheduler.js:9:28)
at new ScheduledTask (/node_modules/node-cron/src/scheduled-task.js:22:27)
at createTask (/node_modules/node-cron/src/node-cron.js:36:12)
at Object.schedule (/node_modules/node-cron/src/node-cron.js:25:18)
at Object.<anonymous> (/index.js:533:6)
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