We have moved at community.getvera.com

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

Offline kiethr

  • Full Member
  • ***
  • Posts: 110
  • Karma: +1/-2
Re: GCAL3 - Google Calendar 3
« Reply #45 on: August 31, 2014, 11:24:11 am »
Thanks for pointing me in the right direction.  I did figure out what the issue was.  When i renamed the json file, I renamed it with the extension therefore getting a file named GCal3.json.json.  Once i corrected that everything else worked great.

Thanks again its a great app.

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #46 on: August 31, 2014, 04:44:56 pm »
Hi

Just loaded the updated LUA file. Good news is, gc_jsonevents now shows something:

[{'eventEnd':1409490000,'eventStart':1409439600,'eventName':'VACATION'},{'eventEnd':1409521200,'eventStart':1409517600,'eventName':'VACATION'}]

It trips (though it appeared to do that previously), however the PLEG is still not detecting it using the following as an input:

GcalVacation   GCal3 has event with name: VACATION

Any ideas?

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #47 on: September 01, 2014, 08:07:50 am »
@Stuart: Could it be trailing spaces before/after the event name why PLEG does  not pick it up?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #48 on: September 01, 2014, 11:39:31 am »
@Stuart: Could it be trailing spaces before/after the event name why PLEG does  not pick it up?

Possible if there are spaces in the PLEG condition.  I trim whitespace within GCal3 though.

I will take a closer look tomorrow as there are some issues on the vera side around this especially with notifications

Offline babas

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #49 on: September 01, 2014, 02:24:08 pm »
Hello,

I have found my problem. In the file "Setting up a Google V3 API Service Account.pdf" page 3 line 2 the new name set is "CGal3.json" but the real name for the file is "GCal3.json"( C and G is invert).

thanks for this plugin.

babas

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #50 on: September 01, 2014, 11:56:15 pm »
Hello,

I have found my problem. In the file "Setting up a Google V3 API Service Account.pdf" page 3 line 2 the new name set is "CGal3.json" but the real name for the file is "GCal3.json"( C and G is invert).

thanks for this plugin.

babas

Thanks !   I have updated the document

Offline lwinter

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #51 on: September 02, 2014, 03:03:35 am »
I don't know if I'm on the good topic.
I use GCAL v1 for 2 years and it works well. The plugin is triggered and a scene will be started. For example : "Wake up" on 7:00 (to 7:01) on my Google calendar. The scene "Wake up" will start at 7:00 when "A Calendar Event is Active" with "Wake up" as keyword.
I installed the GCAL3 last week and I don't understand the 5th point in the usage notes :
Quote
If set to false (recommended) then the scene can be specified to react to ?An event has specified name? this does not technically trigger the plugin ? but the event is ?active?.
The device GCAL3 is active at 7:01 and not at 7:00 and no scene will start. I changed the parameters to
Code: [Select]
gc_Keyword = Wake Up;Away
gc_exactKeyword = true
gc_ignoreKeyword = false
gc_triggerNoKeyword = false
gc_ignoreAllDayEvent = false
but the result is the same. How can I trigger a scene with a GCAL3 device ?
Sorry for my english and thanks for your answers.
« Last Edit: September 02, 2014, 12:20:53 pm by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #52 on: September 02, 2014, 12:14:50 pm »
Hi,

Moving from the original Gcal to Gcal3 and having some issues with PLEG & GCAL3 I don't get.

I'm reading the gc_Trippedevent variable and using this value as a condition. See below for the PLEG logic.

What I don't get is that all three conditions are true.

Please note that the calendar items do not overlap so only one should be true.


Device Properties
Name   Device Name   Device Variable   Value   Last Change   Previous Change
GcalEvent   GCal3 Sensor   gc_TrippedEvent   KIDSWEG   2014-08-28 06:27:21.102   2014-08-28 06:26:21.789


Conditions
TempKidsWeg   No   GcalEvent=="KIDSWEG"   true   2014-08-26 20:03:18.346   2014-08-26 20:01:51.372
TempKidsWarm   No   GcalEvent=="KIDSWARM"   true   2014-08-26 20:09:23.507   0
TempKidsSlapen   No   GcalEvent=="KIDSSLAPEN"   true   2014-08-26 20:09:23.510   0

I did some tests as follows:
3 events each of 5 minutes, one after the other; TEST1, TEST2 TEST3.

Attributes and results per the attached. Seems to be working as it should.  I.e. the three events last being seen as true by PLEG each separated by 5 minutes.  Is your setup working now ?



« Last Edit: September 02, 2014, 12:18:08 pm by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #53 on: September 02, 2014, 12:38:10 pm »
I don't know if I'm on the good topic.
I use GCAL v1 for 2 years and it works well. The plugin is triggered and a scene will be started. For example : "Wake up" on 7:00 (to 7:01) on my Google calendar. The scene "Wake up" will start at 7:00 when "A Calendar Event is Active" with "Wake up" as keyword.
I installed the GCAL3 last week and I don't understand the 5th point in the usage notes :
Quote
If set to false (recommended) then the scene can be specified to react to ?An event has specified name? this does not technically trigger the plugin ? but the event is ?active?.
The device GCAL3 is active at 7:01 and not at 7:00 and no scene will start. I changed the parameters to
Code: [Select]
gc_Keyword = Wake Up;Away
gc_exactKeyword = true
gc_ignoreKeyword = false
gc_triggerNoKeyword = false
gc_ignoreAllDayEvent = false
but the result is the same. How can I trigger a scene with a GCAL3 device ?
Sorry for my english and thanks for your answers.

The one minute delay is normal.  I took a very conservative approach to provide a delay between the completion of one event and the start of the next so that other plugins could respond.

An event has specified name -  this does not technically trigger the plugin  -  but the event is "active"
This differentiates between 'triggering' and being able to react to a keyword with "A Calendar Event is Active" but not triggering (from Vera's perspective).  Without this vera would trigger on every event (with no gc_Keyword)

So you can leave gc_Keyword blank and use "A Calendar Event is Active" to "Activate" based on event names you set in your scenes.

How are you setting your scenes ?  Are the conditions set to be upper case ?   All the keywords are changed to upper case within the plugin and the matching conditions therefore need to be in upper case as well.


Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #54 on: September 02, 2014, 12:39:08 pm »
Looking at the screenshot I also see last false in all three occasions was identical and is the time of the last condition. 

If t3 event would still be true,  t1 and t2 would also still be true.

In other words, if you would have made the screenshot within the 5min test3 was active I think you would have seen all three conditions being true.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #55 on: September 02, 2014, 01:04:43 pm »
Looking at the screenshot I also see last false in all three occasions was identical and is the time of the last condition. 

If t3 event would still be true,  t1 and t2 would also still be true.

In other words, if you would have made the screenshot within the 5min test3 was active I think you would have seen all three conditions being true.

The reason all three have the same 'last false' time is that PLEG evaluates all three conditions whenever one of them changes state.  So this is correct.

Each one became true - sequentially - at the time indicated in the 'last true' column.

I did a rerun (all I did was change the event times).  The first (result2)  is with TEST2 'active' (5 minutes later than TEST1) but with TEST3 yet to occur (it has the old true / false times).
T1 was last true at 10:45:51 but is currently false
T2 became true at 10:52:15 and is true
T3 was last true at 9:31:07 but is currently false

Result 3 shows what it looks like during the 3 minutes when TEST 3 was active

This looks to be correct to me.


Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #56 on: September 02, 2014, 01:48:11 pm »
Cool! Just arrived home.  Will re-test. PS do I need to update any files? I have the version available via the app store

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #57 on: September 02, 2014, 02:03:56 pm »
Cool! Just arrived home.  Will re-test. PS do I need to update any files? I have the version available via the app store

I'd use the version here - although I did not change anything relating to events,

http://forum.micasaverde.com/index.php/topic,26692.msg190735.html#msg190735

Offline lwinter

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #58 on: September 02, 2014, 02:52:10 pm »
Quote
An event has specified name -  this does not technically trigger the plugin  -  but the event is "active"
This differentiates between 'triggering' and being able to react to a keyword with "A Calendar Event is Active" but not triggering (from Vera's perspective).  Without this vera would trigger on every event (with no gc_Keyword)

So you can leave gc_Keyword blank and use "A Calendar Event is Active" to "Activate" based on event names you set in your scenes.

How are you setting your scenes ?  Are the conditions set to be upper case ?   All the keywords are changed to upper case within the plugin and the matching conditions therefore need to be in upper case as well.
I leave gc_Keyword, gc_ignoreKeyword = false then true and nothing happen : the scene doesn't start.
The next Event is TEST. My device is active but the scene will not be triggered.
Trigger of the scene :
A calendar event is active
Status ? Module is active
script of the scene :
Code: [Select]
local valeur = luup.variable_get("urn:srs-com:serviceId:GCalIII","gc_TrippedEvent",191)
my_prowl("Value ?", valeur, "", 0)
end
but when I execute the scene manually, it returns on Prowl Value ? TEST

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #59 on: September 02, 2014, 05:07:22 pm »
Hi Stuart

In your PLEG tests, are you using the device property (as per Tyfoons example) or the "Event has specified name" input method? I have been able to get it to work using the device property mechanism, but not using Event has specified name. Could be I am using that wrong, or expecting it to work in a way that it is not designed? Would be good if you could explain how that should behave in PLEG?

ps - @Tyfoon, I noticed you are using == in your conditions, which is a numerical comparison operator. I think you have to use eq - the string operator. Something to try if it still doesnt work for you.

Cheers
« Last Edit: September 02, 2014, 05:11:42 pm by Borat »