We have moved at community.getvera.com

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

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: GCAL3 - Version 2.2
« Reply #495 on: June 06, 2016, 12:23:41 am »
I understand you were only giving an example, but in this case the calendar hadn't been changed for months. I think your initial thought about an Internet outage might be the direction. The question is does the plugin "die" when that happens or can it use what it already knows and then self recover when the intently is back?

Offline aladur

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.2
« Reply #496 on: June 06, 2016, 10:41:18 am »
Hi Stuart,
After installation according to the installation steps everything looks fine - except the events aren't triggered.
The VeraPlus shows the correct date+time: Mon 16:28:00
The Plugin-Calendar correctly shows the Google-Calendar-events:
10:00:00
16:30:00
17:00:00
The variables are correclty: gc_eventsToday=3, gc_eventsLeftToday=2
When reaching 16:30:00, nothing happens. The scene with (trigger when event has name ...) isn't triggered.
Also none of the notifications is triggered (EVENT_HAS_A_SPECIFIED_NAME, EVENT_MATSCHES_KEYWORD, EVENT_START_OR_END).
The plugin control at 16:40:00 still reports "Next Event 16:30 Jun 06"
After 17:00 it reports "Next Event 17:00 Jun 06".

What's wrong?
Thanks!

« Last Edit: June 07, 2016, 02:50:19 am by aladur »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #497 on: June 07, 2016, 03:37:33 pm »
I understand you were only giving an example, but in this case the calendar hadn't been changed for months. I think your initial thought about an Internet outage might be the direction. The question is does the plugin "die" when that happens or can it use what it already knows and then self recover when the intently is back?

Try this version.  I made a couple of changes.  Previously - if the plugin could not access the calendar it made 3 attempts about one minute apart and if it still could not connect - it stopped.

The new behavior is that it will make  3 attempts and then continue to use the last "good" list of events.  It will recheck the connection periodically (mostly this means at the start and end of events).  When it is in this "offline" mode it will place two asterisks ( **) a the start of the event name.

Note that events are held in memory and so if the vera unit reloads when there is no internet connection - then the plugin will stop.

I've tested this my plugging and unplugging my router to the outside world and it worked fine in that testing.  Any additional testing would be helpful.

Edit: File Removed
« Last Edit: June 14, 2016, 03:43:37 pm by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #498 on: June 07, 2016, 03:48:17 pm »
Hi Stuart,
After installation according to the installation steps everything looks fine - except the events aren't triggered.
The VeraPlus shows the correct date+time: Mon 16:28:00
The Plugin-Calendar correctly shows the Google-Calendar-events:
10:00:00
16:30:00
17:00:00
The variables are correclty: gc_eventsToday=3, gc_eventsLeftToday=2
When reaching 16:30:00, nothing happens. The scene with (trigger when event has name ...) isn't triggered.
Also none of the notifications is triggered (EVENT_HAS_A_SPECIFIED_NAME, EVENT_MATSCHES_KEYWORD, EVENT_START_OR_END).
The plugin control at 16:40:00 still reports "Next Event 16:30 Jun 06"
After 17:00 it reports "Next Event 17:00 Jun 06".

What's wrong?
Thanks!

It is hard to interpret what you are saying - there is not enough information.  It sounds like you may not be setting up triggers on your scenes correctly. Please provide a log file and I can help you.

Offline aladur

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.2
« Reply #499 on: June 08, 2016, 04:42:11 am »
is gc_debug=1 sufficient?

Edit: file removed
« Last Edit: June 14, 2016, 03:42:59 pm by Stuart »

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: GCAL3 - Version 2.2
« Reply #500 on: June 08, 2016, 04:49:44 am »
I understand you were only giving an example, but in this case the calendar hadn't been changed for months. I think your initial thought about an Internet outage might be the direction. The question is does the plugin "die" when that happens or can it use what it already knows and then self recover when the intently is back?

Try this version.  I made a couple of changes.  Previously - if the plugin could not access the calendar it made 3 attempts about one minute apart and if it still could not connect - it stopped.

The new behavior is that it will make  3 attempts and then continue to use the last "good" list of events.  It will recheck the connection periodically (mostly this means at the start and end of events).  When it is in this "offline" mode it will place two asterisks ( **) a the start of the event name.

Note that events are held in memory and so if the vera unit reloads when there is no internet connection - then the plugin will stop.

I've tested this my plugging and unplugging my router to the outside world and it worked fine in that testing.  Any additional testing would be helpful.

Stuart - thanks for being responsive!  I think this solution solves most of the issue and would be fine.
Just to be really clear as to the problem case: If a GCAL user is away for a week and early in the week there was an internet outage for a few hours, they shouldn't need to manually intervene for their system to keep working. 
The gap I can see in your solution is it seems like reconnect is only attempted if another GCAL event (that is in memory) is fired.  If there wasn't another vent in memory (or the event in memory occurred during the outage) then potentially there could still be cases where the system needs manual intervention to continue.  Is it possible to attempt to reconnect every few hours (or use the configuration setting already there)?  That way, even if the internet goes down, it will automatically reset itself when it comes back up.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #501 on: June 08, 2016, 10:27:34 am »
@MSW -- the plugin also checks the calendar every gc_Interval minutes (default 180) if there are no events..  The real problem (and I have to think further on this) is what happens if vera reloads (which it does for different reasons) and there is no internet connection at that time.  In the current execution model - GCal will stop if, at startup, it cannot verify credentials / access the calendar.

Offline MSW

  • Full Member
  • ***
  • Posts: 114
  • Karma: +6/-6
Re: GCAL3 - Version 2.2
« Reply #502 on: June 08, 2016, 10:51:56 am »
@MSW -- the plugin also checks the calendar every gc_Interval minutes (default 180) if there are no events..  The real problem (and I have to think further on this) is what happens if vera reloads (which it does for different reasons) and there is no internet connection at that time.  In the current execution model - GCal will stop if, at startup, it cannot verify credentials / access the calendar.

That's excellent.  What you have should cover 99% of  internet down scenarios then, which is a huge improvement.  Thanks!

Offline aladur

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.2
« Reply #503 on: June 09, 2016, 12:57:30 pm »
Hi Stuart, are you able to view my log?
Thanks!!

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #504 on: June 09, 2016, 03:46:13 pm »
Hi Stuart, are you able to view my log?
Thanks!!

Yes -- I looked at your log.  I believe you are using V2.0 - it would be best if you were using V2.2.
gc_debug should be set to 3 for troubleshooting.
In any case - from the log file, the plugin is not "seeing" any events.So it is not doing anything (as is to be expected) .  It does appear to be accessing the calendar ok (although with gc_debug set to 1 I'm somewhat guessing).
I suspect that you do not have the permissions set in the calendar as described in the documentation.

My recommendation is to take a 3 step approach.
1) Upgrade to release 2.2
2) Test using the test calendar nd credentials to make sure everything works.
3) Check the permissions on your calendar and then test it.

Let me know how you make out.  It will be something simple .....

Offline aladur

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: GCAL3 - Version 2.2
« Reply #505 on: June 10, 2016, 03:19:51 am »
Hi Stuart,
step-1 helped. After upgrading to 2.2 it is workig well. Just the "Check" button does not react when clicking on it. I need to disarm+arm.
Thanks!
« Last Edit: June 10, 2016, 03:28:33 am by aladur »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #506 on: June 10, 2016, 02:04:45 pm »
Hi Stuart,
step-1 helped. After upgrading to 2.2 it is workig well. Just the "Check" button does not react when clicking on it. I need to disarm+arm.
Thanks!
I assume that the check button not working was a "one-time" thing immediately after the upgrade ?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Version 2.2
« Reply #507 on: June 14, 2016, 03:52:59 pm »
For those interested in GCal working through an internet outage --  here's a newer version which I'll release in the marketplace shortly.

If the internet drops - GCal will continue to work using the last "good" calendar information.
If vera reboots and there is no internet  - GCal will continue to work using the last "good" calendar information.
If the calendar id or Credentials file are changed -- GCal MUST have an internet connection at that time to validate that the calendar is accessible, and to get a "good" set of calendar information.

Of course - if you have an extended internet outage - the last "good" calendar information may not be any use if all the events have passed ....

When working "offline" the event name in the display panel will be proceeded by two asterisks i.e. **

There are two files to update.  Make sure to reboot your vera after you have downloaded these files and make sure you have internet connection when you do  :-) .

Edit: remove files -- please use the formal release 2.3 from the marketplace.
« Last Edit: July 19, 2016, 03:38:59 pm by Stuart »

Offline powisquare

  • Full Member
  • ***
  • Posts: 146
  • Karma: +1/-0
Re: GCAL3 - Version 2.2
« Reply #508 on: July 27, 2016, 05:57:22 pm »
Have gcal checking an ical calendar in the hope to eventually control a heating setup. The calendar items being checked are whole day events. I believe the timings for these events are 00.00 to 00.00 (midnight to midnight) on the google side. The time showing in ical for my next event is 00:00 Jul 23 to 00:01 Jul 30. Problem I have is the event after this starts 00.00 JUL 30 and so my test switch gets turned on (at 00.00) and then off (00.01). Perhaps it should read 00.00 JUL 30? Any help appreciated.

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: GCAL3 - Version 2.2
« Reply #509 on: July 27, 2016, 06:04:55 pm »
Hi Stuart,

I haven't loaded plugins to Vera in quite a while (there I go showing my love for Vera). I typically grab what I can off these threads and upgrade all my openLuup systems. Akbooer/amg0 now have their own App Store and I'd love to see this plugin available there. I believe they host their plugins loaded to Github, perhaps another means to make accessibility easier.

Thoughts ?

For those interested in GCal working through an internet outage --  here's a newer version which I'll release in the marketplace shortly.

If the internet drops - GCal will continue to work using the last "good" calendar information.
If vera reboots and there is no internet  - GCal will continue to work using the last "good" calendar information.
If the calendar id or Credentials file are changed -- GCal MUST have an internet connection at that time to validate that the calendar is accessible, and to get a "good" set of calendar information.

Of course - if you have an extended internet outage - the last "good" calendar information may not be any use if all the events have passed ....

When working "offline" the event name in the display panel will be proceeded by two asterisks i.e. **

There are two files to update.  Make sure to reboot your vera after you have downloaded these files and make sure you have internet connection when you do  :-) .

Edit: remove files -- please use the formal release 2.3 from the marketplace.
openLuup, AltUI, Zway and HomeWave, enough said...