We have moved at community.getvera.com

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

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #60 on: September 02, 2014, 05:31:16 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

Keywords are all forced to UPPER CASE in the plugin - so any comparison must be in UPPER CASE as well.  Not shouting  :)  just emphasizing ....

Your example test value is in lower case  :'(

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #61 on: September 02, 2014, 05:55:08 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

Close but no cigar  ;D -- but a great catch (I had not looked at PLEG for a while)

use the eq operator in PLEG

This screen shot shows both approaches working TEST2 is "active" but the plugin is not "triggered".  So if you wanted to do something based on TEST2, you could use a condition requiring T2 to be true or alternatively c2 (as defined)




« Last Edit: September 02, 2014, 06:14:35 pm by Stuart »

Offline ndoty

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #62 on: September 02, 2014, 06:38:19 pm »
This was mentioned before but when you have more than 1 GCal3 Device it will reload LUUP many many times. I know it was stated that only one Device should be needed since you can specify many keywords. However i need 2 separate devices, one for my work schedule and one for my wifes. I set certain things when we are both away and certain things when both or one are home. I have everything working as i want just if i change a setting in the device it will reload luup for each GCal3 device it seems, sometimes more.
« Last Edit: September 02, 2014, 10:47:22 pm by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #63 on: September 02, 2014, 10:48:54 pm »
This was mentioned before but when you have more than 1 GCal3 Device it will reload LUUP many many times. I know it was stated that only one Device should be needed since you can specify many keywords. However i need 2 separate devices, one for my work schedule and one for my wifes. I set certain things when we are both away and certain things when both or one are home. I have everything working as i want just if i change a setting in the device it will reload luup for each GCal3 device it seems, sometimes more.

Please see the earlier posts.  This has been solved - you need the version posted here.  It will be a few days before I get it to the marketplace.
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 #64 on: September 03, 2014, 01:00:47 am »
Quote

Keywords are all forced to UPPER CASE in the plugin - so any comparison must be in UPPER CASE as well.  Not shouting  :)  just emphasizing ....

Your example test value is in lower case  :'(

I do not have to be gifted  ???
You mean "Nom de ce d?clencheur:" must be in upper case ? Others keywords are in upper case in my example.
« Last Edit: September 03, 2014, 09:30:16 am by Stuart »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #65 on: September 03, 2014, 09:43:04 am »
Quote

Keywords are all forced to UPPER CASE in the plugin - so any comparison must be in UPPER CASE as well.  Not shouting  :)  just emphasizing ....

Your example test value is in lower case  :'(

I do not have to be gifted  ???
You mean "Nom de ce d?clencheur:" must be in upper case ? Others keywords are in upper case in my example.

Pardon -- Je lis pas francais

In your code the value of 'valeur' would be TEST
but I do not see you making the comparison for the string literal TEST
what is the function my_prowl doing ?  Also "Value ?" looks a little strange

local valeur = luup.variable_get("urn:srs-com:serviceId:GCalIII","gc_TrippedEvent",191)
my_prowl("Value ?", valeur, "", 0)
end

Wait - I see the problem ....   you are initiating your scene with "A Calendar event is active" - in which case you have to specify the keyword in the advanced tab in gc_Keyword.
That wording ought to be changed to something like "A Calendar event has satisfied a Keyword" .....
The option to set gc_Keyword blank and the calendar being thought of as "Active" but not "Triggered" relates to the initiation possibility of "An event has a specified name"

I'll make an appropriate change to try an avoid confusion in the future.

« Last Edit: September 03, 2014, 09:52:52 am by Stuart »

Offline lwinter

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #66 on: September 03, 2014, 02:23:49 pm »
Wait - I see the problem ....   you are initiating your scene with "A Calendar event is active" - in which case you have to specify the keyword in the advanced tab in gc_Keyword.
That wording ought to be changed to something like "A Calendar event has satisfied a Keyword" .....
The option to set gc_Keyword blank and the calendar being thought of as "Active" but not "Triggered" relates to the initiation possibility of "An event has a specified name"

I'll make an appropriate change to try an avoid confusion in the future.

That's right !! I specified a keyword (TEST in my example) in gc_Keyword and the scene will be triggered with "A Calendar event is active".
Thanks for your help !!

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Re: GCAL3 - Google Calendar 3
« Reply #67 on: September 03, 2014, 02:56:06 pm »
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.

Correct! I also noticed this after I posted. However this was not the solution. I now used Stuarts method and not the device properties anymore. Now it seems to be working!

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #68 on: September 03, 2014, 07:52:12 pm »
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.

Correct! I also noticed this after I posted. However this was not the solution. I now used Stuarts method and not the device properties anymore. Now it seems to be working!

Device Properties should work equally well - as I showed in the earlier post. At some point it's a matter of preference .....   but .... " if it isn't broken"  .... :o

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #69 on: September 04, 2014, 10:19:34 am »
@ Duiffie
Wow!   I have a vera light and do not know if there is supposed to be a difference.

The reason I went that route is because vera does not have a lua module that would otherwise be used.  So I assumed that the *nix libraries would be the safest approach.......

I'll send an email to vera support and ask.  It may be a simple opt install -  if so we can do that manually and later I can pout a check in the plugin.

I did 2 things and then things started to work:
- installed openssl: opkg install openssl-util
- changed the first line of the googlejwt.sh script (#!/bin/bash to #!/bin/ash) because bash seems not present on vera 2 as well

Hi Duiffie -

Could you do me a favor and tell me what version of openssl was installed ?

MCV have suggested a version to install (but not specifically identified for vera 2 - just 'try it') -- and their suggestion is different (newer) than on my vera light.  So I want to be a bit cautious here ....

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #70 on: September 06, 2014, 05:09:35 pm »
Hi Stuart

Is there some way to trigger overlapping events in PLEG? I have been able to get one to work using "Event with name" but it does not trigger on a second overlapping event. According to the manual
"1. If events overlap ? then the first event will complete before the second event starts i.e. the second event will have an effective start time at the end of the first event.", which I take to mean no, but I wanted to check as they show up in json events with a time, so I was hoping this could be possible. I was hoping to use the plugin for heating and other things, but there will almost inevitably be overlapping events.

Thanks
« Last Edit: September 06, 2014, 05:20:59 pm by Borat »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #71 on: September 06, 2014, 07:16:55 pm »
Hi Stuart

Is there some way to trigger overlapping events in PLEG? I have been able to get one to work using "Event with name" but it does not trigger on a second overlapping event. According to the manual
"1. If events overlap ? then the first event will complete before the second event starts i.e. the second event will have an effective start time at the end of the first event.", which I take to mean no, but I wanted to check as they show up in json events with a time, so I was hoping this could be possible. I was hoping to use the plugin for heating and other things, but there will almost inevitably be overlapping events.

Thanks

There is some good documentation on PLEG in one of the PLEG forums.

Yes - the documentation (and your interpretation) is correct - the devise only contemplates one event at a time.

One thing to remember is that events have a start (which you can do something on .. or not) and a finish (which you can do something on ... or not).  PLEG makes it easier to tease out the logic and get finer control than out-of-the-box vera

One way to approach what you want to do is leave gc_Keywords blank and use PLEG to react to the event names as they occur.

So you could (for example) have a short (say 5 min) event for "Heat On" and another separate event some time later for "Heat Off" -- with other events in between ......   Or maybe short event for Heat {22} and another later on for Heat {15} to change the temp to specified levels .   (Temp in Celsius).

You can also have multiple plugin instances looking at the same (or different calendars) and by using keywords - handle overlaps in this way too.  Note that the vera has limited memory resources and you should be selective in the idea of multiple plugin instances.

And yes - you could read the event list and set up  your own logic around that too -- that' what it's there for :-)

Hope this gives you some ideas
« Last Edit: September 06, 2014, 07:18:51 pm by Stuart »

Offline Borat

  • Full Member
  • ***
  • Posts: 169
  • Karma: +4/-5
Re: GCAL3 - Google Calendar 3
« Reply #72 on: September 06, 2014, 07:48:25 pm »
Ok thanks I have been trying it with the keywords option so will have a play without it. Am wary of more instances as I have had some memory issues.

Cheers

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: GCAL3 - Google Calendar 3
« Reply #73 on: September 06, 2014, 11:30:51 pm »
Hi @Stuart,

Is there any way Gcal3 can detect and trip a different sensor (or triggers scenes) when overlapping events with different keywords each start and end?

My use case for this would be to have one google calendar which contains an event called Wake_Up repeating every day at 7am and other event called Vacation that would run for a week, overlapping a bunch of Wake_Up events. My logic would be not to trigger the Wake_Up event if the Vacation event is in progress.

(apologies if this has been asked and answered already... i searched for "overlap" in this thread and came up empty)

Thanks !

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - Google Calendar 3
« Reply #74 on: September 06, 2014, 11:57:00 pm »
Hi @Stuart,

Is there any way Gcal3 can detect and trip a different sensor (or triggers scenes) when overlapping events with different keywords each start and end?

My use case for this would be to have one google calendar which contains an event called Wake_Up repeating every day at 7am and other event called Vacation that would run for a week, overlapping a bunch of Wake_Up events. My logic would be not to trigger the Wake_Up event if the Vacation event is in progress.

(apologies if this has been asked and answered already... i searched for "overlap" in this thread and came up empty)

Thanks !

I have a 'one word' answer ....... PLEG.   It's the 'swiss army knife' of the vera world and means that plugins like GCal don't need to be nearly as complicated as they might otherwise be.  It can easily do the sort of thing you describe --  from a GCal3  perspective, you will probably leave gc_keyword blank and use PLEG to respond to gc_TrippedEvent values.

I have similar requirements and find PLEG to be invaluable.  It takes a bit of effort to understand some of the 'tricky' stuff (e.g. state sequences) but well worth it ....