Caldav google calendar problem

Hello @querdenker2k

These are some of the configs I’ve tried, but were not working:

caldavio:home:url=https://apidata.googleusercontent.com/caldav/v2/xxxxxxxx@group.calendar.google.com/events
caldavio:home:oauth=true
caldavio:home:username=Client ID from google OAuth API
caldavio:home:password=Client secret from google OAuth API
caldavio:home:reloadInterval=10
caldavio:home:preloadTime=7200
caldavio:home:disableCertificateVerification=true 

This is the second format of the configuration I’ve tried:

caldavio:home:url=https://www.google.com/calendar/dav/xxxxxxxx@group.calendar.google.com/events
caldavio:home:username=my e-mail username part (part before @)
caldavio:home:password=my e-mail password
caldavio:home:reloadInterval=10
caldavio:home:preloadTime=7200
caldavio:home:disableCertificateVerification=true

xxxxxxxx is Calendar ID from the specific calendar settings in Google Calendar web interface.

I’ve tried both settings with and without caldavio:home:disableCertificateVerification=true part. I’ve also tried using my e-mail address (email@gmail.com) instead of xxxxxxxx@group.calendar.google.com, so it would use my default calendar, but with the same result.

Best regards,
Davor

Hello @querdenker2k

Do you think my config file is OK? I’ve tried everything I could think of, but I’m still unable to make it work. Thank you for your help.

Best regards,
Davor

The config file looks good, but i am currently Not using the caldav Binding. Ist does not really work with beta5

Hello!

So, it could be problem with a snapshot I’m using (it’s pretty recent, so, I guess it could be the same problem beta 5 has)? Anyway, thank you for your help.

Best regards,
Davor

Hello @querdenker2k

Are you the maintainer of CalDAV binding? Do you know if there are any plans on fixing it?

Best regards,
Davor

Yes, I am. I am not familiar with OSGI and don’t know what’s going wrong with OH2. For OH1 it’s still fully working. Someone of the admins should have a look. There are already issues with this problem.

Hello!

Thank you for the answer. I’ll try to find that issue to follow it.

Best regards,
Davor

Hello!

Since I couldn’t make CalDAV Personal binding work with my Google Calendar and OH2, I’ve made simple Python script that will retrieve Google Calendar events information and populate OH items. You can find more informations here.

Best regards,
Davor

1 Like

Is the “caldavio:” prefix really needed in OH2 configurations? Till now i thought, that one of the main difference between OH1 and OH2 configuration is, that there is now one configuration file for each binding in OH2 and you don’t need those “:” prefixes anymore…

kind regards,

Christoph

Hello!

For the caldavio.cfg and caldavPersonal.cfg you need to add these prefixes. It’s discrepancy, and there’s an issue on github relating to this problem. But, even with these prefixes, I wasn’t able to make it work with Google calendar on OH2.

Best regards,
Davor

Hello!

I see recent-ish changes to the CalDAV wiki page. Could I request that some CalDAV user(s) submit corrections to the “official” documentation?

Each service has its own page at docs.openhab.org here, here and here. The source for these pages is, respectively, here, here and here. These documents are meant to only explain how to configure and use these services under openHAB 2+. The 1.x wiki, on the other hand, is meant to remain useful to openHAB 1.x runtime users.

If someone(s) kindly contribute improvements, please look at sibling README.md files to identify the standard structure they should share.

CalDAV users will be very grateful I’m sure!

1 Like

I’m in +1

Is there already a solution out? I am having hte same issue…

Hope can help.I’m using the binding on a “2.1.0-1 (Release Build)” openhabian installation.
I’ve installed the binding using paperUI, this is the reference:
image

In the “openHAB-conf\services” you should have 3 cfg files:
image
I’m using the binding for events scheduling only, so:

caldavCommand.cfg

################################ CalDAV Command Binding ###################################
# see CalDAV IO Binding
# Used to execute commands if events starts or ends with an easy notation in the event description.
# commaseperated (e. g. openhab, anothercalendar)
# readCalendars=<ids from caldav-io>
caldavCommand:readCalendars=mycalendar

caldavio.cfg

caldavio:mycalendar:url=https://www.google.com/calendar/dav/user@gmail.com/events
caldavio:mycalendar:username=user@gmail.com
caldavio:mycalendar:password=application_password
caldavio:mycalendar:reloadInterval=5
caldavio:mycalendar:preloadTime=5
caldavio:mycalendar:historicLoadTime=5
caldavio:mycalendar:disableCertificateVerification=false

Pay attention that i’m using a google application password and not the account password in order to avoid problems with 2-factor authentication.

image

caldavpersonal.cfg is void:

############################# CalDAV Personal Binding ################################
# see CalDAV IO Binding
# Used to toggle switch items for presence. Switched to ON if an event in the calendar occurs.
# And back to OFF if the event ends.
# Can also be used to show upcoming or active events
# 
# Which calendars should be used to detect presence (comma separated)
# usedCalendars=<ids from caldav-io>
# 
# If the location of the event is one of this identifiers, the presence will not be changed.
# Can be used for events which are at home or are just reminders. (comma separated, optional)
# homeIdentifiers=

Last: read carefully the log because the application password is generated for a specific device and sometimes google’s security check fail to identify your openhabian as the authorized device.
Good work.

Hello, I’ve configered calDAV as described up there. I Still have an error:

2018-02-11 12:57:03.842 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (401 - Unauthorized)  com.github.sardine.impl.SardineException: Unexpected response

Here my config with little differences:

> caldavio:Geburtstage:url=https://www.google.com/calendar/dav/<id>@group.calendar.google.com/events
> caldavio:Geburtstage:username=<username> without @gmail.com
> caldavio:Geburtstage:password=<app pw generated>
> caldavio:Geburtstage:reloadInterval=5
> caldavio:Geburtstage:disableCertificateVerification=false
> caldavio:Geburtstage:preloadTime=20000

Has anybody any ideas…

> caldavio:Geburtstage:username=<username> without @gmail.com

in my installation i’m using:

caldavio:mycalendar:username=user@gmail.com

Also the url seems having a different structure.

hi, I also had the HTTP 401 error trying to read my google calendar using the caldav binding.
In my case I had the URL wrong. The correct URL format for me was:
https://www.google.com/calendar/dav/@import.calendar.google.com/events
you can get the calendar id value from the settings of your google calendar, in my case google was showing something like :
abcdef1245@import.calendar.google.com
take the value left from the @ and this should be your calendar-id
good luck !

Hello there, my solution was to set disableCertificateVerification=true. Although the most tutourials say “false”. And in my tests a value for reloadInterval < 5 doesn’t work. Thank yu for your help.

Thanks for the feedback. It make sense, maybe that https certificate verification rely on some system configuration (eg. it has to know the root ca certificate in order to trust the source of the certificate that is checking) so disabling the check remove a potential point of failure. The side effect is that security is lower because without check you can’t really trust the identity of the server you are talking to and you are prone to server impersonation attack. I think that you can bear it :slight_smile:

@querdenker2k:
I’m trying to switch from OH1 to OH2 but I do not get Google OAuthv2 connection up and running.

Do you remember?
We were in contact regarding the same issue in OH1. I got it running using one of your snapshot versions of the addon (1.9.0). Obviously OH 2.2.0 does not support the new URL https://apidata.googleusercontent.com/caldav/v2/<calid>/events out of the box?