We have moved at community.getvera.com

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

Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: GCAL3 - V 1.0 Released
« Reply #270 on: December 01, 2014, 02:32:10 pm »
Thanks for the clarification Stuart.

If I try to view or download the "G" I get:
a new window :veraIP/cgi-bin/cmh/view_upnp_file.sh?file=GCal3
 
This page contains the following errors:

error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.


And if I log in to vera and check the cmh-ludl folder I see a folder called GCal3 so my guess is that the folder can not be displayed properly on the Vera interface.
- Tomas

Offline jennyfur

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: GCAL3 - V 0.9 Released
« Reply #271 on: December 03, 2014, 05:42:43 am »
Hi, I'm a new Vera owner and I'm trying to find instructions on how to set this plugin up. Thanks.
Still looking for some information regarding this. The links on the first post are all inactive (specifically the "Setting up a Google V3 API Service Account" and the "Installation and User Guide" which I assume would be what I need).

Offline korttoma

  • Hero Member
  • *****
  • Posts: 729
  • Karma: +26/-5
Re: GCAL3 - V 1.0 Released
« Reply #272 on: December 03, 2014, 06:19:30 am »
There is an pdf attachement on the bottom of the first post I'll try to put a link to it -> http://forum.micasaverde.com/index.php?action=dlattach;topic=26692.0;attach=19456
- Tomas

Offline jennyfur

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: GCAL3 - V 1.0 Released
« Reply #273 on: December 03, 2014, 09:42:40 am »
There is an pdf attachement on the bottom of the first post I'll try to put a link to it -> http://forum.micasaverde.com/index.php?action=dlattach;topic=26692.0;attach=19456
Thank you! That's a start at least. Finally have the plugin tied to my calendar. :)

Offline SM2k

  • Full Member
  • ***
  • Posts: 179
  • Karma: +4/-0
Re: GCAL3 - V 1.1 Released
« Reply #274 on: January 23, 2015, 03:32:21 pm »
I use a lot of luup.variable_watch functions to respond to state changes in my google calendar sensors.

One thing I've noticed about the GCal3 plugin that differs from previous incarnations of this plugin is that it triggers calls to my handler functions even when the value didn't change. @Stuart, does the plugin call variable_set regardless of if the value changed or something?

one example of how this causes an unintended side effect: I use a multiswitch for various "states" for the house. like "guests" or "vacation". I also have calendar switches for some of those. the variable_watch functions for the calendar switches simply sets the state of the multiswitch. the point of using both is that I can schedule vacation in advance or simply change the state quickly directly from the multiswitch if something comes up. the trouble is that if the GCal3 plugin sets the state of "guests" from 0 to 0, for instance, it effectively clears at random intervals any mode I had set manually. I can go re-code all the handler functions I wrote back from the GCal1 days, but I thought I'd mention this because it seems like the wrong behavior by the plugin--it's possible it's causing spurious scene executions for anybody that's using GCal3 as a trigger.

thanks for writing the GCal3 plugin, @Stuart. It's absolutely fantastic!

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.1 Released
« Reply #275 on: January 23, 2015, 04:31:26 pm »
I use a lot of luup.variable_watch functions to respond to state changes in my google calendar sensors.

One thing I've noticed about the GCal3 plugin that differs from previous incarnations of this plugin is that it triggers calls to my handler functions even when the value didn't change. @Stuart, does the plugin call variable_set regardless of if the value changed or something?

one example of how this causes an unintended side effect: I use a multiswitch for various "states" for the house. like "guests" or "vacation". I also have calendar switches for some of those. the variable_watch functions for the calendar switches simply sets the state of the multiswitch. the point of using both is that I can schedule vacation in advance or simply change the state quickly directly from the multiswitch if something comes up. the trouble is that if the GCal3 plugin sets the state of "guests" from 0 to 0, for instance, it effectively clears at random intervals any mode I had set manually. I can go re-code all the handler functions I wrote back from the GCal1 days, but I thought I'd mention this because it seems like the wrong behavior by the plugin--it's possible it's causing spurious scene executions for anybody that's using GCal3 as a trigger.

thanks for writing the GCal3 plugin, @Stuart. It's absolutely fantastic!

What specific variables are you watching ?   There are several in GCal3 that get overwritten each time the plugin checks the calendar - although I'd think most of these would not have even been in the old GCal1 (but clearly some were).  In general - I did not deliberately attempt to only update on changes, since this would require quite a bit of code.  From memory, the old GCal did not do that either, although it may have worked out that way.

Give me some specifics and I'll see what can be done.

Offline Kmitchel

  • Full Member
  • ***
  • Posts: 168
  • Karma: +1/-2
Re: GCAL3 - V 1.1 Released
« Reply #276 on: January 24, 2015, 02:13:24 pm »
I'm trying to set this up and I am stuck on step 7.  I changed the name of the json file and found an online json file viewer to open the file for step 7. 

I am using this viewer:  https://www.jsoneditoronline.org/

Is there a better way to read the json?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.1 Released
« Reply #277 on: January 24, 2015, 04:33:23 pm »
I'm trying to set this up and I am stuck on step 7.  I changed the name of the json file and found an online json file viewer to open the file for step 7. 

I am using this viewer:  https://www.jsoneditoronline.org/

Is there a better way to read the json?

No need to try and open it in anything fancy - just a text editor like notepad++ will do (which is what I used)

But with jsoneditoronline - the bit you want to copy will be in the right hand pane as the value for client_email :  which is already presented without the quotes

Offline SM2k

  • Full Member
  • ***
  • Posts: 179
  • Karma: +4/-0
Re: GCAL3 - V 1.1 Released
« Reply #278 on: January 26, 2015, 10:34:52 am »

What specific variables are you watching ?   There are several in GCal3 that get overwritten each time the plugin checks the calendar - although I'd think most of these would not have even been in the old GCal1 (but clearly some were).  In general - I did not deliberately attempt to only update on changes, since this would require quite a bit of code.  From memory, the old GCal did not do that either, although it may have worked out that way.

Give me some specifics and I'll see what can be done.

Oops, good point, I didn't mention that. In general the only variable I actually watch is "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped".

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.1 Released
« Reply #279 on: January 26, 2015, 12:01:24 pm »

What specific variables are you watching ?   There are several in GCal3 that get overwritten each time the plugin checks the calendar - although I'd think most of these would not have even been in the old GCal1 (but clearly some were).  In general - I did not deliberately attempt to only update on changes, since this would require quite a bit of code.  From memory, the old GCal did not do that either, although it may have worked out that way.

Give me some specifics and I'll see what can be done.

Oops, good point, I didn't mention that. In general the only variable I actually watch is "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped".

I looked at the code, there are only 4 times that  "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped" gets changed or rewritten (to the same value as before):
1) During a reload - rewrite
2) In response to a new event starting - change
3) In response to an event ending - change
4) when there is calendar check - rewrite

# 4 and some other variables are re-written at each calendar check and is some really old code when I though you could manually change a variable in the advanced tab and mios would just update it.

My experience since then is that mios always reloads when you change a variable so there is no point in that old code ..... although I have to check / validate this with UI7 as well ........ I'll do some tests to see if it's redundant .....

But - unless the variable_watch is reporting a change in response to #4 (even though the variable would not normally change) - I'm not sure what situation would cause the issue you are seeing.

If you can describe a reproducible scenario and include a log file covering the period when it happens, (pls set gc_debug to 3 before creating the log file) - then we should be able to narrow down and hopefully fix


Offline SM2k

  • Full Member
  • ***
  • Posts: 179
  • Karma: +4/-0
Re: GCAL3 - V 1.1 Released
« Reply #280 on: January 26, 2015, 12:41:25 pm »
I looked at the code, there are only 4 times that  "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped" gets changed or rewritten (to the same value as before):
1) During a reload - rewrite
2) In response to a new event starting - change
3) In response to an event ending - change
4) when there is calendar check - rewrite

# 4 and some other variables are re-written at each calendar check and is some really old code when I though you could manually change a variable in the advanced tab and mios would just update it.

My experience since then is that mios always reloads when you change a variable so there is no point in that old code ..... although I have to check / validate this with UI7 as well ........ I'll do some tests to see if it's redundant .....

But - unless the variable_watch is reporting a change in response to #4 (even though the variable would not normally change) - I'm not sure what situation would cause the issue you are seeing.

If you can describe a reproducible scenario and include a log file covering the period when it happens, (pls set gc_debug to 3 before creating the log file) - then we should be able to narrow down and hopefully fix

The two cases where the Tripped state gets rewritten (#1 reload and #4 calendar check) is exactly what I'm seeing my variable_watch code getting triggered. It'll take a bit before I can collect logs, but I recall seeing a line being logged stating that "Tripped" was changed from "0" to "0" for instance. I can reliably reproduce this by reloading my vera, it'll just take a bit to sift thru the logs and pull out the dozen lines or so you need.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.1 Released
« Reply #281 on: January 26, 2015, 02:00:12 pm »

The two cases where the Tripped state gets rewritten (#1 reload and #4 calendar check) is exactly what I'm seeing my variable_watch code getting triggered. It'll take a bit before I can collect logs, but I recall seeing a line being logged stating that "Tripped" was changed from "0" to "0" for instance. I can reliably reproduce this by reloading my vera, it'll just take a bit to sift thru the logs and pull out the dozen lines or so you need.

I have not fully tested - but if you are feeling brave, you could try this version:  I removed the updates to "Tripped" at #1 and MAY have miss-spoke about #4 (although there may be a side affect I have yet to find).

EDIT: Attachment removed
« Last Edit: February 15, 2015, 05:56:54 pm by Stuart »

Offline Kmitchel

  • Full Member
  • ***
  • Posts: 168
  • Karma: +1/-2
Re: GCAL3 - V 1.1 Released
« Reply #282 on: January 26, 2015, 03:43:20 pm »

I'm trying to set this up and I am stuck on step 7.  I changed the name of the json file and found an online json file viewer to open the file for step 7. 

I am using this viewer:  https://www.jsoneditoronline.org/

Is there a better way to read the json?

No need to try and open it in anything fancy - just a text editor like notepad++ will do (which is what I used)

But with jsoneditoronline - the bit you want to copy will be in the right hand pane as the value for client_email :  which is already presented without the quotes

When I opened the JSON in Notepad, it looks like Chinese.


Sent from my iPhone using Tapatalk

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.1 Released
« Reply #283 on: January 26, 2015, 04:14:24 pm »

I'm trying to set this up and I am stuck on step 7.  I changed the name of the json file and found an online json file viewer to open the file for step 7. 

I am using this viewer:  https://www.jsoneditoronline.org/

Is there a better way to read the json?

No need to try and open it in anything fancy - just a text editor like notepad++ will do (which is what I used)

But with jsoneditoronline - the bit you want to copy will be in the right hand pane as the value for client_email :  which is already presented without the quotes

When I opened the JSON in Notepad, it looks like Chinese.


Sent from my iPhone using Tapatalk

Notepad++ is not Notepad - it's much nicer in many ways.  Notepad does not format well and depending on the encoding you have set, may well look like Chinese :-)

http://notepad-plus-plus.org/download/v6.7.4.html

 or just use jsoneditoronline as you had started to do.




Offline iLLphiL

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-1
Re: GCAL3 - V 1.1 Released
« Reply #284 on: January 30, 2015, 02:19:49 pm »
Hate to be that guy.. I cant seem to find the setup information for this plugin. I keep getting an error, Its attached as an image... cant seem to figure out what it is i am doing wrong.