We have moved at community.getvera.com

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

Offline bigmonkey70

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +1/-1
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #315 on: March 26, 2015, 09:33:40 pm »
I am about to implement the GCal3 in my Vera..  I installed the plug in and set up went OK.  Event displayed and triggered OK.
Now I would like to get these conditions working if possible.
I have birthday, doctor appointment, car service appoinment, kids' school event and closer all entered in Google Calendar.

How Do I trigger these events and TTS through imperihome?  Is it even possible that depend on event keyword and triiger imperihome to speak according to that event??

example: if a dr. appt come up tomorrow, then tonight the event trigger (with the delta set) and imperihome announce the reminder that I have a Dr. appt tomorrow.  Or If a Birthday come up then in the morning imperihome say happy birthday. etc

Also I am unable to set the gc_Value.  I have added {xxx} to the end of the Google Calendar event name and after reloads and fresh browser, that field remain empty.

Thx
« Last Edit: March 26, 2015, 10:07:41 pm by bigmonkey70 »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #316 on: March 27, 2015, 12:53:13 pm »
I am about to implement the GCal3 in my Vera..  I installed the plug in and set up went OK.  Event displayed and triggered OK.
Now I would like to get these conditions working if possible.
I have birthday, doctor appointment, car service appoinment, kids' school event and closer all entered in Google Calendar.

How Do I trigger these events and TTS through imperihome?  Is it even possible that depend on event keyword and triiger imperihome to speak according to that event??

example: if a dr. appt come up tomorrow, then tonight the event trigger (with the delta set) and imperihome announce the reminder that I have a Dr. appt tomorrow.  Or If a Birthday come up then in the morning imperihome say happy birthday. etc

Also I am unable to set the gc_Value.  I have added {xxx} to the end of the Google Calendar event name and after reloads and fresh browser, that field remain empty.

Thx

gc_Value does not get set unless the event is active / triggered.  It is not displayed on the front panel (mainly for space reasons).  Take a look at gc_jsonEvents (in the Advanced tab).  That will tell you which events the plugin sees and if the event is active / triggered then the parameter should be in gc_Value.

I am not familiar with imperihome - but so far, I am not aware of anyone having probems passing the available data to other devices.  Take a look at the discussion here:
http://forum.micasaverde.com/index.php/topic,28398.0.html

As to managing other plugins to react to different events and send those events different parameters:  I'l look closely at PLEG since it's very powerful and flexible - but you could start of just using scenes.   From a GCal3 perspective, you would likely set gc_triggerNoKeyword to true, leave gc_Keyword blank.   In  PLEG (or scenes - this will cause every event to be triggered (no nesting of events) PLEG or the scene can then (1) look a the value of gc_TrippedEvent react to the name of the event and (2) get the gc_Value parameter and do something with it.  There are, of course other ways.   

If this does not make sense - we can work through an example of your choosing.

You can try something like this in a scene

Code: [Select]
local GCAL_SID = "urn:srs-com:serviceId:GCalIII"
local GCAL_DEV = 3    -- The GCAL device number
local eventValue= luup.variable_get (GCAL_SID, "gc_Value", GCAL_DEV ) or ""
local eventTitle = luup.variable_get (GCAL_SID, "gc_TrippedEvent", GCAL_DEV ) or "No event"
-- NOTE That event titles are all forced to upper case in the plugin
if (eventTitle == "DOCTOR") then
  -- do something
  luup.log("Event was " .. eventTitle .. " with parameter " .. eventValue)
elseif (eventTitle == "BIRTHDAY") then
  -- call plugin to announce birthday and pass it eventValue
  luup.log("Event was " .. eventTitle .. " with parameter " .. eventValue)
else
  luup.log("Just a test")
end

« Last Edit: March 27, 2015, 05:23:30 pm by Stuart »

Offline Octoplayer

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +3/-0
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #317 on: March 27, 2015, 07:02:28 pm »
HI,
Quote
This release (V1.2B) rolls up some minor corrections and better handling of iCal date format.

Where do I find 1.2 please? I have set 1.1 to auto update, but the MIOS app page does not show anything, and the 1.2B files in the forum have been deleted.

(I an getting an occasional reboot (1-2 every other day) due to a Vera Deadlock, so among other things I have upped the GCal debug to 3, and just noticed in the logs that I am still on V1.1)

Thanks
Octo

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #318 on: March 27, 2015, 07:23:13 pm »
HI,
Quote
This release (V1.2B) rolls up some minor corrections and better handling of iCal date format.

Where do I find 1.2 please? I have set 1.1 to auto update, but the MIOS app page does not show anything, and the 1.2B files in the forum have been deleted.

(I an getting an occasional reboot (1-2 every other day) due to a Vera Deadlock, so among other things I have upped the GCal debug to 3, and just noticed in the logs that I am still on V1.1)

Thanks
Octo

This is a common vera problem.

To force an update (since vera is inconsistent in this regard) you can use
http://<your vera ip>:3480/data_request?id=update_plugin&Plugin=7016

7016 is the GCal3 plugin id

I clean up old files from the forum -- especially when there is a new release.

Offline bigmonkey70

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +1/-1
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #319 on: March 28, 2015, 01:59:41 pm »
Hi Stuart,

Thank you for your guidance... I got mine working great now.
I just set a keyword REMINDER in all the Google Calendar event that I want Vera/Imperihome to Say the phrase.

And Luup code include an if statement that match the gc_TrippedEvent and pass the gc_value to Imperihome to Say it out to my bluetooth speaker.

Thanks



Offline Octoplayer

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +3/-0
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #320 on: March 29, 2015, 06:40:33 pm »
Quote
To force an update (since vera is inconsistent in this regard) you can use
http://<your vera ip>:3480/data_request?id=update_plugin&Plugin=7016

Thanks for your help - that did the trick - and at least confirmed it was not the previous version of GCal causing the deadlock.
Octo

Offline bigmonkey70

  • Jr. Member
  • **
  • Posts: 76
  • Karma: +1/-1
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #321 on: April 07, 2015, 02:02:01 pm »
Hi Stuart,

Just a quick question,  How does GCal3 handle multiple events in a particular day that mix with an all day event and a 1 hour event say happen at 8pm? 

Thanks

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #322 on: April 07, 2015, 04:16:37 pm »
Hi Stuart,

Just a quick question,  How does GCal3 handle multiple events in a particular day that mix with an all day event and a 1 hour event say happen at 8pm? 

Thanks

There are multiple options in GCal3 for filtering events events based on keyword (or not), all day (or not) ignoring events based on keyword and etc.  I'll let you look at the documentation for the details.   Given several events that are 'illegible' - GCal3 will trigger on the first eligible event at it's start time.  Any event that is fully 'enclosed' by another event is ignored.  If an eligible event starts inside another event but finishes after - it is treated as if it started at the end of the first event.

In the case of all day events - no other event will be triggered unless you set the parameter gc_ignoreAllDayEvent - in which case it's as if the all day event was not there.   If you have a need to do something on all day events and also do something on other events during the day - you can install additional instances of the plugin.  They can point to the same (or different calendars) and be set with different filter parameters.

Hope this is helps.

Offline clabos

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #323 on: April 08, 2015, 01:13:51 pm »
Hi. I have just started using gcal3. It is a great plugin! Very easy to get it working and let Sonos announce the events for the day. When browsing the forum though I find quite a few questions about nested/overlapping events (for instance the posts just above), and I do understand how gcal3 relates to that.

The plugin is great as it is but it would become Fantastic it it was able to fire off an event each time a calendar event either starts or finishes, regardless if they are nested or not! The scenario that seems to be most common amongst fellow posters are similar to mine - having a "family calendar" where all family members could add whatever they want to be reminded about. With the current solution someone will need to edit the calendar events to make sure there is no overlap. It is a completely different scenario compared to switching a heater on/off for example.

So the question is if this is functionality that one day may appear in the plugin? Otherwise I will try to figure out something on my own but it isn't trivial. And again - thank you for a great plugin!!!

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #324 on: April 09, 2015, 01:30:05 pm »
Hi. I have just started using gcal3. It is a great plugin! Very easy to get it working and let Sonos announce the events for the day. When browsing the forum though I find quite a few questions about nested/overlapping events (for instance the posts just above), and I do understand how gcal3 relates to that.

The plugin is great as it is but it would become Fantastic it it was able to fire off an event each time a calendar event either starts or finishes, regardless if they are nested or not! The scenario that seems to be most common amongst fellow posters are similar to mine - having a "family calendar" where all family members could add whatever they want to be reminded about. With the current solution someone will need to edit the calendar events to make sure there is no overlap. It is a completely different scenario compared to switching a heater on/off for example.

So the question is if this is functionality that one day may appear in the plugin? Otherwise I will try to figure out something on my own but it isn't trivial. And again - thank you for a great plugin!!!

I have an idea for a companion plugin that can be used in the way you describe.   Basically a plugin that trips on every event start and finish and allows your scene(s) to respond depending on how you define them.   I've roughed out the design - it will take a couple of days, so some-time next week I'll post the beta version.

I'm planing on leveraging the gc_jasonEvents field already supported in the plugin, reading that data from one or more calendar plugins (you configure), merging and sorting all events by time order and then triggering the plugin on each event transition.   You can then set up a scene (or scenes) to be triggered by this new plugin, get the event name and whether it was the start or finish (using a couple of lines of LUA) and use that information in any way you want.

Does that sound interesting / usable ?

Offline clabos

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #325 on: April 09, 2015, 04:41:45 pm »
The companion plugin idea sounds perfect! I would be happy to test.

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #326 on: April 09, 2015, 04:50:47 pm »
Hello Stuart !

Great plugin  :)

It seems that the json values in 'gc_jsonEvents' and 'gc_jsonActiveEvents' are not valids.
Code: [Select]
[{'eventParameter':'1','eventName':'EVENT'}]
should be
Code: [Select]
[{"eventParameter":"1","eventName":"EVENT"}]

Offline CudaNet

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +42/-11
  • Chimichanga !
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #327 on: April 09, 2015, 05:21:24 pm »
@Vosmont
Yes, generates an unexpected token (when placed within a validation tool) - however, lua doesn't seem to have a problem decoding it...

@Stuart
love the idea of a companion plugin... I had workarounds in place to avoid generating overlapping events (pushed to Calendar) so this would be greatness..

Hello Stuart !

Great plugin  :)

It seems that the json values in 'gc_jsonEvents' and 'gc_jsonActiveEvents' are not valids.
Code: [Select]
[{'eventParameter':'1','eventName':'EVENT'}]
should be
Code: [Select]
[{"eventParameter":"1","eventName":"EVENT"}]
« Last Edit: April 09, 2015, 05:24:28 pm by CudaNet »
openLuup, AltUI, Zway and HomeWave, enough said...

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #328 on: April 09, 2015, 06:26:25 pm »
Hello Stuart !

Great plugin  :)

It seems that the json values in 'gc_jsonEvents' and 'gc_jsonActiveEvents' are not valids.
Code: [Select]
[{'eventParameter':'1','eventName':'EVENT'}]
should be
Code: [Select]
[{"eventParameter":"1","eventName":"EVENT"}]

I agree it is technically wrong.   I'll take a look - I explicitly reformat the double quotes to single quotes before saving - from memory it was to do with some nuance in Lua (or some lack of knowledge on my part).

I'll be playing around with the encode / decode etc over the next few days ans see what I discover.

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #329 on: April 10, 2015, 05:07:01 am »
Thanks

FYI, library "dkjson" (provided by default) is not able to decode this value.

Have to do before :
Code: [Select]
value = value:gsub("'",'"')