Minimum Event Duration

Per the documentation:
“The minimum duration for an event is 1 minute taking into account the effect of any start and end delta. If the effective duration is less than one minute then the event will not be seen by the plugin i.e. it will be discarded.”

If this is true, it is very unfortunate - An event of no duration in Google Calendar is exactly the right thing to trigger a scene in Vera. There is no reason for the even to be 30 minutes in Google Calendar when all I’m interested in is triggering the scene at a specific moment in time. Is there a workaround for this? Can this restriction be removed?

I have a auto-generated calendar for the next 10 years and every event starts and ends at the same time and I want to use it to trigger scenes in Vera.

[quote=“MSW, post:1, topic:189273”]Per the documentation:
“The minimum duration for an event is 1 minute taking into account the effect of any start and end delta. If the effective duration is less than one minute then the event will not be seen by the plugin i.e. it will be discarded.”

If this is true, it is very unfortunate - An event of no duration in Google Calendar is exactly the right thing to trigger a scene in Vera. There is no reason for the even to be 30 minutes in Google Calendar when all I’m interested in is triggering the scene at a specific moment in time. Is there a workaround for this? Can this restriction be removed?

I have a auto-generated calendar for the next 10 years and every event starts and ends at the same time and I want to use it to trigger scenes in Vera.[/quote]

I will take a look. At the time, I was making several significant changes to the plugin. Part of the reason is that I wanted to make sure Vera and other plugins had time to ‘settle’, have time to communicate with each other and for actions to propagate to devices. I took a conservative approach of one minute.

What I think I can probably is force any event with an effective duration >= 0 and < 60 sec to be 60 sec (internally to the plugin).

In the meantime - you could simply setting gc_EndDelta to 1. That would change all you events to have an effective end time of 1 minute later than defined. i.e. all your zero length (and other events) would be at least 60 sec in duration.

Maybe I don’t understand. I thought the plugin gets an event at a specific time and triggers a zwave scene when that event occurs. If the event is the start of a 2 second event or the start of a 2 hour event, why does it make any difference?

It’s not the plugin that’s triggering a scene - strictly speaking. What happens is that the plugin changes state and the underlying Vera ‘engine’ notices this change. Vera (to my knowledge) have never actually published the mechanics and I have seen some strange behavior.

Taking your argument - a zero length event would trigger the plugin and then immediately ‘untrigger’ the plugin. Would Vera notice ? Would other plugins and scenes be ‘confused’ if they were activated by the trigger and something else in a sequence of events saw the ‘untriggered’ state ?

To guard against this (and what could have been some race conditions I saw in the past) - the plugin has some delays built into the trigger / untrigger transitions. Also - the plugin checks google calendar for updates at every event start and end. Some people have scenes that add new calendar events. How would the plugin see these if the logical start and end of the event was the same.

To guard against these negative eventualities - I chose 60 sec as a conservative minimum for the logical delta between start and end of an event. It’s proved to be pretty solid so far.

Previously - I had set this as a minimum, based on the calendar entry itself i.e. ignore it if the effective duration is < 60 sec. I just made a small change. The plugin will ignore an entry if the effective duration is < 0 and force it to 60 sec if < 60 sec. I.e. zero duration events will look like 1 minute events to the plugin.

Attached are two files that will bring you to V1.4 (which I intend to release shortly) and which has this change (that I did this morning) as well as some other’s that are minor.

I’ll give it a try - Thanks!

One other question - it seems like the correct way to use this plugin is to go into Scene Editor in Vera and create a new scene based on a GCal event. Once the scene is created though, Vera doesn’t update the “next Run” information to let you know you setup the scene correctly and when it will run next. Is it possible to integrate GCal3 so that Vera can pull the “next Run” information? That would let us know if everything is setup correctly or not.

edit:
Test worked! One odd behavior - I had one scene set to run on a GCal event but only if it is was fired between certain times (per the settings in Vera). The scene didn’t fire (as expected) since it wasn’t during those times, but it also got deleted somehow from Google Calendar. Scenes set to run on a Gcal event without the time constraint work great now.

[quote=“MSW, post:5, topic:189273”]I’ll give it a try - Thanks!

One other question - it seems like the correct way to use this plugin is to go into Scene Editor in Vera and create a new scene based on a GCal event. Once the scene is created though, Vera doesn’t update the “next Run” information to let you know you setup the scene correctly and when it will run next. Is it possible to integrate GCal3 so that Vera can pull the “next Run” information? That would let us know if everything is setup correctly or not.

edit:
Test worked! One odd behavior - I had one scene set to run on a GCal event but only if it is was fired between certain times (per the settings in Vera). The scene didn’t fire (as expected) since it wasn’t during those times, but it also got deleted somehow from Google Calendar. Scenes set to run on a Gcal event without the time constraint work great now.[/quote]

I’m not sure I understand what you mean by “Next Run” for a scene?. Vera uses an event based model – basically it’s looking for a change in whatever you define as a trigger in the scene and then evaluates that trigger to see if it is satisfied, and if so, then does whatever is defined for that scene. It does not have the idea of anticipating a future state. So - for example - if you set a trigger based on whether GCal is tripped or not - the trigger gets evaluated when the GCal tripped status changes.

The front panel on the GCal plugin will tell you when the next event is that would cause it to “Trip” - unless it’s currently inside a tripped event in which case it displays that event

GCal does not have any code to delete events in the google calendar. It reads events and can be asked to create events - but not delete. The ‘missing’ event is (and will likely remain) a mystery :slight_smile:

[quote=“Stuart, post:6, topic:189273”]I’m not sure I understand what you mean by “Next Run” for a scene?. Vera uses an event based model – basically it’s looking for a change in whatever you define as a trigger in the scene and then evaluates that trigger to see if it is satisfied, and if so, then does whatever is defined for that scene. It does not have the idea of anticipating a future state. So - for example - if you set a trigger based on whether GCal is tripped or not - the trigger gets evaluated when the GCal tripped status changes.

The front panel on the GCal plugin will tell you when the next event is that would cause it to “Trip” - unless it’s currently inside a tripped event in which case it displays that event[/quote]

In UI7, on the scene screen, there is a column which shows “Next Run” which displays the next time each scene is set to be run. While GCal does show the next event on it’s own front panel, that doesn’t help if a scene is set to trigger on an event with a specific name - the GCal panel shows the next event in the calendar - not the next event which matches the criterion that the scene was setup for. What if the user had a type on the name of the event when they setup the scene? GCal would still show the event as the next event, but it wouldn’t trigger the scene. The ‘Next Run’ section on the scene page confirms all conditions would be met and therefore is useful in checking to make sure everything is setup correctly. Also, GCal just shows the next event within 24 hours - what if the scene is only going to trigger in 3 days?

Fantastic plugin - thanks for all the hard work!!

[quote=“MSW, post:7, topic:189273”][quote=“Stuart, post:6, topic:189273”]I’m not sure I understand what you mean by “Next Run” for a scene?. Vera uses an event based model – basically it’s looking for a change in whatever you define as a trigger in the scene and then evaluates that trigger to see if it is satisfied, and if so, then does whatever is defined for that scene. It does not have the idea of anticipating a future state. So - for example - if you set a trigger based on whether GCal is tripped or not - the trigger gets evaluated when the GCal tripped status changes.

The front panel on the GCal plugin will tell you when the next event is that would cause it to “Trip” - unless it’s currently inside a tripped event in which case it displays that event[/quote]

Scenes and plugins are, for the most part, independent. Next Run only relates to a scene that has a schedule. If the scene is only triggered by some device (a plugin like GCal is in effect a device) then there is no “next run” time. A scene cannot tell if a plugin will satisfy a trigger condition in advance. At the most basic GCal is a switch that is either on or off – based on calendar events. The scene cannot tell if the switch will be ‘on’ or ‘off’ at some time in the future.

If there is an event three days from now then GCal will ‘see’ that event when the time comes. The scene (as explained above) does not need to know - it will be ‘told’ when the trigger condition is satisfied. Put another way - if you only want to trigger a scene with GCal - you would not set a schedule for the scene.

In UI7, on the scene screen, there is a column which shows “Next Run” which displays the next time each scene is set to be run. While GCal does show the next event on it’s own front panel, that doesn’t help if a scene is set to trigger on an event with a specific name - the GCal panel shows the next event in the calendar - not the next event which matches the criterion that the scene was setup for. What if the user had a type on the name of the event when they setup the scene? GCal would still show the event as the next event, but it wouldn’t trigger the scene. The ‘Next Run’ section on the scene page confirms all conditions would be met and therefore is useful in checking to make sure everything is setup correctly. Also, GCal just shows the next event within 24 hours - what if the scene is only going to trigger in 3 days?

Fantastic plugin - thanks for all the hard work!![/quote]

Let me state the problem more clearly - if I set a scene to trigger based on a Gcal event with a specific name, how can I validate I set it up correctly and my event will fire (and I don’t have a typo in the name I specified)?

No way that I know of other than testing it.