Google Calendar Switch

Sorry…
State Device not PS. Doh…

I’m sure you’ve already checked that the Private Link (HTTP no S) and the Keyword in the device match the Google Calendar?

JOD.

Thrice…

Ill report back tomorrow after setting up the latest version from scratch

  • Henk

[quote=“JOD, post:41, topic:169003”]Sorry…
State Device not PS. Doh…

I’m sure you’ve already checked that the Private Link (HTTP no S) and the Keyword in the device match the Google Calendar?

JOD.[/quote]

@Henk

for debugging I suggest:

  1. ssh into vera
  2. on command line start logging with: VerboseLogging.sh enable
  3. in /var/log/cmh start: tail -f LuaUPnP.log | grep GCAL
  4. you should see something like:

50 08/26/11 0:05:26.549 luup_log:67: GCAL: check calendar 50 08/26/11 0:05:26.550 luup_log:67: GCAL: checking google calendar 50 08/26/11 0:05:26.875 luup_log:67: GCAL: query url: http://www.google.com/calendar/feeds/XXXXXXXXXXX@group.calendar.google.com/private-eXXXXXXXXXX1237/basic?alt=json&fields=entry/title&start-min=2011-08-25T23:05:26&start-max=2011-08-25T23:10:56 50 08/26/11 0:05:26.877 luup_log:67: GCAL: query status: 0 50 08/26/11 0:05:26.877 luup_log:67: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$gd":"http://schemas.google.com/g/2005"}} 50 08/26/11 0:05:26.878 luup_log:67: GCAL: no event with name HEATING_ON is currently active

Especially the line with “query status:” should show a 0 indicating something came back from the server

The 2nd instance of the GCS device is up and running, it has the same Link as the 1st but different Keyword but it’s not playing nice with the 1st GCS device.

Even though there is a 3hr separation between devices in the calendar, the 2nd device turns on a second after the first.
The expiration of each event turns off the relevant device as expected.

JOD.

[quote=“JOD, post:44, topic:169003”]The 2nd instance of the GCS device is up and running, it has the same Link as the 1st but different Keyword but it’s not playing nice with the 1st GCS device.

Even though there is a 3hr separation between devices in the calendar, the 2nd device turns on a second after the first.
The expiration of each event turns off the relevant device as expected.

JOD.[/quote]

Strange. Do you use 2 keywords that are similar (one as a substring of the other?). Could you send me the debug output of the on and off events as described above? I will try to reproduce this over the weekend and see where the bug might be.

I just checked with 2 instances of the device on one calendar and for me it worked. I used HEATING_ON as keyword for one and ALARM_ON as keyword for the other.

Do you use 2 keywords that are similar
Yes, they were similar. Vera 1 & Vera #XXXX I’m changing the Keywords and will test it again.
I used HEATING_ON as keyword for one and ALARM_ON as keyword for the other.
What if you used HEATING_OFF for the 2nd instance?

JOD.

[quote=“JOD, post:46, topic:169003”]

Do you use 2 keywords that are similar
Yes, they were similar. Vera 1 & Vera #XXXX
I’m changing the Keywords and will test it again.

I used HEATING_ON as keyword for one and ALARM_ON as keyword for the other.
What if you used HEATING_OFF for the 2nd instance?

JOD.[/quote]

Something like HEATING_ON and HEATING_OFF would work
Something like HEATING and HEATING_ON would be a bad idea as the first is a substring of the second.

To avoid that I would need to code a proper JSON parser instead of just matching strings but I am lazy.

I was hoping to use this as a means of toggling the “Away” scene for both my wife and me.

Test 1.
Using a 1hr calendar separation:
Device 1. gcalon = Husband
Device 2. gcalon = Wife
Both devices turn on at the same time (first calendar appointment)

2nd test.
2hr calendar separation:
Device 1. gcalon = HEATING_ON
Device 1. gcalon = HEATING_OFF
Both devices turn on at the same time (first calendar appointment)

but I am lazy
No problem. ;D

JOD.

@jod

can you try to create the debug output as described in post #42.

It must be something simple. It did not happen in my setup.

@utz

Short feedback o notification tab in version 2

(UI5 gives much better device installation response by the way, only 1 lua restart needed to populate the device).

I found that the notifications tab is there, but i cannot hookup notifications to anything.
The pulldown menu is empty.

  • Henk

This is the 2nd test scenario from my last post and after the expiration of the 1st appointment (Heating_ON) 10:40am - 10:55am. This device is currently idle.

2nd upcoming appointment (device #2) HEATING_OFF scheduled for 12:05PM - 1:05PM is currently active. I’m posting this at 12:00 but the time was 11:38 at the time of the log.

If you want, I can do a “pending” appointment printout?

^X50 08/26/11 11:38:40.010 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:38:40.397 luup_log:18: GCAL: query url: http://www.google.com< Private Key> 50 08/26/11 11:38:40.399 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:38:40.400 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:38:40.401 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:38:40.405 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:38:40.412 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:38:40.912 luup_log:20: GCAL: query url: http://www.google.com< Private Key> 50 08/26/11 11:38:40.914 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:38:40.915 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:38:40.916 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402>

JOD.

@utz

Ok more feedback.

The “check” button doesnt work for me, no response other than the one i PM ed you.

This is the “5 minute timer” feedback from the tailcommand:

tail -f /var/log/cmh/LuaUPnP.log | grep GCAL 50 08/26/11 18:47:18.019 luup_log:36: GCAL: checking google calendar <0x4 02> 50 08/26/11 18:47:18.381 luup_log:36: GCAL: query url: http://www.google. com/calendar/feeds/my.email@gmail.com/private-xxxxxxxxxxxxxxxxx/basic?alt=json&fields=entry/title&start-min=2011-08-26T16:47:18&start-max=201 1-08-26T15:51:28 <0x402> 50 08/26/11 18:47:18.382 luup_log:36: GCAL: query status: 0 <0x402> 50 08/26/11 18:47:18.383 luup_log:36: GCAL: query result: {"version":"1.0 ","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$gd":"h ttp://schemas.google.com/g/2005"}} <0x402> 50 08/26/11 18:47:18.384 luup_log:36: GCAL: no event with name TEST is cu rrently active <0x402>

I really am surprised at the www.wr.org url … and somehow the event (that is there) is not reckognized… i checked the private calender xml string over and over… its correct.

  • Henk

@Henk,

when I look at the url query url I can see the following two parameters:
start-min=2011-08-26T16:47:18
and
start-max=2011-08-26T15:51:28

The plugin is asking to look for events in a time window where the start window time is after the end window time which obviously returns no events. It should be something like:
start-min=2011-08-26T16:47:18
and
start-max=2011-08-26T16:52:28

This has probably to do with the time zones and how lua converts handles time calls. I live in the UK and there is normally nothing to be added to times. If you sit in the netherlands (a guess) then we have that 1h difference to UTC (which google wants).

I have to look at this a bit and see if I can puzzle together what to do for different time zones …

@utz

Good guess i am in the Netherlands at GMT +1 (summertime +2)
If you need more logs, let me know.

I have tried setting up a special group calender for Vera witht the same results.
Also it sounds logical what you are saying… i hve always used short test events that wer never longer than 1 hour so the timedifference would never have been compensated, thus the alarm wouldnever trigger.

Good team like this!

  • Henk

[quote=“utz, post:53, topic:169003”]@Henk,

when I look at the url query url I can see the following two parameters:
start-min=2011-08-26T16:47:18
and
start-max=2011-08-26T15:51:28

The plugin is asking to look for events in a time window where the start window time is after the end window time which obviously returns no events. It should be something like:
start-min=2011-08-26T16:47:18
and
start-max=2011-08-26T16:52:28

This has probably to do with the time zones and how lua converts handles time calls. I live in the UK and there is normally nothing to be added to times. If you sit in the netherlands (a guess) then we have that 1h difference to UTC (which google wants).

I have to look at this a bit and see if I can puzzle together what to do for different time zones … [/quote]

@JOD
can the timezone issue be your problem as well? You cut this part of in your logfile.

@Henk
Google wants to have the query in UTC. For me in the UK that means that for an event in google calendar at 6pm I have to send a query for 5pm. So, if it is 6pm and the plugin runs I use t = os.date(‘!*t’) to get on vera the UTC time for my query (which is 5pm; this value is start-min in the query). This seems to work for you as well Henk (I think, to UTC you have 2h diff). Then I have to add 5min to this time for the start max. This is where you Henk loose an hour somehow. Why I dont know yet. I will investigate.

[quote=“utz, post:55, topic:169003”]@JOD
can the timezone issue be your problem as well?[/quote]I dont think so.

You cut this part of in your logfile.
I'm having to do it over a VNC connection (no refresh) but it looked to be the entire logfile at the time.

^X50 08/26/11 11:38:40.010 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:38:40.397 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:38:40&start-max=2011-08-26T20:43:40 <0x402> 50 08/26/11 11:38:40.399 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:38:40.400 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:38:40.401 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:38:40.405 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:38:40.412 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:38:40.912 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:38:40&start-max=2011-08-26T20:43:40 <0x402> 50 08/26/11 11:38:40.914 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:38:40.915 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:38:40.916 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 11:43:40.010 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:43:40.407 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:43:40&start-max=2011-08-26T20:48:40 <0x402> 50 08/26/11 11:43:40.408 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:43:40.409 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:43:40.410 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:43:40.415 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:43:40.421 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:43:40.749 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:43:40&start-max=2011-08-26T20:48:40 <0x402> 50 08/26/11 11:43:40.750 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:43:40.751 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:43:40.752 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 11:48:40.009 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:48:40.304 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:48:40&start-max=2011-08-26T20:53:40 <0x402> 50 08/26/11 11:48:40.305 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:48:40.306 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:48:40.307 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:48:40.312 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:48:40.318 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:48:40.646 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:48:40&start-max=2011-08-26T20:53:40 <0x402> 50 08/26/11 11:48:40.647 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:48:40.648 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:48:40.649 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 11:53:40.009 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:53:40.292 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:53:40&start-max=2011-08-26T20:58:40 <0x402> 50 08/26/11 11:53:40.293 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:53:40.294 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:53:40.295 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:53:40.300 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:53:40.306 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:53:40.721 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:53:40&start-max=2011-08-26T20:58:40 <0x402> 50 08/26/11 11:53:40.723 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:53:40.724 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:53:40.725 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 11:58:40.015 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 11:58:40.313 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:58:40&start-max=2011-08-26T21:03:40 <0x402> 50 08/26/11 11:58:40.314 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 11:58:40.315 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:58:40.316 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 11:58:40.321 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 11:58:40.327 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 11:58:40.672 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T15:58:40&start-max=2011-08-26T21:03:40 <0x402> 50 08/26/11 11:58:40.673 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 11:58:40.674 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 11:58:40.675 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 12:03:40.015 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 12:03:40.410 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T16:03:40&start-max=2011-08-26T21:08:40 <0x402> 50 08/26/11 12:03:40.411 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 12:03:40.412 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 12:03:40.413 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 12:03:40.418 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 12:03:40.424 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 12:03:40.836 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T16:03:40&start-max=2011-08-26T21:08:40 <0x402> 50 08/26/11 12:03:40.837 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 12:03:40.838 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 12:03:40.839 luup_log:20: GCAL: no event with name HEATING_ON is currently active <0x402> 50 08/26/11 12:08:40.017 luup_log:18: GCAL: checking google calendar <0x402> 50 08/26/11 12:08:40.365 luup_log:18: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T16:08:40&start-max=2011-08-26T21:13:40 <0x402> 50 08/26/11 12:08:40.367 luup_log:18: GCAL: query status: 0 <0x402> 50 08/26/11 12:08:40.368 luup_log:18: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 12:08:40.369 luup_log:18: GCAL: an event with name HEATING_OFF is currently active <0x402> 50 08/26/11 12:08:40.373 luup_log:18: GCAL: no value attached <0x402> 50 08/26/11 12:08:40.380 luup_log:20: GCAL: checking google calendar <0x402> 50 08/26/11 12:08:40.803 luup_log:20: GCAL: query url: http://www.google.com<Private Key>=json&fields=entry/title&start-min=2011-08-26T16:08:40&start-max=2011-08-26T21:13:40 <0x402> 50 08/26/11 12:08:40.804 luup_log:20: GCAL: query status: 0 <0x402> 50 08/26/11 12:08:40.805 luup_log:20: GCAL: query result: {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","entry":[{"title":{"$t":"HEATING_OFF","type":"html"}}]}} <0x402> 50 08/26/11 12:08:40.806 luup_log:20: GCAL: no event with name HEATING_ON is currently

JOD.

@JOD

your logfile has the lines:
GCAL: query url http://www.google.com/

I would need to know what is added at the end of (the start-min start-max values)

Ok, I see it now. Give me a minute to delete the private key lines and I will apend the previous post with the updated data.

JOD.

@henk

could you try the attached version to see if this fixes the problem (I do not want to change time zones on my system for testing as it would probably screw up everything).

@utz

Sure, no problem, while you were debugging, i was thinking…
Would a functon help where a user would enter his deviation from UTC as a variable?

Will let you know if it works!

  • Henk

[quote=“utz, post:59, topic:169003”]@henk

could you try the attached version to see if this fixes the problem (I do not want to change time zones on my system for testing as it would probably screw up everything).[/quote]