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
Edit 3:
For whoever is experiencing the same thing: Iāve reinstalled everything once again. Removed the addon completely and installed it again. The first fetch didnāt succeed as more people experience but this is an known issue. The second fetch did actually work and the sensor is created.
The addon is super sensitive for typoās so please check, dubbel check and triple check everything. For me it seems to work now. Thanks for all the help!!
Iāve tried multiple things. Removing all recurring events without end date. Making the fetch period smaller. Removing the service account and creating a new one but with no result. The error has changed however.
Do you have any suggestions on what the issue could be?
--------- edit2:
I have once again reinstalled everything. Removed the addon and configured it all again. It seems the error has gone for now but no sensors are created.
</s> <s>s6-rc: info: service s6rc-oneshot-runner: starting</s> <s>s6-rc: info: service s6rc-oneshot-runner successfully started</s> <s>s6-rc: info: service fix-attrs: starting</s> <s>s6-rc: info: service fix-attrs successfully started</s> <s>s6-rc: info: service legacy-cont-init: starting</s> <s>cont-init: info: running /etc/cont-init.d/00-banner.sh</s> <s>-----------------------------------------------------------</s> <s> Add-on: Hass Calendar Addon</s> <s> Addon to consume caldav and google calendars and make calendar events available as sensordata in Home Assistant.</s> <s>-----------------------------------------------------------</s> <s> Add-on version: 0.301</s> <s> You are running the latest version of this add-on.</s> <s> System: Home Assistant OS 9.5 (aarch64 / raspberrypi4-64)</s> <s> Home Assistant Core: 2023.4.6</s> <s> Home Assistant Supervisor: 2023.04.1</s> <s>-----------------------------------------------------------</s> <s> Please, share the above information when looking for help</s> <s> or support in, e.g., GitHub, forums or the Discord chat.</s> <s>-----------------------------------------------------------</s> <s>cont-init: info: /etc/cont-init.d/00-banner.sh exited 0</s> <s>cont-init: info: running /etc/cont-init.d/01-log-level.sh</s> <s>cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0</s> <s>s6-rc: info: service legacy-cont-init successfully started</s> <s>s6-rc: info: service legacy-services: starting</s> <s>s6-rc: info: service legacy-services successfully started</s> <s>added 80 packages, and audited 81 packages in 15s</s> <s>23 packages are looking for funding</s> <s> run `npm fund` for details</s> <s>found 0 vulnerabilities</s> <s>npm notice </s> <s>npm notice New minor version of npm available! 9.1.2 -> 9.6.5</s> <s>npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.5></s> <s>npm notice Run `npm install -g [email protected]` to update!</s> <s>npm notice </s> <s>System locale: en-US</s> <s>Luxon locale set to: nl-NL</s> <s>System timeZone: Europe/Amsterdam</s> <s>Luxon timezone set to: Europe/Amsterdam</s> <s>no previously stored options found</s> <s>Calendar(s) queried at: Wed Apr 26 2023 12:15:00 GMT+0200 (Central European Summer Time)</s> <s>postEventsAllCalendars error: TypeError: Cannot read properties of undefined (reading 'length')</s> <s>Events posted to sensor(s) at: Wed Apr 26 2023 12:15:00 GMT+0200 (Central European Summer Time)</s> <s>1 entries found in google calendar</s> <s>Fetching google calendar entry c8r3cpb565im2bb66kp3ab9kc4o34b9oc9ijcbb6ccp68c1gc5h62dpkcg</s> <s>
You can leave out the username, password and cadavUrl fields as youāre using a google calendar, but that will not be the cause of the issue youāre having. When I look up the BCP-47 locale standard for Sweden it says itās āsv-SEā, so with capitals for SE. Could be that the Luxon library is really strict and needs you to enter it that way.