Google Calendar stop to work sice today at 4:30PM

3,071 views
Skip to first unread message

Marcolino

unread,
Nov 17, 2014, 3:25:03 PM11/17/14
to ope...@googlegroups.com
Hi All,
since today at 4.30PC CET, my google calendar integration stop to work.
I tried both Alternative to obtain URL, but i got always some error:

21:23:46.128 DEBUG o.o.i.g.i.GCalEventDownloader[:197]- Downloading calendar feed for time interval: 2014-11-17T20:23:46.128Z to  2014-11-17T20:25:46.128
21:23:46.461 ERROR o.o.i.g.i.GCalEventDownloader[:209]- downloading CalenerEventFeed throws exception: Forbidden


I tried to reboot openhab server, but nothing change. Please help I use google calendar to turn on my furnace.

Thanks

Marco

Marcolino

unread,
Nov 17, 2014, 3:41:40 PM11/17/14
to ope...@googlegroups.com
It seems Google does not permit anymore access to "full" calendar.
Running in browser I got this:

Forbidden

Error 403


Do anyone have this issue?

Thanks

Ben Jones

unread,
Nov 17, 2014, 3:57:07 PM11/17/14
to ope...@googlegroups.com
Yep I am seeing the same issue - as of 4-5 hours ago.

They have obviously changed something!

Marco Pozzuolo

unread,
Nov 17, 2014, 4:07:41 PM11/17/14
to ope...@googlegroups.com
How can I setup a schedule in different way? I have to use my furnace.

Thanks


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

2014-11-17 21:57 GMT+01:00 Ben Jones <ben.j...@gmail.com>:
Yep I am seeing the same issue - as of 4-5 hours ago.

They have obviously changed something!

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/LbqKLEdlDCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Mark

unread,
Nov 17, 2014, 4:07:56 PM11/17/14
to ope...@googlegroups.com
I haven't looked at the openHAB codebase to see what it depends upon, but Google obsoleted the V2 API spec today (Nov 17th).   See the banner at the top of the V2 doc:

They now require consumers to use the V3 version.


Mark

Marco Pozzuolo

unread,
Nov 17, 2014, 4:13:33 PM11/17/14
to ope...@googlegroups.com
Hi all,
how can setup similar like a Schedule into a Rule, in order to command my furnace? This is an emergency situation. :-))

Thanks


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

--

Ben Jones

unread,
Nov 17, 2014, 4:17:24 PM11/17/14
to ope...@googlegroups.com
Just use standard cron (time based) rule triggers;


E.g.;

rule "Turn on furnace at 8am"
when
    Time cron "0 0 8 * * ?"
then
    Heating_Furnace.sendCommand(ON)
end

Marcolino

unread,
Nov 17, 2014, 4:25:41 PM11/17/14
to ope...@googlegroups.com
Hi Ben,
Thanks for help. I Hope Developer of this Bindings, look into to solve this issue with google, as soon as possible.
This calendar bindings is very cool feature.

Marco

Thomas E.-E.

unread,
Nov 17, 2014, 5:15:34 PM11/17/14
to ope...@googlegroups.com
Hi Marco,

i am the developer of this extension! As i am currently VERY busy with the preparations of the upcoming release i don't see a chance to fix this very sonn! Anybody else volunteering to upgrade the Google Calendar APIs to V3?

Thanks,

Thomas E.-E.

Marco Pozzuolo

unread,
Nov 17, 2014, 5:23:12 PM11/17/14
to ope...@googlegroups.com
Hi Thomas,
this is a very bad news for me :-)), I'm not a Java developer, so I cannot help, but if there is some HowTo's or some guide on how edit an OpenHAB AddIn, I'll try to look into, but I repeat, I'm not a Java developer.
If someone with more experiencing in Java programming can help us, is very appreciated.

@Thomas, futrure version of openhab, do have something like calendar schedule embedded?

Regards

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

--

Gaël L'hopital

unread,
Nov 18, 2014, 3:49:30 AM11/18/14
to ope...@googlegroups.com
Hi,
Facing the same problem, will try to give it a head today.

Gaël L'hopital

unread,
Nov 18, 2014, 10:21:10 AM11/18/14
to ope...@googlegroups.com
The problem is a bit deeper as expected since as I understood that moving to API v3 also means changing the authentication mode (switched to OAuth :( ).

Marco Pozzuolo

unread,
Nov 18, 2014, 10:23:26 AM11/18/14
to ope...@googlegroups.com
Hi Gael,
I appreciate a lot your work.
Let us know if you can fix.

Regards


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Gaël L'hopital

unread,
Nov 18, 2014, 12:54:01 PM11/18/14
to ope...@googlegroups.com
Thanks, but OAuth v2 also implies that openHAB can no longer work on-behalf of its user, it must handle an application ID, delivered by the developper (as far as I've digged right now). This leads me to another question wether openHAB shall still rely on an external calendar service, subject to uncontrolled evolution or move to a standard way of doing the same (caldav, ics...).
Opened question to openHAB gurus...

avi.h...@gmail.com

unread,
Nov 18, 2014, 3:25:01 PM11/18/14
to ope...@googlegroups.com
Hi everyone,

For the OAuth 2.0 you can define your own application id under your own google user. there is no need for openHAB to supply one.
After completing the OAuth flow for desktop application you will end up with a secret (in the form of a json file downloaded from the developers console) and credentials which can also be stored to a file.

This flow we will have to complete outside of openHAB with maybe a command line utility.

In my work place we have just upgraded our google calendar connector to use v3 api and funny I didn't do the connection when my fish feeder didn't work this morning (of course it is controlled my openHAB)

Marco Pozzuolo

unread,
Nov 18, 2014, 3:27:37 PM11/18/14
to ope...@googlegroups.com
Hi All,
we have to fix this. OpenHAB without a scheduler is incomplete app.
I'm not a Java developer, but I'm fully available to help in this issue.
Let me know what do you think.

Thanks

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Phil

unread,
Nov 18, 2014, 3:44:02 PM11/18/14
to ope...@googlegroups.com
Hi all

Wouldn't it be easier / somewhat more stable to use a CalDAV interface? Which might open the "gates" to other caldav providers (zimbra, etc)?

Pro/Cons caldav - pro/cons google api?

Gaël L'hopital

unread,
Nov 19, 2014, 3:15:12 AM11/19/14
to ope...@googlegroups.com
I agree that from a resilience perspective openHAB shall be the less coupled as possible with a specific provider for such a generic service - as well as for the same reasons we should avoid relying on internet services when local alternatives exists.
Then for Google Calendar specific point I completely agree.

My two cents and I would like to have Kaï or Thomas point on view on this.

jens.he...@googlemail.com

unread,
Nov 19, 2014, 5:37:09 PM11/19/14
to ope...@googlegroups.com
Hi all,

mabe we can adapt the gcal binding with very few effort to this tool:
http://www.k5n.us/webcalendar.php

It offers an xml RSS feed similar to that what google did before.

Anyway an additional caldav binding would be nice :)

cheers

franz.di...@gmail.com

unread,
Nov 20, 2014, 4:02:05 AM11/20/14
to ope...@googlegroups.com
The solution may be easier than it looks in the first place: Obviously the .../basic link still works and delivers a full set of information. I tried to simply change "full" to "basic" in openhab.cfg, but this alone did not work for me. So maybe the format is a bit different. But this is just a first guess. I did not investigate further.

Thomas E.-E.

unread,
Nov 20, 2014, 11:07:24 AM11/20/14
to ope...@googlegroups.com, franz.di...@gmail.com
Hi,

unfortunately the "basic" version does not provide the full information set. So i doubt just changing this will work.

Best, Thomas E.-E.

gluf...@gmail.com

unread,
Nov 20, 2014, 4:02:13 PM11/20/14
to ope...@googlegroups.com
https://wordpress.org/support/topic/403-forbidden-on-cal-url-deprecated-api

This sucks. I have full schedule for OpenHab and it is not working. I think it would be best if there is offline solution for a calendar. Maybe Owncloud



Marcolino

unread,
Nov 21, 2014, 5:26:37 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
Is it possible to use this GCal to MQTT ??


Marco

Marcolino

unread,
Nov 21, 2014, 6:39:29 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
Hi all,
beside adapting Bindings to V3 api, I'm lookin for an alternative solution, in order to get back calendar to work.
1) findings is an GCal to MQTT converter i found https://github.com/denschu/mqtt-google-calendar, but I'm not sure that it's working and I don't Know How make it work
2) I'm a microsoft developer, so I'm looking a way to create a wrapper to query GCal and then send command to openhab via rest API
3) The simple and quicker way, is to use an old Android Smartphone with Tasker. Tasker will be in between GCal and OHab. Tasker will trigger a profile, when a GCal event Start and Stop, and I can send command to openhav via Rest API

Do you have any other ideas?

Thanks

Gaël L'hopital

unread,
Nov 21, 2014, 9:59:50 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
Alternatives like mqtt, tasker introduce a layer in between  that is always a weakness and complexity source.
I'm going to take a look on how to interface openHAB with a CalDAV service (heading for owncloud).

Marco Pozzuolo

unread,
Nov 21, 2014, 10:08:07 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com

Thanks Gael for your works.
Marco

--

Phil

unread,
Nov 21, 2014, 10:20:14 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
I'm looking into writing a CalDAV thing as well, although I'm targeting google.

Marcolino

unread,
Nov 21, 2014, 10:40:57 AM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
Thanks to Phil aslo.
I'm available to help you with test/debugging. Unfortunately I'm not Java programmer, but I would like to help you with other tasks in possible.

Marco

avi.h...@gmail.com

unread,
Nov 21, 2014, 7:42:40 PM11/21/14
to ope...@googlegroups.com, gluf...@gmail.com
Hi,

I'm currently trying to upgrade gcal to Google Calendar V3 API but when replacing the jar with the new one I'm getting the following first line in the console:
Could not start: org.openhab.io.gcal(reference:file:plugins/org.openhab.io.gcal_1.5.1.jar:195). It's state is uninstalled.

Any idea? as I'm stuck on this issue and cannot proceed.

I'm attaching the source and also a document explaining the procedure we will need to take from the Google side.

The code is not complete yet . It doesn't use any user/password and currently only points to the default calendar.  We will need command line to generate the client credentials. The command line code is available, I just need to wrap it properly,




org.openhab.io.gcal.zip
OAuth 2.pdf

Ben Jones

unread,
Nov 21, 2014, 7:59:42 PM11/21/14
to ope...@googlegroups.com

Try removing the old one from/plugins and putting the new version in /addons.

avi.h...@gmail.com

unread,
Nov 21, 2014, 8:43:33 PM11/21/14
to ope...@googlegroups.com
I moved the jar to addons and I see the following line in the log but nothing else:
03:41:23.350 DEBUG o.o.i.g.internal.GCalActivator[:34]- Google Calendar IO has been started.

avi.h...@gmail.com

unread,
Nov 22, 2014, 5:55:43 PM11/22/14
to ope...@googlegroups.com
OK, seems to find my mistake. used the activate() to initiate some members which is wrong.
The upgraded code now works in debug.
I'll try to find time to finish it this week.


Martin Klimke

unread,
Nov 23, 2014, 5:53:25 AM11/23/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Marco,

It is really great that you are updating this binding because this is an important binding.
What I had always found missing is the possibility to access the title of the event and have it assigned to an item.
item change should be triggers at the moment the event is issued.

In many application, this would release me from entering the specific syntax in the comment field of the calendar entry.

kind regards

Martin

PS: I know asking for new features at moment when the code is broken may be considered a bit too much ....

franz.di...@gmail.com

unread,
Nov 23, 2014, 10:33:46 AM11/23/14
to ope...@googlegroups.com, franz.di...@gmail.com
Fair enough. My hope for a quick solution overwhelmed me :-)

avi.h...@gmail.com

unread,
Nov 23, 2014, 11:08:03 AM11/23/14
to ope...@googlegroups.com, franz.di...@gmail.com
Hi,

I'm attaching a command line tool (a bit quick and dirty) to get the required credentials for the gcal.

You should extract to a folder, open a command prompt from this folder and run the batch (windows for now).
You should first follow the instructions in the attached PDF in order to get the *.json secret file.

There are two methods available:
1) gets the authorization URL
2) Gets the user credentials

Usage looks like that:

gcalHealper.bat getAuthURL c:\temp\client_secrets.json

C:\temp\gcalCLI>gcalHealper.bat getUserCredentials c:\temp\client_secrets.json 4/nXsN9ksW4Jc6tWYPVWKyTE0AfhpvxkM1YIgq5U2Vrh8

Please test that you can get both the URL and credentials file.
Those two files will be referenced in the openhab configuration.
gcalCLI.zip
OAuth 2.pdf

Marco Pozzuolo

unread,
Nov 23, 2014, 2:44:31 PM11/23/14
to ope...@googlegroups.com, franz.di...@gmail.com

Hi avi,
Thanks for your work. This evening or tomorrow I'll try to obtain urk and file.

Marco

--

avi.h...@gmail.com

unread,
Nov 23, 2014, 5:21:04 PM11/23/14
to ope...@googlegroups.com, franz.di...@gmail.com
Hi,

I have something working that you can test.

please remove the original jar (org.openhab.io.gcal_1.5.1.jar) from openhab1.x/server/plugins and place the attached one in openhab1.x/addons

in the openhab.cfg add the following configurations to the gcal section:

gcal:calendarid= <leave blank for the primary calendar>
gcal:secretsfilepath=<the *.json file downloaded from Google - see instructions in the OAuth 2.0.pdf>
gcal:credentialsdatastorefolder=<the folder where you copied the client credentials file obtained using the command line utility>

The url and username/password are not used anymore

On my pi I'm using:

gcal:calendarid=
gcal:secretsfilepath=/opt/openhab1.5.1/client_secrets.json
gcal:credentialsdatastorefolder= /opt/openhab1.5.1/gcal_store


.
org.openhab.io.gcal_1.5.1.jar

Marco Pozzuolo

unread,
Nov 23, 2014, 5:23:21 PM11/23/14
to ope...@googlegroups.com
Hi avi,
one question, I use not default calendar. Where can I get my CalendarID? The name is enought?

Thanks


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

avi.h...@gmail.com

unread,
Nov 23, 2014, 5:37:59 PM11/23/14
to ope...@googlegroups.com
Hi,

When you open your calendar settings > Calendars > navigate to your calendar > search for Calendar ID
Use this value for the gcal:calendarid=

Marco Pozzuolo

unread,
Nov 23, 2014, 5:39:56 PM11/23/14
to ope...@googlegroups.com
Thanks,
tomorrow I'll try all procedure and software. I suppose syntax for start and stop command is the same.
Thanks for your work.

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Marcolino

unread,
Nov 24, 2014, 5:01:47 AM11/24/14
to ope...@googlegroups.com
Hi avi,
I followed your steps and obtained Credential from google.
I copied jar into /addons folder and credential on local folder on openhab server.
I modified openhab.config in according with yours but calendar is not working.
I use this command in description:

start {send TEST ON} end {send TEST OFF}

TEST is a switch Item.
In openhab.log I got only few information, but not detailed one:

root@OpenHAB:~# tail -f /opt/openhab/logs/openhab.log | grep -i gcal
10:57:04.669 DEBUG o.o.i.g.internal.GCalActivator[:42]- Google Calendar IO has been stopped.
10:57:10.456 DEBUG o.o.i.g.internal.GCalActivator[:34]- Google Calendar IO has been started.
10:57:10.494 DEBUG o.o.i.g.internal.GCalActivator[:34]- Google Calendar IO has been started.


No more detail.
Let me know. Regards

Marco

avi.h...@gmail.com

unread,
Nov 24, 2014, 5:28:53 AM11/24/14
to ope...@googlegroups.com
Did you remove the original jar from server/plugins?
Do you have log in debug open for the gcal binding?
it should be something like that according to the wiki:

<logger name="org.openhab.io.gcal" level="TRACE" />

On my side with openhAB 1.5.1 it works with no issues on the primary calendar. Maybe try on your primary and check if it is picking anything.

Marcolino

unread,
Nov 24, 2014, 5:34:20 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Avi,
I removed old jar from server/plugin and added trace.
I'm using primary calendar.
I'll let you know

Marco

Marcolino

unread,
Nov 24, 2014, 5:53:10 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Avi,
as told i removed old jar from server/plugins and copied your jar to /addons
I added to locgback.xml this line:

<logger name="org.openhab.io.gcal" level="TRACE" />

Now I get some log at startup, but no event is fired. Here is the logs:

root@OpenHAB:~# tail -f /opt/openhab/logs/openhab.log | grep -i gcal
11:47:22.434 DEBUG o.o.i.g.internal.GCalActivator[:34]- Google Calendar IO has been started.
11:47:22.466 DEBUG o.o.i.g.i.GCalEventDownloader[:581]- *** loading secretsfilepath: /opt/openhab/gcal_store/client_secrets.json and credentialsdatastorefolder: /opt/openhab/gcal_store
11:47:22.466 DEBUG o.o.i.g.i.GCalEventDownloader[:592]- *** no gcal:calendarid was provided. Using the primary calendar
11:47:22.466 DEBUG o.o.i.g.i.GCalEventDownloader[:606]- ===== initilaize the the user credentials  =====
json file: /opt/openhab/gcal_store/client_secrets.json credentials folder:  /opt/openhab/gcal_store
11:47:22.590 DEBUG o.o.i.g.i.GCalEventDownloader[:627]- ===== end initilaize the the user credentials =====




avi.h...@gmail.com

unread,
Nov 24, 2014, 6:10:24 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
Search for "the client calendar service was created successfully" and for "Unable to load client credentials!!!" and "create calendar service with loaded Credential"
I didn't prefix those with gcal

Marcolino

unread,
Nov 24, 2014, 6:26:33 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Avi,
I cannot find any of description above.
Can you confirm that I have to add to logback.xml only:

<logger name="org.openhab.io.gcal" level="TRACE" />

????

Thanks

avi.h...@gmail.com

unread,
Nov 24, 2014, 6:48:00 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
I think so. If you got the other messages you should get at least an error message related to OAuth 2.0.
Maybe I should add a validate code to the command line that return the list of Calendars. That way we can verify that the OAuth credentials are fine,

Please send me the log and I'll check.

Marcolino

unread,
Nov 24, 2014, 7:21:25 AM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Avi,
I send logs only to you.

Thanks

avi.h...@gmail.com

unread,
Nov 24, 2014, 4:24:02 PM11/24/14
to ope...@googlegroups.com, avi.h...@gmail.com
I'm attaching a new jar with additional logging and the project sources. This jar helped Marco to solve a configuration issue.
org.openhab.io.gcal_1.5.1.jar
org.openhab.io.gcal.zip

Marco Pozzuolo

unread,
Nov 24, 2014, 4:33:13 PM11/24/14
to ope...@googlegroups.com
HI all,
thanks to Avi. Fillow his instruction step to step and all will working fine.

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

--

Marcolino

unread,
Nov 25, 2014, 3:50:12 AM11/25/14
to ope...@googlegroups.com
Hi all,
in the end Avi's patch is working.
You have to follow the howto provided to generate client credential. It's very simple. Please check to write fine every file name.
Nothing difficult. If you have problem, ask here.

Bye

Gabriel López

unread,
Nov 25, 2014, 5:56:22 AM11/25/14
to ope...@googlegroups.com
The scripts are in windows, any chance to download the script in linux?

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/LbqKLEdlDCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.



--
Saludos

Ing. José Gabriel López Reboiras

avi.h...@gmail.com

unread,
Nov 25, 2014, 7:36:18 AM11/25/14
to ope...@googlegroups.com, gabriel...@gmail.com
I'm shooting a bit in the dark here but I assume that it is almost the same except for the separator of the classpath

Try something like that:

#!/bin/sh

java -cp lib/gcalHealper.jar:lib/google-api-client-1.19.0.jar:lib/google-api-services-calendar-v3-rev103-1.19.0.jar:lib/google-http-client-1.19.0.jar:lib/google-http-client-jackson2-1.19.0.jar:lib/google-oauth-client-1.19.0.jar:lib/jackson-core-2.1.3.jar org.openhab.io.gcal.authorization.Cli %1 %2 %3


You can also run the command line on windows machine if you have one and transfer the output files to the linux machine.

Gaël L'hopital

unread,
Nov 25, 2014, 9:42:16 AM11/25/14
to ope...@googlegroups.com, gabriel...@gmail.com, avi.h...@gmail.com
It works on my side too - thanks Avi !
I confirm the batch works on Linux with just modifiying it to be  :
#!/bin/sh

java -cp lib/gcalHealper.jar:lib/google-api-client-1.19.0.jar:lib/google-api-services-calendar-v3-rev103-1.19.0.jar:lib/google-http-client-1.19.0.jar:lib/google-http-client-jackson2-1.19.0.jar:lib/google-oauth-client-1.19.0.jar:lib/jackson-core-2.1.3.jar org.openhab.io.gcal.authorization.Cli $1 $2 $3

avi.h...@gmail.com

unread,
Nov 25, 2014, 10:48:31 AM11/25/14
to ope...@googlegroups.com, gabriel...@gmail.com, avi.h...@gmail.com
I'm attaching an updated command line that validates the credentials in the end and lists the client calendars.
gcalCLI.zip

mi...@secita.co.za

unread,
Nov 25, 2014, 11:06:48 AM11/25/14
to ope...@googlegroups.com
I am following the gcal fix process. How do you do "gcalHealper.bat getAuthURL c:\temp\client_secrets.json" in linux?

avi.h...@gmail.com

unread,
Nov 25, 2014, 11:37:10 AM11/25/14
to ope...@googlegroups.com
You have a gcalHealper.sh in the zip and the path should point to a *.json file on your linux file system

Ryan Press

unread,
Nov 25, 2014, 11:59:29 AM11/25/14
to ope...@googlegroups.com
Thanks Avi I also have the new gcal working with Linux, the
instructions worked perfect. At first I couldn't find the needed
gcalHealper.jar but I found it in the gcalCLI.zip you posted here.

Thanks again,
Ryan

On Tue, Nov 25, 2014 at 8:37 AM, <avi.h...@gmail.com> wrote:
> You have a gcalHealper.sh in the zip and the path should point to a *.json file on your linux file system
>
> --
> You received this message because you are subscribed to the Google Groups "openhab" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

simon.d...@gmail.com

unread,
Nov 25, 2014, 4:19:04 PM11/25/14
to ope...@googlegroups.com
I followed your instructions using the gcalHealper.sh and a URL was returned however if I type this into my browser i get a google 401 error.

avi.h...@gmail.com

unread,
Nov 25, 2014, 4:31:48 PM11/25/14
to ope...@googlegroups.com
check that you selected an email in the consent page and that you selected desktop application and other when creating the ID. I'll vote for the email in the consent page.

simon.d...@gmail.com

unread,
Nov 25, 2014, 4:56:36 PM11/25/14
to ope...@googlegroups.com
Many thanks :) Yes you were right the email address hadn't set when I pressed save, working now thanks a lot :)

mi...@secita.co.za

unread,
Nov 26, 2014, 4:42:36 AM11/26/14
to ope...@googlegroups.com
Thanks Avi. The last hurdle, hopefully, is to find class org.openhab.io.gcal.authorization.Cli on the Pi. Was that not in the jar file? Where should the jar file be located? I may be missing something obvious. Thanks again!

avi.h...@gmail.com

unread,
Nov 26, 2014, 4:57:17 AM11/26/14
to ope...@googlegroups.com, mi...@secita.co.za
This class is in the zip I sent that contains the command line. It is not in the org.openhab.io.gcal_1.5.1.jar used in the addons folder.

mi...@secita.co.za

unread,
Nov 26, 2014, 5:58:51 AM11/26/14
to ope...@googlegroups.com
OK, got it, thanks! I was not able to download the zip file onto mac (loaner) originally so used a PC instead. Got the URL and got the code! Unclear how to complete the final step getClientCredentials - I am getting errors again - using gcalHealper.sh. Parameters: <77 character code> <path to save credentials file> <path to *.json file>
Can the json file be renamed to something shorter? And, does the path to the json file include its name? My command line was:
bash gcalHealper.sh <long code> /home/pi/gcal /home/pi/gcal          <-- does not look right
Sorry for being such a pain. I am grateful for the help.

mi...@secita.co.za

unread,
Nov 26, 2014, 6:28:59 AM11/26/14
to ope...@googlegroups.com, mi...@secita.co.za, avi.h...@gmail.com
The OAuth 2.pdf instructions had the parameters switched. I referred to an earlier post to get it right. This time I get:
\Gcal healper Version 1.0

com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request

avi.h...@gmail.com

unread,
Nov 26, 2014, 6:47:14 AM11/26/14
to ope...@googlegroups.com, mi...@secita.co.za, avi.h...@gmail.com
Hi,

The PDF is not updated with the correct command line. The command line doesn't require you to provide the credentials folder, instead it will create the folder under the <user.home>/.store/gcal.
If you run the command line with no parameters you will get the correct syntax (for windows at least).

You can complete all steps on windows and copy the output files (json and credentials) to the pi.
You can rename the *json file but not the credentials file.


Try to redo the process again as you cannot run the getClientCredentials twice on the same code. You need to get a new URL and Authorize again.

avi.h...@gmail.com

unread,
Nov 26, 2014, 6:49:33 AM11/26/14
to ope...@googlegroups.com, mi...@secita.co.za, avi.h...@gmail.com
In the latest command line, when you call getUserCredentials() you should also see the list of user Calendars printed.
If you see those and not an error it means that the *.json + credentials file are fine.

simon.d...@gmail.com

unread,
Nov 26, 2014, 3:59:51 PM11/26/14
to ope...@googlegroups.com
Thanks Avi for all your help.

Has anyone experienced this error:

20:48:28.268 ERROR o.o.i.g.i.GCalEventDownloader[:640] - gcal: unable to set up authorization code flow =====

 


 

java
.io.EOFException: null

        at java
.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2325)




My config file is set to:


gcal:calendarid=<calendarid>@group.calendar.google.com



gcal
:secretsfilepath=/opt/openhab1.5/client_secrets.json

 

gcal
:credentialsdatastorefolder=/opt/openhab1.5/gcal_store

avi.h...@gmail.com

unread,
Nov 26, 2014, 4:59:36 PM11/26/14
to ope...@googlegroups.com, simon.d...@gmail.com
its io exception.
It is probably related to the credentialsdatastorefolder as the secret is loaded earlier in code.
When you created the secret, did you see all Calenders printed to the console?

Check that you actually have the credentials under /opt/openhab1.5/gcal_store


Please configure a separate appender and logger for the gcal in the logback.xml and send me the
gcal.log:

<appender name="FILE1" class="ch.qos.logback.core.FileAppender">
        <file>${openhab.logdir:-logs}/gcal.log</file>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{30}[:%line]- %msg%n%ex{5}</pattern>
        </encoder>
    </appender>


<logger name="org.openhab.io.gcal" level="TRACE" >
    <appender-ref ref="FILE1" />
    </logger>

simon.d...@gmail.com

unread,
Nov 26, 2014, 5:06:38 PM11/26/14
to ope...@googlegroups.com
Hi Avi

I did see all my calendars printed to the console and I have a file StoredCredential under /opt/openhab1.5/gcal_store.

I shall perform the logger tomorrow and send you the output.

many thanks 

Gabriel López

unread,
Nov 30, 2014, 8:28:50 PM11/30/14
to ope...@googlegroups.com
My Gmail blocks the gCalCLI.zip. i can't download because the page think it a virus.
Another way to download the file?

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/LbqKLEdlDCk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Marcolino

unread,
Dec 3, 2014, 10:42:06 AM12/3/14
to ope...@googlegroups.com, gabriel...@gmail.com
Have someone tested this bindings with OpenHAB 1.6.0?

Thanks

glh

unread,
Dec 3, 2014, 10:59:03 AM12/3/14
to ope...@googlegroups.com

Yes, it works fine

Le 3 déc. 2014 16:42, "Marcolino" <marco.p...@gmail.com> a écrit :
Have someone tested this bindings with OpenHAB 1.6.0?

Thanks

--

Gabriel López

unread,
Dec 5, 2014, 12:27:22 PM12/5/14
to ope...@googlegroups.com
i tried the command

C:\temp\gcalCLI>gcalHealper.
bat getUserCredentials c:\temp\client_secrets.json 4/nXsN9ksW4Jc6tWYPVWKyTE0AfhpvxkM1YIgq5U2Vrh8

which is this number? the calendar id?
i try with this but didn' t work.

Avi Wolf

unread,
Dec 5, 2014, 12:36:51 PM12/5/14
to ope...@googlegroups.com

it is not the calendar id. Its a code that is used to get the user crefentials and complete the OAuth 2.0 flow.

Did you receive any errors when running the command? Please post the command output.

Martin Klimke

unread,
Dec 8, 2014, 1:31:51 AM12/8/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi, 

I am running OPENHAB 1.6 on a Windows 8.1 machine and 
have created the json and the secret on a MAC and it seemed to work.
Then I have copied those two files to the Windows machine.
Additionally I put the .jar file into the addons folder.
In the server/plugin file I did not find the org.openhab.io.gcal file.

In cfg:

gcal:secretsfilepath=C:/Users/Martin/openhab/configurations/gcal/client_secret.json

gcal:credentialsdatastorefolder=C:/Users/Martin/openhab/configurations/gcal


in logs:

05:41:42.690 WARN  c.g.a.c.u.s.FileDataStoreFactory[:134]- unable to change permissions for everybody: C:\Users\Martin\openhab\configurations\gcal

05:41:42.692 WARN  c.g.a.c.u.s.FileDataStoreFactory[:139]- unable to change permissions for owner: C:\Users\Martin\openhab\configurations\gcal

05:41:42.712 ERROR o.o.i.g.i.GCalEventDownloader[:627]- gcal: unable to load client secret =====


java.io.FileNotFoundException: Invalid file path

at java.io.FileInputStream.<init>(Unknown Source)

at java.io.FileReader.<init>(Unknown Source)

at org.openhab.io.gcal.internal.GCalEventDownloader.updated(GCalEventDownloader.java:625)

at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183)

at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)


Questions:
1. Do I have to execute the secret creation procedure on the same machine that is running OPENHAB?
2. I have also tried to us "/" and "\" in the path.

Any other ideas?
Help would be really appreciated.

cheers Martin

Martin Klimke

unread,
Dec 9, 2014, 1:10:48 PM12/9/14
to ope...@googlegroups.com, avi.h...@gmail.com

Due to the great support of AVI I could resolve the problem.
It seemed that an invisible character in the configuration file corrupted the file path definition.

Thanks again to AVI.

Cheers Martin

Tiit Hein

unread,
Dec 18, 2014, 6:45:47 AM12/18/14
to ope...@googlegroups.com, avi.h...@gmail.com
HI

I try to test gcal, but got strange behavior. I followed the steps as required, but I don't see nothing in logs about gcal addon start. Original one starts and I see it from logs. I copied it to Addons folder, my credentials are in gcal_store folder and client_secret.json file is also at the same place. Are I doing something wrong?

Thanks...

Tiit

Marco Pozzuolo

unread,
Dec 18, 2014, 7:40:33 AM12/18/14
to ope...@googlegroups.com
have you removed old jar from /opt/openhab/server/plugins ?

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

--

Tiit Hein

unread,
Dec 18, 2014, 8:29:49 AM12/18/14
to ope...@googlegroups.com
There was no such file. Copied it only to Addons folder. Maybe 1.6.1 is not compatible?

Tiit

Marco Pozzuolo

unread,
Dec 18, 2014, 8:32:56 AM12/18/14
to ope...@googlegroups.com
I know someone have sucefully used with 1.6.1, but I'm not sure, take a look on older posts on this thread.
In that folder you should have the old version of the bindings, prehaps developers removed from 1.6.X

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Tiit Hein

unread,
Dec 18, 2014, 8:35:14 AM12/18/14
to ope...@googlegroups.com
I try it with 1.5.1 for sure.

Tiit

Marco Pozzuolo

unread,
Dec 18, 2014, 8:36:39 AM12/18/14
to ope...@googlegroups.com
Hi Tiit,
if you try with 1.5.1 please be sure to remove old binding from plugin folder.

M.


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Tiit Hein

unread,
Dec 18, 2014, 8:43:55 AM12/18/14
to ope...@googlegroups.com
Yes .. in 1.5.1 is the file in plugins folder. Seems like in 1.6.1 is it removed. But nothing changed for me... can't see nothing about gcal starting in logs. Very strange ...

Tiit Hein

unread,
Dec 18, 2014, 8:44:55 AM12/18/14
to ope...@googlegroups.com

If I copy gcal plugin from addons.zip file, it starts and I see status in log files.

Marco Pozzuolo

unread,
Dec 18, 2014, 8:46:36 AM12/18/14
to ope...@googlegroups.com
Hi Tiit
I'm not the developer but Avi sometime is available to help us. Take a complete look into past posts and check if you can solve. If I can remeber, Avi released a second version with more logging and the steps to generate a separate log file. All information were into past posts.
Regards



-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

Shane Veness

unread,
Dec 18, 2014, 9:34:59 AM12/18/14
to ope...@googlegroups.com, gabriel...@gmail.com
I have this working on 1.6.0

Followed instructions, except no jar file in plugins to remove, otherwise works fine.

Tiit Hein

unread,
Dec 18, 2014, 9:49:30 AM12/18/14
to ope...@googlegroups.com, gabriel...@gmail.com
Yes .. I have same problem also with 1.5.1, it seems to releated somehow with my config, because I tested it with Windows machine and everything worked with 1.5.1 and 1.6.1. On my Linux server OpenHAB completely ignores the gcal addon. I use OpenJDK, not Sun Java, but that should not count.

Tiit

Marco Pozzuolo

unread,
Dec 18, 2014, 9:52:54 AM12/18/14
to ope...@googlegroups.com
Hi Tiit,
please check permission on jar file of gcal extension. it should be readable and executable from same user running OpenHab on Linux.

M.


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.

--

Shane Veness

unread,
Dec 18, 2014, 9:56:41 AM12/18/14
to ope...@googlegroups.com
Silly Question, but haven't used google calendar addon before...do you have to reload anything on openhab to pick up new calendar entries? I.E if I create a new schedule, do I have to reboot openhab? I ask this because the log file seems to indicate that it only loads the events on boot? 

Let me know 

Thanks

Tiit Hein

unread,
Dec 18, 2014, 10:13:39 AM12/18/14
to ope...@googlegroups.com
If I copied org.openhab.io.gcal-1.6.1.jar (file is with same permissions as Avi's org.openhab.io.gcal_1.5.1.jar) comes   "[io.gcal.internal.GCalActivator:34   ] - Google Calendar IO has been started" to log.

Boris Holscher

unread,
Dec 19, 2014, 5:03:33 PM12/19/14
to ope...@googlegroups.com, gabriel...@gmail.com
Hi Tiit!
I had big problems with gpio.io and influxdb when using OpenJDK. After installing Oracle Java, everything was fine, so I do believe there are differences. My OpenHab runs on an A20-Olinuxino Allwinner ARM board.

Hope it may help you!
Boris

Alex Karls

unread,
Dec 22, 2014, 5:38:43 AM12/22/14
to ope...@googlegroups.com
Tried Avi Wolf`s solution, seems to work. Has anyone done the same fix for the GCal Persistence? Or would that be the same like 
gcal-persistence:calendarid= <leave blank for the primary calendar>?






Tiit Hein

unread,
Dec 23, 2014, 2:58:33 PM12/23/14
to ope...@googlegroups.com, gabriel...@gmail.com
Thanks for the tip. I try it after holidays.

Tiit

Tiit Hein

unread,
Dec 23, 2014, 5:01:13 PM12/23/14
to ope...@googlegroups.com, gabriel...@gmail.com
Yes .. Oracle Java works very good. Strange, whats different with OpenJDK.

Happy holidays to everyone!

Tiit

Martin Klimke

unread,
Dec 25, 2014, 9:09:43 PM12/25/14
to ope...@googlegroups.com, gabriel...@gmail.com
Unfortunately the binding stopped working again, since a couple of days.

19:17:04.170 ERROR o.o.c.s.AbstractActiveService[:175]- Error while executing background thread Google Calender Event-Downloader
java.lang.NullPointerException: null
at org.openhab.io.gcal.internal.GCalEventDownloader.createTriggerAndSchedule(GCalEventDownloader.java:455)
at org.openhab.io.gcal.internal.GCalEventDownloader.processEntries(GCalEventDownloader.java:335)
at org.openhab.io.gcal.internal.GCalEventDownloader.execute(GCalEventDownloader.java:177)
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173)

Avi Wolf

unread,
Dec 26, 2014, 12:40:28 AM12/26/14
to ope...@googlegroups.com
Do you have somehow a missing end or start date in one of your Calendar events. I'm not sure in which scenario the Calender event will have no start or end date. Maybe "all day event".
The logic of this part of the code was not changed with the upgrade to V3 API:

String jobIdentity = event.getICalUID() + (isStartEvent ? "_start" : "_end");

       
            DateTime date =
                isStartEvent ? event.getStart().getDateTime() : event.getEnd().getDateTime();
            long dateValue = date.getValue();

Avi.



--

Martin Klimke

unread,
Dec 26, 2014, 2:16:51 AM12/26/14
to ope...@googlegroups.com, avi.h...@gmail.com
Hi Avi,

Thanks for the reply. 
It was an whole day entry spanning from the 24th to the 5th of January.
This seems to be indeed a bug that is not the API 3.0 change.

Thanks for much for the support.

regards

Martin

homeirrigati...@gmail.com

unread,
Jan 1, 2015, 3:54:25 PM1/1/15
to
I have followed the instructions in this thread and it seems to have worked except that when I satart the openHAB server I get

2015-01-01 13:45:36.999 [DEBUG] [io.gcal.internal.GCalActivator] - Google Calendar IO has been started.
2015-01-01 13:45:37.042 [DEBUG] [g.internal.GCalEventDownloader] - gcal: loading secretsfilepath: /opt/openhab/configurations/client_secret_1046674961202-3u64hqvl8gj5jq4gnqt7c9a8cg7peb6o.apps.googleusercontent.com.json and credentialsdatastorefolder: /opt/openhab/configurations
2015-01-01 13:45:37.042 [DEBUG] [g.internal.GCalEventDownloader] - gcal: calendarid was provided. Using the primary calendar
2015-01-01 13:45:37.042 [DEBUG] [g.internal.GCalEventDownloader] - gcal:===== initilaize the the user credentials  =====
json file: /opt/openhab/configurations/client_secret_1046674961202-3u64hqvl8gj5jq4gnqt7c9a8cg7peb6o.apps.googleusercontent.com.json credentials folder:  /opt/openhab/configurations
2015-01-01 13:45:37.115 [DEBUG] [g.internal.GCalEventDownloader] - gcal: ===== end initilaize the the user credentials =====

2015-01-01 13:45:37.115 [DEBUG] [g.internal.GCalEventDownloader] - gcal: loading client secret =====

2015-01-01 13:45:37.151 [DEBUG] [g.internal.GCalEventDownloader] - gcal: setting up authorization code flow =====

2015-01-01 13:45:37.173 [DEBUG] [g.internal.GCalEventDownloader] - gcal: trying to load credentials =====

2015-01-01 13:45:37.183 [DEBUG] [g.internal.GCalEventDownloader] - gcal: create calendar service with loaded Credential
2015-01-01 13:45:37.191 [DEBUG] [g.internal.GCalEventDownloader] - gcal:the client calendar service was created successfully
2015-01-01 13:45:37.191 [DEBUG] [g.internal.GCalEventDownloader] - gcal: End of configuration loading
2015-01-01 13:45:37.191 [INFO ] [.service.AbstractActiveService] - Google Calender Event-Downloader has been started
2015-01-01 13:45:37.928 [DEBUG] [g.internal.GCalEventDownloader] - gcal: feed contains no events ...

I have created a daily recurring event with this in the description:
start {
    send BY_Wall_S ON
}
end {
    send BY_Wall_S OFF
}

BY_Wall_S is a switch item connected to my irrigation.

Have I set this up correctly? What am I missing? Thanks for any help.

Edit: never mind. It works! Thanks for the fix :)

Robin

unread,
Jan 1, 2015, 4:09:37 PM1/1/15
to ope...@googlegroups.com
Sorting through this thread was a little confusing so I put together a github repo as I went. All of the correct files and instructions are there. Hopefully it is helpful for others trying this fix.
It is loading more messages.
0 new messages