Author Topic: GCAL3 - General Discussion  (Read 160544 times)

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #675 on: October 24, 2017, 05:26:06 pm »
This is an incomplete log file and does not show the log when the problem occurred.   Please make sure you have gc_debug set to 3.   Run the plugin until you get the error then use the get log feature (from the plugin) and send the whole log file.

I tried your calendar url and got an error message to Check Credentials 404, which makes sense since the test credentials should not work.  I also note thatthe url you are inputing is for a group calendar.  Is that what you are trying to use ?  Do you have permissions for that calendar ?

https://calendar.google.com/calendar/embed?src=<snip>%40group.calendar.google.com

Your permissions need to look something like the attached.

« Last Edit: October 24, 2017, 06:28:03 pm by Stuart »

Offline RoffeRuff

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - Version 2.6
« Reply #676 on: November 05, 2017, 03:42:10 pm »
This is an incomplete log file and does not show the log when the problem occurred.   Please make sure you have gc_debug set to 3.   Run the plugin until you get the error then use the get log feature (from the plugin) and send the whole log file.

I tried your calendar url and got an error message to Check Credentials 404, which makes sense since the test credentials should not work.  I also note thatthe url you are inputing is for a group calendar.  Is that what you are trying to use ?  Do you have permissions for that calendar ?

https://calendar.google.com/calendar/embed?src=<snip>%40group.calendar.google.com

Your permissions need to look something like the attached.

It is a newly created (and shared calendar) where me and my wife will add bookings controlling pre-heating of our car. gc_debug was set to 3 all along. Attached is the log capturing everything around the point where I got my sweet 403.


Offline rjfcowdery

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.6
« Reply #677 on: November 05, 2017, 09:07:28 pm »
Am using GCal3 to drive events based on an airBnB public ical calendar that I have linked into my Google calendar.  Guest reservations show up as all-day repeated events and I have no problem triggering the "Guest Arrival" actions which start 13hrs  (1:00PM) after the GCal calendar event start at midnight (using gc_StartDelta = 780min).   However the  "Guest Departure" actions need to trigger 11hrs after the end of the ical event (ie 11:00AM on the day after the end of the reservation in the calendar).  The gc_EndDelta doesn't seem to work for this - i get the the trigger at midnight instead.   Is this a limitation of GCal3 or am I missing something.  I can use Delayed Actions in the scenes to create the same effect if needed. !!  thanks

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #678 on: November 05, 2017, 10:39:14 pm »
The logs look correct right up to the point where the plugin is requesting the calendar data.  The credentials look to be correct - at least the error that I would expect for incorrect credentials is not occurring.  That pretty much leaves a bad url and / or permissions.  Are you using the iframe information at Embed This Calendar from the calendar details page?  Are you using the service account associated with the credentials as one of the accounts in the section "Share with specific people"?

On the permission side of things - this post may (or may not) help.
https://stackoverflow.com/questions/11863022/edit-google-calendar-events-from-google-service-account-403/11897793#11897793

If you want to send to me via PM screen shots of the relevant calendar settings (especially permissions) - I can take a look

Offline aladur

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.6
« Reply #679 on: December 24, 2017, 12:25:16 pm »
Hi Steward,
after using the Gcal3 successfully for a couple of months, it's now reporting "http error400" when pressing "check". Unless the calendar is correctly shown in the "Calendar" tab. I had changed nothing except doing some firmware upgrades.
What might be wrong? Thanks!

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #680 on: December 24, 2017, 02:04:55 pm »
These http errors are standard error codes - so they can be looked up just by doing a search.  Of course, that does not men that the descriptions will make sense.  error code 400 means that the server did not like or did not recognize the request.

My best guess is that during the upgrade you copied the calendar url across incorectly.

First thing to do is to test using the test calendar and test credentials.  Assuming that works - try again with your credentials and calendar id.

You mention the calendar tab - that was removed a couple of versions ago, so maybe it's time to upgrade GCAL.  I do not troubleshoot or make changes to olde revisions.

Offline aecchalet

  • Full Member
  • ***
  • Posts: 240
  • Karma: +1/-1
Re: GCAL3 - Version 2.6
« Reply #681 on: April 23, 2018, 06:54:59 pm »
Stuart,
I could really use this plugin if I can get it working.  I got my calendarID from my google calendar by following your instructions and pasted it into calendar ID field, then pressed Set.  I likewise generated my json credentials file, changed its name and uploaded it via App Developer tab.  I entered that name in the credentials file field then pressed Set.  That didn't seem to work so I repeated and then rebooted my vera plus (UI7).  However, it is still not working.  I am sorry but I know that this is not very helpful information.

I also followed these steps (in this order).
1. Switch the GCal plugin to Bypass Mode and leave it there until all the steps below are complete.
2. In Apps --> Develop Apps --> Luup Files  Upload the GCal3Test.json file. No need to reload.
3. In the Control tab (of the plugin).  Type "GCal3Test.json" (no quotes)  into the Credential File field and Press "Set".  UI7 will restart itself.  For UI5 you will need to press Reload.
4.  In the Control tab (of the plugin).  Copy the text from the file GCal3TestCalendarID.txt and paste it into the Calendar ID field and press "Set".  UI7 will restart itself.  For UI5 you will need to press Reload.
5. Switch the GCal plugin to Arm Mode
Then I get a "no credential file" message, although the credential file appeared to be accepted after #3 above?
When I try to arm the device, I get a "calendarID not set" and "fatal calendar error" message.
I tried it using both Chrome and MS Edge browsers.

When I changed the credentials file to my file and inserted my calendarID and armed it, I get the following messages:
token error code: HTTP/1.1 400 Bad Request
fatal Calendar error

I tried creating a new credentials file and uploaded it and did all of the steps but get the same error messages.

I downloaded a log and attached it.

Any help would be greatly appreciated.
Thanks
« Last Edit: April 24, 2018, 05:43:41 pm by aecchalet »
Vera Plus 1.7.2138; 12xHRDS1, 2xTrane SCHTZMT400 Tstats; 5xZIR00, 4xCA9000 PIRs; 2xHA01C Recept; 2x2wy ZDW120W switch; 1xAppl (ACT, GE/Jasco), 1xLite Dim Mod (GE/Jasco, Evolve);  2xDead Bolts Schlage

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #682 on: May 01, 2018, 10:04:40 am »
Stuart,
I could really use this plugin if I can get it working.  I got my calendarID from my google calendar by following your instructions and pasted it into calendar ID field, then pressed Set.  I likewise generated my json credentials file, changed its name and uploaded it via App Developer tab.  I entered that name in the credentials file field then pressed Set.  That didn't seem to work so I repeated and then rebooted my vera plus (UI7).  However, it is still not working.  I am sorry but I know that this is not very helpful information.

I also followed these steps (in this order).
1. Switch the GCal plugin to Bypass Mode and leave it there until all the steps below are complete.
2. In Apps --> Develop Apps --> Luup Files  Upload the GCal3Test.json file. No need to reload.
3. In the Control tab (of the plugin).  Type "GCal3Test.json" (no quotes)  into the Credential File field and Press "Set".  UI7 will restart itself.  For UI5 you will need to press Reload.
4.  In the Control tab (of the plugin).  Copy the text from the file GCal3TestCalendarID.txt and paste it into the Calendar ID field and press "Set".  UI7 will restart itself.  For UI5 you will need to press Reload.
5. Switch the GCal plugin to Arm Mode
Then I get a "no credential file" message, although the credential file appeared to be accepted after #3 above?
When I try to arm the device, I get a "calendarID not set" and "fatal calendar error" message.
I tried it using both Chrome and MS Edge browsers.

When I changed the credentials file to my file and inserted my calendarID and armed it, I get the following messages:
token error code: HTTP/1.1 400 Bad Request
fatal Calendar error

I tried creating a new credentials file and uploaded it and did all of the steps but get the same error messages.

I downloaded a log and attached it.

Any help would be greatly appreciated.
Thanks

Are you still having problems ?    I only got to this.   I looked at the error log and it's failing trying to retrieve a session token from google -- that almost always means that your credentials file is incorrect.  This is occurring before it attempt to read your calendar.

You may have downloaded the wrong credential information.   I would try to create a new credentials file.

You should first check that the installation and everything else is fine by using the test calendar and test credentials.

Offline 3rdStng

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: GCAL3 - Version 2.6
« Reply #683 on: June 13, 2018, 04:44:14 pm »
I'm curious if the following idea of mine is possible, without the addition of another GCal virtual object creation.

I have a GCal instance connected to the public holiday's that Google publishes. I then use PLEG to trigger my porch lights to change to a different color, depending on the holiday. For the most part this works fantastic. This year I got the idea that it would be nice for certain holidays to change the colors a couple of days before the holiday itself. For example Memorial Day. The actual date changes every year so I cannot add it in via a scheduled day like February 14th. But I would love to have my GCal trip 2 days early, but only for this holiday since the two days before would always be a weekend. Is it possible to easily have GCal see and trip this event early so PLEG will pick up that it is "MEMORIAL DAY" and change my lights?

EDIT: Ok I completely missed another post where the user asked pretty much the same thing. The answer there was to use StartDelta and EndDelta. However I'm at a loss for where I set this. I'm using PLEG to monitor for the holiday event and then change the lighting based on the event being true or not. Where would I define my deltas?

EDIT EDIT: I think I understand the documentation. for my Event name of MEMORIAL DAY, would I just set that to MEMORIAL DAY[-2880,0] for the event to trigger 48 hours earlier? (See new image attached.)
« Last Edit: June 13, 2018, 05:02:08 pm by 3rdStng »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #684 on: June 13, 2018, 05:01:37 pm »
I'm curious if the following idea of mine is possible, without the addition of another GCal virtual object creation.

I have a GCal instance connected to the public holiday's that Google publishes. I then use PLEG to trigger my porch lights to change to a different color, depending on the holiday. For the most part this works fantastic. This year I got the idea that it would be nice for certain holidays to change the colors a couple of days before the holiday itself. For example Memorial Day. The actual date changes every year so I cannot add it in via a scheduled day like February 14th. But I would love to have my GCal trip 2 days early, but only for this holiday since the two days before would always be a weekend. Is it possible to easily have GCal see and trip this event early so PLEG will pick up that it is "MEMORIAL DAY" and change my lights?

Maybe :o

You would have to do something like this:

Set multiple keywords - one for each of the holidays you want to react to.  For each keyword that you want to trigger differently to it's actual start / end,  set a start end delta e.g.   ....;MEMORIAL DAY [-2880,0];INDEPENDENCE DAY; .....

So MEMORIAL DAY would be triggered -2880 minutes (negative = before) the calendar date / time.

As well you would need to set gc_ExtraDays to what ever your largest offset (in days) minus one.  Since 0 (the default) means "look forward 1 day.  So if you were needing to look forward 2 days you would set gc_ExtraDays = 1

See the documentation  for more details.

Offline 3rdStng

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: GCAL3 - Version 2.6
« Reply #685 on: June 13, 2018, 05:07:15 pm »
Maybe :o

You would have to do something like this:

Set multiple keywords - one for each of the holidays you want to react to.  For each keyword that you want to trigger differently to it's actual start / end,  set a start end delta e.g.   ....;MEMORIAL DAY [-2880,0];INDEPENDENCE DAY; .....

So MEMORIAL DAY would be triggered -2880 minutes (negative = before) the calendar date / time.

As well you would need to set gc_ExtraDays to what ever your largest offset (in days) minus one.  Since 0 (the default) means "look forward 1 day.  So if you were needing to look forward 2 days you would set gc_ExtraDays = 1

See the documentation  for more details.
I was cross posting at the same time. I think I came to a near similar conclusion as you did. I missed the ExtraDays setting though.

What I did was set my Event name of MEMORIAL DAY to MEMORIAL DAY[-2880,0] for the event to trigger 48 hours earlier?

I was reading the documentation, but I got lost in there and was getting confused. If my above is correct, then I think I am getting the picture now. I also wasn't aware that I could set multiple holidays within the same event. That makes sense, as long as my color patterns are the same. I could reduce my GCal events for Flag Day, Memorial Day, and Fourth of July into one, as long as I was OK with the -2880 on each.  Correct?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 723
  • Karma: +71/-2
Re: GCAL3 - Version 2.6
« Reply #686 on: June 13, 2018, 05:18:01 pm »
Assuming you have a mixture of holidays with different offsets --- you could put them all in one GCal and only add the offset to the ones that need it.  This is what I'd do and is partially represented in the prior post.  It's a single instance and you can play around with early start / late finish on a holiday by holiday basis, to amuse yourself no end  ;D

or you could have 2 GCal one that had holidays with no offset and another that had holidays ALL with the same offset (if that's what you want).  The difference in the second option is that you could do away with individual offsets [x,y] on the keywords and just set a global offset (using gc_StartDelta etc).


Offline 3rdStng

  • Full Member
  • ***
  • Posts: 117
  • Karma: +1/-0
Re: GCAL3 - Version 2.6
« Reply #687 on: June 13, 2018, 05:27:59 pm »
I see it now.....

MEMORIAL DAY [-2880,0];FLAG DAY;INDEPENDENCE DAY[-5760,0]

As long as the gc_ExtraDay was set to 3 for my example above.

WOW! That would reduce my number of triggers and conditions within PLEG by a couple of extra entries.  [Mind blown emoticon here]


Offline aboyer

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: GCAL3 - Version 2.6
« Reply #688 on: September 12, 2018, 02:54:18 pm »
Hi Stuart,

I have been using this plugin for quite sometime but recently upgraded to UI7 on my VeraLite. There were a bunch of issues when I did the update and now I am trying to recreate all of my system. I did try a restore and that didn't help so I am starting from scratch.

I have followed the instructions that you provided in this thread but I am still having issues. I even tried using the test calendar and I still get the same error: missing access_token

First thing I tried was to upgrade as I was running an older version. I think it was 1.6. When I couldn't get that to work, I upgraded and still no luck.

I deleted the plugin, rebooted my VeraLite and then installed the plugin again. When I got the missing access_token error again, I read through the thread again and found about trying the GCal3Test info and json file.

I even deleted the plugin again, rebooted the VeraLite and then tried the GCal3Test info and json file again just to make sure that it had nothing to do with me trying with my google account info but I continue to get the same error.

One thing I did notice, after uploading the GCal3Test.json to the Vera, I no longer see it in the list of files but I assume it is still on the device. Is this normal?

I have attached the log file. I hope you have an idea of what I can try or what I am doing wrong as I have several PLEG triggers based on this plugin.

Not sure if it is relevant but my VeraLite firmware is 1.7.1040

Thanks,
Antonio
« Last Edit: September 12, 2018, 02:58:10 pm by aboyer »

Offline skruffy

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.6
« Reply #689 on: September 12, 2018, 09:13:09 pm »
I've had the same experience as you Antonio except I'm still on UI5.  My calendar recently stopped working.  I upgraded to 2.6, uninstalled/reinstalled, but still getting "missing access_token".  I've confirmed that the GCal3.json file is still in /etc/cmh-ludl/GCal3 but after a reload, the file disappears from the list of luup files online.  I've attached a log file.  Really hope to get this working again.

Jeremy