[SOLVED] Apple icloud CalDav connection

I installed and configured the CalDAV Binding like you and it seems to load my *.ics files to the correct directory (/var/lib/openhab2/etc/caldav/Apple is full with *.ics files), but my Items are showed as UNDEF in HABPanel, maybe anyone can help me?

caldavio.cfg

caldavio:Apple:url=https://p38-caldav.icloud.com:443/XXXXXXXX/calendars/home
caldavio:Apple:username=MyAppleId
caldavio:Apple:password=ThirdPartyPassword
caldavio:Apple:reloadInterval=1
caldavio:Apple:preloadTime=30
caldavio:Apple:disableCertificateVerification=false

caldavPersonal.cfg

caldavPersonal:usedCalendars=Apple

caldavCommand.cfg

caldavCommand:readCalendars=Apple

caldav.items

String   OfficeCalName0	"Termin jetzt [%s]"			<calendar>	{ caldavPersonal="calendar:Apple type:ACTIVE eventNr:1 value:NAME" }
DateTime OfficeCalTime0	"Beginn [%1$tT, %1$td.%1$tm.%1$tY]"	<calendar>	{ caldavPersonal="calendar:Apple type:ACTIVE eventNr:1 value:START" }
String   OfficeCalName1	"nÀchster Termin [%s]"			<calendar>	{ caldavPersonal="calendar:Apple type:UPCOMING eventNr:1 value:NAME" }
DateTime OfficeCalTime1	"Beginn [%1$tT, %1$td.%1$tm.%1$tY]"	<calendar>	{ caldavPersonal="calendar:Apple type:UPCOMING eventNr:1 value:START" }
String   OfficeCalName2	"ĂŒbernĂ€chster Termin [%s]" 		<calendar> 	{ caldavPersonal="calendar:Apple type:UPCOMING eventNr:2 value:NAME" }
DateTime OfficeCalTime2	"Beginn [%1$tT, %1$td.%1$tm.%1$tY]" 	<calendar> 	{ caldavPersonal="calendar:Apple type:UPCOMING eventNr:2 value:START" }

HABPanel template

{{itemValue('OfficeCalName0')}}<br>
{{itemValue('OfficeCalTime0')}}<br>
{{itemValue('OfficeCalName1')}}<br>
{{itemValue('OfficeCalTime1')}}<br>
{{itemValue('OfficeCalName2')}}<br>
{{itemValue('OfficeCalTime2')}}<br>

Is there any mistake in my configuration?

I use OpenHAB 2.3.0-1 (Raspbpery Pi 3) and I’ve installed the CalDAV Bindings over the Paper UI.

This show me the log:

2018-08-21 17:35:29.335 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'caldav.items'
2018-08-21 17:35:29.355 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:ACTIVE eventNr:1 value:NAME
2018-08-21 17:35:29.357 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=ACTIVE, eventNr=1, value=NAME, filterName=null, filterCategory=[]
2018-08-21 17:35:29.360 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalName0
2018-08-21 17:35:29.362 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalName0, setting to UNDEF
2018-08-21 17:35:29.366 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:ACTIVE eventNr:1 value:START
2018-08-21 17:35:29.369 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=ACTIVE, eventNr=1, value=START, filterName=null, filterCategory=[]
2018-08-21 17:35:29.371 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalTime0
2018-08-21 17:35:29.374 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalTime0, setting to UNDEF
2018-08-21 17:35:29.378 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:UPCOMING eventNr:1 value:NAME
2018-08-21 17:35:29.381 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=UPCOMING, eventNr=1, value=NAME, filterName=null, filterCategory=[]
2018-08-21 17:35:29.383 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalName1
2018-08-21 17:35:29.386 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalName1, setting to UNDEF
2018-08-21 17:35:29.389 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:UPCOMING eventNr:1 value:START
2018-08-21 17:35:29.392 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=UPCOMING, eventNr=1, value=START, filterName=null, filterCategory=[]
2018-08-21 17:35:29.394 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalTime1
2018-08-21 17:35:29.396 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalTime1, setting to UNDEF
2018-08-21 17:35:29.400 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:UPCOMING eventNr:2 value:NAME
2018-08-21 17:35:29.405 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=UPCOMING, eventNr=2, value=NAME, filterName=null, filterCategory=[]
2018-08-21 17:35:29.408 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalName2
2018-08-21 17:35:29.410 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalName2, setting to UNDEF
2018-08-21 17:35:29.414 [TRACE] [l.internal.CalDavBindingProviderImpl] - handling config: calendar:Apple type:UPCOMING eventNr:2 value:START
2018-08-21 17:35:29.417 [TRACE] [l.internal.CalDavBindingProviderImpl] - found values: calendar=[Apple], type=UPCOMING, eventNr=2, value=START, filterName=null, filterCategory=[]
2018-08-21 17:35:29.420 [DEBUG] [l.internal.CalDavBindingProviderImpl] - adding item: OfficeCalTime2
2018-08-21 17:35:29.423 [DEBUG] [ldav_personal.internal.CalDavBinding] - no event found for OfficeCalTime2, setting to UNDEF

Hi @Andrew_Pawelski!

I have used your method and it returned everything as it supposed, inserted the right link to OH. (not by the displayname, but as you wrote in your article, by its ‘hashed’ name).
Previously I have tried the same URL, but with the displayname at the end and it didn’t worked, I always got an exception that the content is not found (same when I entered that URL into browser, ‘Not Found’).

Now with the correct link, I didn’t get any exception, but I can’t see any event in OH. Same when I enter the link into a browser, enter credentials, I can’t see anything, just a blank html site.

Hi @Andrew_Pawelski

Using your above approach I get some of the way, but when running the following command:

curl -s -X PROPFIND -u "#MyAppleID#" -H "Depth: 1" --data "&lt;propfind xmlns='DAV:'&gt;&lt;prop&gt;&lt;displayname/&gt;&lt;/prop&gt;&lt;/propfind&gt;" https://p55-caldav.icloud.com:443/#MY_CAL_ID#/calendars/

I get no hash codes, but only this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<multistatus xmlns="DAV:">
	<response>
		<href>/#MY_CAL_ID#/calendars/</href>
			<propstat>
		        <prop>
							<displayname>#MY_NAME#</displayname>
            </prop>
			    <status>HTTP/1.1 200 OK</status>
		    </propstat>
    </response>
		<response>
		<href>/#MY_CAL_ID#/calendars/home/</href>
			<propstat>
		        <prop>
              <displayname>Hjem</displayname>
            </prop>
			    <status>HTTP/1.1 200 OK</status>
		    </propstat>
  </response>
	<response>
		<href>/#MY_CAL_ID#/calendars/inbox/</href>
			<propstat>
		        <prop>
               <displayname/>
          </prop>
			    <status>HTTP/1.1 404 Not Found</status>
		    </propstat>
  </response>
  <response>
		<href>/#MY_CAL_ID#/calendars/notification/</href>
	    <propstat>
		        <prop>
                <displayname>notification</displayname>
          </prop>
			    <status>HTTP/1.1 200 OK</status>
		    </propstat>
  </response>
	<response>
		<href>/#MY_CAL_ID#/calendars/tasks/</href>
		    <propstat>
		        <prop>
        		<displayname>Reminders</displayname>
  		    </prop>
			    <status>HTTP/1.1 200 OK</status>
		    </propstat>
  </response>
	<response>
		<href>/#MY_CAL_ID#/calendars/work/</href>
			<propstat>
		        <prop>
              <displayname>Work</displayname>
	          </prop>
			    <status>HTTP/1.1 200 OK</status>
		    </propstat>
        
	</response>
	<response>
		<href>/#MY_CAL_ID#/calendars/outbox/</href>
		    <propstat>
		        <prop>
	 	            <displayname/>
  		    </prop>
			    <status>HTTP/1.1 404 Not Found</status>
		    </propstat>
  </response>
</multistatus>

Do you, or anyone else have an idea on what is wrong and how I can get the folder hash value? :slight_smile:

Best Regards
Stig

can you show me the command without translated html characters?

Hey can you please let me know what will be c# replicate for the above
 Also when you say AppID you mean apple username or UserID

Thank you

This no longer works for me as described.
Doing GREP on displayname gives me the actual calendar names and not the other info.
Doing the CURL command without the GREP gives a messy output but you can find the calendar UUID in there easily.

Regards, ahartman, belgium

TY for the effort. Works fine.

Hi there, the first command asks for the password but the app-specific password or any password, even wrong, doesn’t respond anything:

Any suggestion? Thanks.

Hi Andrew, thanks for the posts, tried hard to get my CalDav solved, but after entering the command with my appleID , I am prompted to enter host password - but my console does not accept any character anymore - do you have an idea what could be wrong?
Thank you! Sorry, I’m not familiar with program codes.