Author Topic: iCal Events Spanning Multiple Days  (Read 828 times)

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
iCal Events Spanning Multiple Days
« on: December 21, 2017, 10:18:55 am »
Looking to see if events lasting multiple days are supported via iCal.    We have a vacation property which is scheduled via AirBnB and I am using GCal to prep the condo before arrival,  shut off services upon departure and  ensure the housekeeper has been there before the next person arrives.  I get the calendar from AirBnB into my Google calendar but it is all in iCal format.  People stay 2-7 days generally so I need the  GCal to recognize an event that started up to a week earlier.  Note that I am triggering on ALL events coming from the AirBnB calendar except those with "PENDING" as these are usually last minute unconfirmed bookings that disappear (or stop being pending) within 4-6hrs.

My problem is that it triggers correctly upon the event starting - but the event ends at midnight of the 1st day.  Looking at the log file it seems that the parser only looks for events starting at 00:00 of the current day.  I have included the log file, settings and a snapshot of the Google Calendar from the time period.   

Since I am getting the events from AirBnB automatically I am not able to change the formatting of the events to multiple single day events etc.    Any ideas or work-arounds would be appreciated!!!

Rob

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #1 on: December 22, 2017, 09:27:29 pm »
Take a look at the advanced documentation gc_retrip.  That may be what you want.

The problem with ical is that it can be implemented in manny ways -- it's one of those standards with too many options ...  :-(

From the logs (and the screen shots) it looks like these multi-day events are being treated as one long event.

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #2 on: December 23, 2017, 10:14:30 am »
Thanks - Will try it with gc_retrip set back to true.  Will know in a few days if that changes the issue.  The events are all multi-day, all-day events coming from the Airbnb site so can't change the event records to single day ones. 

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #3 on: December 23, 2017, 02:49:19 pm »
Also -- not sure if this is what you are expecting but when you specify an event like this: "your event name [780,660]"
You are saying that you want it to trigger 780 minutes after the time you have in the calendar and finish 660 minutes after the time you have it ending in the calendar.  Positive is forward in time, negative is backward.

Unfortunately - I am on vacation and cannot look closely at this for a couple of weeks.  I'd recommend that you put the start and end delta to zero - convince yourself that it's working (or not) and then use the delta's.

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #4 on: December 23, 2017, 11:13:03 pm »
Regarding the start/end delay....  The events comming from AirBnB are all-day events starting at midnight 00:00 before the check-in day then ending at midnight 00:00 of the night before checking out.  The delays cause the check-in actions to happen at 13:00 and checkout actions at 11:00 . The check-in (start) delay works fine but checkout (end) delay doesn't work as the event seems to mistakenly end at midnight of the first day.  I can use delayed actions in my scenes if necessary in place of the GCal delays. 

Have a good vacation. No hurry -  I am still experimenting with ways to automate the rentals.
Best Wishes for the Xmas Season

Rob

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #5 on: January 27, 2018, 01:32:28 pm »
I eliminated the delays on the GCal trips but the trip for the ending of the event still happens  at midnight of the 1st day of the multi-day event.  Any other tests or diagnostics logs I can do to help figure this out?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #6 on: January 29, 2018, 03:42:51 pm »
I can take a look and figure it out.  Lets see what your current logs look like.  I'm guessing it has to do with the way the events are being translated from ical to google cal.

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #7 on: February 07, 2018, 02:04:57 pm »
Here is latest log with matching screen shots of the GCal settings (back to 0 delays) and the Google Calendar that it is scanning.  Hope this helps.   

Thanks
Rob

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #8 on: February 08, 2018, 12:25:55 am »
Hi --
A couple of things

I notice that you have gc_keyword set to PENDING  yet there are no calendar entries with that WORD in the title.  So basically - nothing should be happening :-( . and as far as I can see in the logs -- it's dutifully not doing anything :-)

So it does not look like the logs are capturing the behavior you reported earlier?

I have set up a test calendar and am seeing an odd behavior (likely because google changed their ical format) so will dig a little deeper today.

Three things that you can try (1) use the standard google url for the calendar (versus the ical url) as this will generally be more reliable.
(2) use the url directly to the source calendar site (may not be able to do because of login requirements)
(3) past the google ical url into your browser -- it should download the ical file -- send that to me as well (and I can see what the formatting looks like)

One of the problems with iCal is that there are many ways the developer that created the ical file can represent events -- so you cannot guarantee that a given parser (like my code) will work with all variations that are possible.


Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #9 on: February 08, 2018, 11:02:56 pm »
As I suspected --  there has been a change to the way google is creating iCal files for repeating events.  This could have been a long time ago since the iCal support was not intended to be used with google calendars.

There is no reason to use the ical url from google calendar (for GCAL).  Please use the Calendar ID that google provides and lets take it from there.  That does not mean that the google import from AirBnB is working correctly -- but we shall see .....

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #10 on: February 09, 2018, 11:12:25 am »
I was triggering on all events except the PENDING ones as these were not confirmed bookings and would dissappear or become real booking within hours. Rarely saw them but did get a few falsely triggering before adding the PENDING.   I'll try the Google calendar method again - I did try this to start with but couldn't get it working., but too be truthful I really didn't spend a lot of time.

Thanks for the ideas.  I'll try them and let you know how it goes.

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #11 on: February 15, 2018, 11:47:17 am »
Using the Google calendar link instead of the ical is working - sort of!  The triggers for start an end happen on the correct days now , but the start/ end delays seem to be ignored. So the start/ end of the events are happening at midnight instead of 2pm/11am. I can manage this with timers & delayed scene actions.  Is there anything I should try?. 

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #12 on: February 15, 2018, 11:56:27 am »
Using the Google calendar link instead of the ical is working - sort of!  The triggers for start an end happen on the correct days now , but the start/ end delays seem to be ignored. So the start/ end of the events are happening at midnight instead of 2pm/11am. I can manage this with timers & delayed scene actions.  Is there anything I should try?.

Please send a log.  I need to see exactly how you have it set up.

Also - re-reading your earlier posts, it's not clear exactly what you are trying to achieve.  Do you have two different type of events in the calendar (1) a checkin / start of occupancy and (2) a checkout / end of occupancy.  If so - it's likely that you need two instances of GCAL with different start / end deltas for the two different types of event.
« Last Edit: February 15, 2018, 12:09:32 pm by Stuart »

Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: iCal Events Spanning Multiple Days
« Reply #13 on: February 15, 2018, 03:04:48 pm »
I have attached the logs (probably mostly the same - I did a getlog just before downloading #2)

So here is what I am trying to do.  We get the calendar data from our AirBnB listing automatically into my google calendar. Each event is a single reservation that may span multiple days.  Events from AirBnB start at midnight of the  night before checkin (00:00 of the night before 4:00PM checkin)  and end at midnight of the night before checkout (00:00 of the night before 11:00AM checkout).  For example a person checking in Feb 1@4:00 and leaving Feb3@11:00 will show up as all day events starting 00:00:01 Feb 1  - ending 00:00:01 Feb 3 (note that the calendar doesn't include the 01 seconds part but it makes the timing clearer for this explanation!!)

A few hours before checkin I set the thermostat, turn on the water, and check that the cleaner has been in the unit.  A few hours after checkout I turn the thermostat down and water off (its a bit more complex that that but this is the jist).

I have tried restarting Vera/Luup to ensure the system isn't confused.   I haven't yet created a new GCal3 device for this - just reused the one I had setup earlier that was using the iCal method and changed the calendar ID/credentials and reset the start/end delays and extra days settings.   

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 673
  • Karma: +68/-2
Re: iCal Events Spanning Multiple Days
« Reply #14 on: February 15, 2018, 04:06:29 pm »
Both these log files show that there are errors reading from google calendar (http error 403).  It may be that the calendar sharing permissions are not set correctly.

The net effect is that GCAL is trying to work from a copy of the calendar that it obtained some time previously -- likely when it was using ical.  It's an offline mode that is designed to help when there are network issues.    You can tell if it's in offline mode when the event name is preceded by an asterisk.