We have moved at community.getvera.com

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

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #330 on: April 10, 2015, 09:29:23 am »
Thanks

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

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

Yes -- that's exactly the reverse of how I was creating the json string before saving.  I took a look and I suspect that there was some debug / logging formatting that was being screwed up and I 'fixed' the problem with single quotes (not even thinking single quotes were invalid json).

Also - there is / was no default library in vera at the time / across all versions so I install one that is apparently insensitive to the quotes. "json"

You can try this version - it's just got the offending reformat commented out (2 places) and seemed to work fine in some limited tests I have done.




« Last Edit: October 25, 2015, 09:49:09 pm by Stuart »

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #331 on: April 10, 2015, 01:52:39 pm »
Also - there is / was no default library in vera at the time / across all versions so I install one that is apparently insensitive to the quotes. "json"

Since UI7, there's the library "dkjson.lua" in "/usr/lib/lua".

GetVera has not communicated on that (I don't know why)

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 #332 on: April 10, 2015, 02:48:52 pm »
Exactly what Stuart said, I too was utilizing libraries that were insensitive towards single quotations. I typically use either just json or akb-json but then again I'm still on UI5. Good to know nonetheless.

Also - there is / was no default library in vera at the time / across all versions so I install one that is apparently insensitive to the quotes. "json"

Since UI7, there's the library "dkjson.lua" in "/usr/lib/lua".

GetVera has not communicated on that (I don't know why)
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 #333 on: April 11, 2015, 01:43:43 pm »

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 ?

Having thought about this a little - and noting that some people are going to be pushed for RAM.  I'm now thinking a enhancement to the existing plugin - along these lines:
The rules for the plugin instance would still apply in that only  'eligible events' would be considered.  Whenever an eligible event starts or ends a variable
gc_notify (normally 0) would be set to 1 for one minute and an Luup event raised so you can trigger a scene.

During that one minute 3 new variables would be populated (otherwise they would be blank)
gc_notifyName, gc_notifyValue and gc_notifyType (either "Start" or "End").
You could gather these three variables into your scene and do whatever.

Thoughts / Comments ?




 


Offline clabos

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #334 on: April 13, 2015, 03:12:57 am »
Hi
Personally I think your original design sounded better.
- How does the new design copes with events that happen in the same minute?
- Regarding memory - I suppose one will need another plugin (PLEG?) that checks for changes of the gc_notify variable? Unless such a plugin is already installed that will require some overhead too.
/Claes

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #335 on: April 27, 2015, 02:25:46 pm »
Hi
Personally I think your original design sounded better.
- How does the new design copes with events that happen in the same minute?
- Regarding memory - I suppose one will need another plugin (PLEG?) that checks for changes of the gc_notify variable? Unless such a plugin is already installed that will require some overhead too.
/Claes

I have the changes working as a modification to the existing plugin and events in the same minute (start or end) do not seem to be an issue.  This has been working well for a couple of weeks .....

However - I have uncovered some problems within Mios (notifications not working) and am working with their developers to track down the issue (causes Luup to crash when trying to send email.......  I have an idea where the issue lies but it may be a few days yet before we understand the 'why'.

Offline JackTheMan18

  • Sr. Newbie
  • *
  • Posts: 30
  • Karma: +0/-5
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #336 on: May 04, 2015, 10:33:37 am »
Hello.
I'm a new user, so please forgive my ignorance.
Does this plugin work with UI7?

Also, let me explain what I'm trying to do.
Based on an entry in my google calendar, I'd like to trigger a scene (just simply turning on lights, etc.)

Is this the app to do that?

Thanks for the help.

Also, can someone point to the documentation for this app?

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.2 Released - Now with Add Event to Calendar
« Reply #337 on: May 04, 2015, 11:02:26 am »
YES and YES !! .....   along with a few other things !

The documentation is on page 1 of this thread and is pretty much up to date as of release 1.1.  There are a couple of new capabilities in release 1.2 (in the release notes).

Just follow the instructions closely - especially getting your google credentials and you should be fine.  Enjoy.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.3 beta - with Overlapping Event Start End Notification
« Reply #338 on: May 04, 2015, 09:34:17 pm »
This 1.3b version has an additional trigger that can be used for a variety of purposes.  It triggers on event start and end including overlapping events.  The events must still be 'eligible':
e.g. 1 If you set a keyword - then only events (including overlapping events) with that keyword are 'eligible'.
e.g. 2 To notify on all events - do not set a keyword and all events are 'eligible'.
The trigger is called "Event Start or End" and there are four new variables that can be accessed by Luup Code.  These are:
gc_notify --> either "0" or "1"
gc_notifyName --> the event name
gc_notifyValue --> any event parameter (i.e. the bit in {}) if used
gc_notifyType --> either "Start" or "End"

gc_notify is set to "1" at the Start and End of an event and is reset to "0" 15 sec later.  The other variables are reset to ""

If events have the same start or end time - the notifications are spaced approximately 5 seconds apart.

The beta version can be installed with:

http://<your vera IP>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=7016&Version=27332

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #339 on: May 13, 2015, 10:21:27 am »
I found a rare condition when the new notifications would repeat.  I have fixed this and re-released V1.3.

You can get to it through the marketplace (likely tomorrow) or directly with this url

<your vera IP>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=7016&Version=3597

Offline clabos

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #340 on: May 14, 2015, 06:31:30 pm »
Hi
Thank you for v1.3 and the start/end notifications - it works great!!! I did also get some of those repeated messages, glad you fixed that. I have tested it about two weeks in total and it has been very helpful.

I do however have two very strange issue. I am not sure if it is related to GCal3, it seems far fetched...
1) The main issue is that my door sensors stop working properly when I have GCal3 installed. Once I remove it they start to work again. When I open a door the event seems to get stuck in Vera until I close the door again. The open/close events are then triggered more or less at the same time (first "close", then "open"). When I remove GCal3 and manually change the "tripped" and "armed tripped" statuses = 0 when the door is closed it starts to work normally again.
2) The other odd thing is that my BinarySwitch-devices now have got "tripped" variables under "urn:micasaverde-com:serviceId:SecuritySensor1", I don't think they are there by default. That is not a big problem though, it makes some scripts do a few more iterations, but I have a feeling this is connected with the other issue.

Do any of the two issues above have any potential relation with GCal3? I have a love/hate relationship with Vera as she seems to have a mind of her own so I would not be surprised if this is just another of her mood swings.

Again, thanks for the great update.

Edit: After 24 since my last uninstall of GCal3 the issues I talked about above came back! It seems as Gcal3 has nothing to do with this. I am sorry I jumped to that conclusion but it seemed logical earlier.
« Last Edit: May 15, 2015, 09:59:24 am by clabos »

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #341 on: May 15, 2015, 11:48:41 am »
BinarySwitch-devices now have got "tripped" variables under "urn:micasaverde-com:serviceId:SecuritySensor1"

Edit: After 24 since my last uninstall of GCal3 the issues I talked about above came back! It seems as Gcal3 has nothing to do with this. I am sorry I jumped to that conclusion but it seemed logical earlier.
GCal3 does use the "urn:micasaverde-com:serviceId:SecuritySensor1" schema but it is normal for devices to reuse other related schemas.  Luup is supposed to take care of keeping everything nicely separated.  I'd guess that the first level of separation is through the device_type (e.g. for GCal3 it is urn:schemas-srs-com:device:GCal:3) and device number and etc.

It's a long shot but have you manually installed any of these devices and perhaps used the same/wrong device_type setting ?


Offline clabos

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #342 on: May 15, 2015, 12:12:19 pm »
Thanks for the tips. No, I have not installed them manually. I think this behaviour started with the firmware update about 4 weeks ago. I have learned that the updates sometimes fix and sometimes break things. The sensors I am having most problems with are inexpensive Vision ZD2102 in case anyone makes a search on the name, but also my less inexpensive Fibaro sensors seem to be affected. I will contact the support and ask them.

Offline Stuart

  • Moderator
  • Hero Member
  • *****
  • Posts: 728
  • Karma: +71/-2
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #343 on: June 02, 2015, 08:56:37 am »
Thanks for the tips. No, I have not installed them manually. I think this behaviour started with the firmware update about 4 weeks ago. I have learned that the updates sometimes fix and sometimes break things. The sensors I am having most problems with are inexpensive Vision ZD2102 in case anyone makes a search on the name, but also my less inexpensive Fibaro sensors seem to be affected. I will contact the support and ask them.

Have you got this working ?

Offline ajbaab

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: GCAL3 - V 1.3 Released - Now with Overlapping Event Notification
« Reply #344 on: June 08, 2015, 11:50:06 pm »
I'm fairly new to Vera and I had (for a while) set up a wakeup mechanism based on gcal with one of the previous gCal apps(no longer works due to Google updates)  I believe I did everything to the T through the files. When I click the calendar it shows my gCalendar. However when I click check it simply states, "Next event", "In bypass mode", "."
I even tried from my iCal using the ical link. Same thing simply states, "Next event", "In bypass mode", "." .  I have not figured out where the logs show when I put it in debug mode.

From that is it possible to discern what I'm doing wrong?

Thank you!