[UPDATED 3/27/18] GCal Search

I have created a calendar entry from 8:00 am to 8:20 am. I created the virtual switch that uses this calendar event. So at 8:00 am the switch turns on. I assume at 8:20 am the switch should turn off. The switch is turning on at 8:00 am, but after 8:20 it is still on. Am I misunderstanding how this virtual switch should be working?

I wasnā€™t waiting 15 minutes. Once I did, the virtual switch turned on at the appropriate time. However, it doesnā€™t shut off at the end of the scheduled event.

It should be turning off at the end of the scheduled event. What versions of the smartapps and event sensor dth are you using? Do you see an error in the IDE log at the end time of the event?

Are you seeing entries like this under the recent events tab for the device created by the smart app?

The image above is a poor example. It is a sample of how sometimes the app will create an on event then realize that is wrong and turn it off. Happens from time to time. I believe the original code also had the same issue.

But you SHOULD see event like this for when you calendar event start time and end time are. This is how it is working for me and most of my searches I created using the app.

I am using the most recent versions of the smart apps and device handlers from Github. Copied them this afternoon. I see this in the IDE log:

afd96c1b-7c22-4843-9316-ef1449894d86 9:24:01 PM: error groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method script1490581272221171277639#runOnce.
Cannot resolve which method to invoke for [null, class java.lang.String, class java.util.LinkedHashMap] due to overlapping prototypes between:
[class java.lang.String, class java.lang.Object, interface java.util.Map]
[class java.util.Date, class java.lang.Object, interface java.util.Map] @ line 249
afd96c1b-7c22-4843-9316-ef1449894d86 9:24:01 PM: debug Scheduling Close for: null
afd96c1b-7c22-4843-9316-ef1449894d86 9:24:01 PM: debug Deviceā€™s endMsg = No End Msg Wanted
afd96c1b-7c22-4843-9316-ef1449894d86 9:24:01 PM: debug closeTime = null & endMsgTime = null
afd96c1b-7c22-4843-9316-ef1449894d86 9:24:01 PM: trace GCalEventSensor: open()
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: debug SCHEDULING STARTMSG: parent.scheduleMsg(startMsg, Mon Mar 27 02:24:00 UTC 2017, No Start Msg Wanted, ā€˜[overwrite: true]ā€™ ).
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: debug SCHEDULING OPEN: parent.scheduleEvent(open, Mon Mar 27 02:24:00 UTC 2017, ā€˜[overwrite: true]ā€™ ).
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: trace GCalEventSensor: close()
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: debug Contact incorrectly open, so close.
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: debug Event Outlets On still in future.
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: debug GCalEventSensor: We Haz Eventz!
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: trace poll()
afd96c1b-7c22-4843-9316-ef1449894d86 9:23:30 PM: trace GCalEventSensor: refresh()

I had a calendar entry scheduled from 9:24 pm to 9:29 pm. Start worked, end didnā€™t. From the logging it looks like the closetime and endmsgtime are null.

Can you take a screenshot of the setup screen for that triggger? and the summary tile?


Not sure if this is what you meant by summary tile

Versions:
GCal Search: 20170321.1
GCal Search Trigger: 20160411.1

DTH
Event Sensor: 20170322.1
Presence Sensor: 20170306.1

Iā€™ll PM you the logā€¦

Looks like youā€™re using a way outdated version of the GCal Search Triggerā€¦

3/27 UPDATE:

(1) GCal Search (20170326.1) - fixed loss of refreshToken - hopefully the end of Google
OAuth issues (reports back from users are positive);
(2) GCal Search Trigger (20170327.1) - Reorganized Trigger Screen; and
(3) Event Sensor DTH (20170327.1) - restructured & fixed scheduling ( @jlwilson58 - this fixes your problem).

BE SURE TO UPDATE ALL 3
UPDATED PRESENCE SENSOR TO FOLLOW

2 Likes

3/27 UPDATE #2:

GCal Search Trigger (20170327.2) - notification options now include:

  1. Ask Alexa

  2. Listed contact

  3. SMS

  4. Push

These options appear if you select ā€œYesā€ to receiving either Start or End Notifications

2 Likes

I thought the same thing, but itā€™s what came down from GitHub and there were no other updated versions available. Iā€™ll update everything with your new update.

Huh. Iā€™ve sent Github a bunch of updates. Maybe you still had it connected to mnestorā€™s repo.

I just update the actual GitHub settings and I see the updates (so I loaded them) but one showed as conflictingā€¦the triggerā€¦so Iā€™m guessing it somehow got crossed up with the old repo. The new updates (all 4) got me past the child-app hurdle, but now I get an error when trying to select a calendar. I think I read something about waiting for a bit? Gonna try that. Basically, I can select the calendar I want, but it never savesā€¦

Your updates took care of my issues. Thanks for the quick response. You may have left some debugging tiles on in the app UI. I commented them out for now. A suggestion: when you go into the details of the virtual switch that is created in the UI, the background of the icon is orange when on and green when off.

		state("closed", label:'', icon:"https://raw.githubusercontent.com/mnestor/GCal-Search/icons/icons/GCal-Off@2x.png", backgroundColor:"#79b821")
		state("open", label:'', icon:"https://raw.githubusercontent.com/mnestor/GCal-Search/icons/icons/GCal-On@2x.png", backgroundColor:"#ffa81e")

You may want to use green for on and red for off. Just a suggestion.

OAuth should be working now. I suspect that you might need to delete your existing GCal search app and start fresh.

Good suggestion.

Good Lordā€¦

Ok, so, I deleted absolutely everything. Both Smart Apps, both DTHs, I even shutdown the Google API project and opened a new one. I followed the ReadMe doc to the letter. Now, at least, itā€™s getting the OAuth thing sorted out. BUT, now when I try to create a search trigger, I just get a red bar and a Saving Error notification. If i continue moving through the fields, the info that wouldnā€™t save shows up, but the trigger as a whole wonā€™t save and nothing worksā€¦

Of note, the files that Iā€™m loading for the SmartApps and DTH all need to be updated through the GitHub integration after I load them on manually. Does this sound right?

anyone??? this is really annoying. I erased my old GCal setup, which was working fine, to move to this and now Iā€™m stuckā€¦