Gcal-binding doesn't work & making a new binding

1,231 views
Skip to first unread message

gino.h...@gmail.com

unread,
Aug 26, 2012, 12:18:37 PM8/26/12
to ope...@googlegroups.com

Hi,


I'm new at OpenHab and I want to use it in the future to connect to my bTicino MyHome-installation (OpenWebNet-protocol).

For now I'm able to use HTTP-request to a webserver that sends the OpenWebNet-commands.

I know there is not yet a binding available for OpenWebNet, so at this time I'm playing with the features already available at OpenHab.

I'm using OpenHab 1.0.0 and I'm starting with the demo.cfg.


I'm having troubles setting up/using Gcal-binding.


My config for Gcal-binding looks like:

########################## Google Calendar configuration ##############################


# the username and password for Google Calendar Account

gcal:username='*************@gmail.com'

gcal:password='*********'


# the url of the calendar feed

gcal:url='https://www.google.com/calendar/feeds/************group.calendar.google.com/private-**********/full'


# refresh interval in milliseconds (optional, defaults to 900000 [15 minutes])

gcal:refresh=60000  #testing with Gcal : refresh every minute


# the offset (in days) new calendar entries will be created in future (optional,

# defaults to 14)

#gcal:offset=


# the base script which is written to the newly created Calendar-Events by

# the GCal-based presence simulation. It must contain two format markers '%s'.

# The first marker represents the Item to send the command to and the second

# represents the State (optional, defaults to 

# '> if (PresenceSimulation.state == ON) sendCommand(%s,%s)')

#gcal:executescript=


I didn't know if the strings must be between ' or " so I tried both, but I don't get to activate a Light using my Gcal.


Is there something wrong with my setup?

Can I see in the logging (or any other way) that the Gcal-binding is started?

To make a binding for OpenWebNet I need to have socket-communication over TCP/IP. What binding do you recommend to start working on?

As far as I noticed, documentation for binding is "inline comments"?


Kind regards,


Gino


Karel Goderis

unread,
Aug 26, 2012, 12:45:24 PM8/26/12
to ope...@googlegroups.com
Gino

A TCP/UDP based binding will be available shortly, as well as some other bindings that build on top of that. Based on that you could develop the OWN binding

Karel

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/zSn7J05ldbsJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.

Gino Hoskens

unread,
Aug 26, 2012, 1:05:51 PM8/26/12
to ope...@googlegroups.com
Hi Karel,

That is good news! I'm waiting ... 

2012/8/26 Karel Goderis <karel....@me.com>
32B.gif

Thomas Eichstädt-Engelen

unread,
Aug 26, 2012, 4:09:44 PM8/26/12
to ope...@googlegroups.com
Hi Gino,

I didn't know if the strings must be between ' or " so I tried both, but I don't get to activate a Light using my Gcal.


neither ' nor " :-). If you are going to configure a special execution script (which is by the way only incorporated by events created automatically by presence simulation feature) you should configure it without any special character, e.g.

gcal:executescript=> if (Mode_PresenceSimulation.state == ON) %s.sendCommand(%s)

But for "normal use". You should create a new entry in the calendar referred by your configuration. A Simple entry should look like this

send ItemNameOfYourLight ON

or a bit more sophisticated

start {
send ItemNameOfYourLight ON
}
end {
send ItemNameOfYourLight OFF
}

which will switch your light on at the beginning and off at the end of the your calendar event.

Can I see in the logging (or any other way) that the Gcal-binding is started?

when starting in debug mode (start_debug.xxx) you should see a log statement like "Google Calendar IO has been started.". You could also increase loglevel by adding the following line to your logback.xml

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

As far as I noticed, documentation for binding is "inline comments"?


no, there wiki-pages for each binding. See http://code.google.com/p/openhab/wiki/GCalBinding for the GCal documentation.

Regards,

Thomas E.-E.

gino.h...@gmail.com

unread,
Aug 27, 2012, 2:28:15 PM8/27/12
to ope...@googlegroups.com, gino.h...@gmail.com

Hi Thomas,


I don't see any line in the logging about Google Calendar ("Google Calendar IO has been started.").

I added the line "<logger name="org.openhab.io.gcal" level="DEBUG" />" to logback.xml.


I did restart the OpenHAB server but still no line "Google Calendar IO has been started".

I attached my log back xml-files, my openhab.cfg and the openhab.log;.


What am I doing wrong?


Kind regards,


Gino

logback.xml
logback_debug.xml
openhab.cfg
openhab.log

Sam

unread,
Sep 11, 2012, 11:03:53 AM9/11/12
to ope...@googlegroups.com
Hi Gino,

Did you ev get the Gcal binding to work. I have similar issues:

- openhab 1.0.0
- configured my openhab.cfg file as follows:

########################## Google Calendar configuration ##############################
 
# the username and password for Google Calendar Account
gcal:username=myuse...@gmail.com
gcal:password=mypassword
 
# the url of the calendar feed
gcal:url=https://www.google.com/calendar/feeds/myprivateurl/full
 
# refresh interval in milliseconds (optional, defaults to 900000 [15 minutes])
gcal:refresh=90000
 
# the offset (in days) new calendar entries will be created in future (optional,
# defaults to 14)
#gcal:offset=
 
# the base script which is written to the newly created Calendar-Events by
# the GCal-based presence simulation. It must contain two format markers '%s'.
# The first marker represents the Item to send the command to and the second
# represents the State (optional, defaults to
# '> if (PresenceSimulation.state == ON) sendCommand(%s,%s)')
#gcal:executescript=


When I enter commands in Gcal, e.g. send Light_kitchen ON, the light in the kitchen does not turn on at the scheduled time.

Should I use my GCal public or private address xml? (I tried both but I think my public address is not shared (open to the world)).

What else could be wrong?

Gino

unread,
Sep 11, 2012, 2:20:47 PM9/11/12
to openhab
Hi Sam,

I did have time to go into this further so I don't got it working yet.
I'm using the private link.

After the last update (27 AUG) I read a new thread :
https://groups.google.com/forum/#!topic/openhab/6tZLQuyaP9w
There was something wrong with the demoserver.

I will try this weekend the new demoserver. I think this demoserver I
have now doesn't work anymore with google.

Let me know if you succeed in setting up the gcal binding :-)
I will try this weekend.

Kind regards,

Gino

On Sep 11, 5:03 pm, Sam <samcal...@hotmail.com> wrote:
> Hi Gino,
>
> Did you ev get the Gcal binding to work. I have similar issues:
>
> - openhab 1.0.0
> - configured my openhab.cfg file as follows:
>
> ########################## Google Calendar configuration ##############################
>
> # the username and password for Google Calendar Account
> gcal:username=myusern...@gmail.com

Thomas Eichstädt-Engelen

unread,
Sep 11, 2012, 2:55:55 PM9/11/12
to ope...@googlegroups.com
Hi Gino, Sam,

my configuration look like this:

gcal:username=<em...@gmail.com>
gcal:password=<password>
gcal:url=https://www.google.com/calendar/feeds/o2308762387687das87d687%40group.calendar.google.com/private/full
gcal:executescript=> if (Mode_PresenceSimulation.state == ON) %s.sendCommand(%s)

What i observed at my installation is that the GCal-Binding is not started anymore. It somehow stops acquiring new data from Google. Currently it is not straight forward to see if the bundle is still in the download loop. If you are familiar with the Eclipse-IDE you could start a remote debugging session with openHAB. Please let me know if this would be an option for you.

I will investigate further why GCal-Binding stops downloading the feed suddenly.

Regards,

Thomas E.-E.

Sam

unread,
Sep 15, 2012, 2:02:45 AM9/15/12
to ope...@googlegroups.com
Thomas,

Thanks for your help.

My Gcal url format looks different from yours, i got it by following the instructions copying the xml link:

gcal:url=https://www.google.com/calendar/feeds/sam.calmes7%40gmail.com/private-fcd94e6c6ae219d765e5f7b4ebaea22c/full

Are you saying that the Gcal binding is not working on Openhab 1.0.0? Is nobody else currently using it successfully?

No I am not familiar with Eclipse.

Thanks for any help, it would be nice to have the Gcal binding working.

Michael Aschenborn

unread,
Sep 17, 2012, 9:48:32 AM9/17/12
to ope...@googlegroups.com
I've problems with gCal-Binding, too:

My configuration seems to be OK - in the logfile I find:
14:16:09.076 DEBUG o.o.i.g.internal.GCalActivator[:54]- Google Calendar IO has been started.
14:16:09.143 DEBUG o.o.i.g.i.p.GCalPresenceSimulation[:161]- Scheduled Google Calendar Upload-Job with interval '10'

I created an event with description:
start {
  send("mic...@email.de", "Start")
}
end {
  send("mic...@email.de", "Stop")
}
starting at 15:00 ending at 16:00

Now I should receive a xmpp-message at 15 and 16:00

But nothing happens?!?

Michael
 

Thomas Eichstädt-Engelen

unread,
Sep 17, 2012, 4:05:39 PM9/17/12
to ope...@googlegroups.com
Hi Michael,

did you double check if sending an XMPP-Message would work without GCAL?

Regards,

Thomas E.-E.

Aschenborn, Michael

unread,
Sep 17, 2012, 4:09:24 PM9/17/12
to ope...@googlegroups.com

Hi Thomas,  I use XMPP intensively as test output console and it works... except from gcal.
Michael

--

Sam

unread,
Oct 27, 2012, 5:05:25 AM10/27/12
to ope...@googlegroups.com, gino.h...@gmail.com
Any news on the Gcal functionality in Openhab 1.0.0. Is it working for anybody?

Thanks,

Sam

Thomas Eichstädt-Engelen

unread,
Nov 1, 2012, 9:52:37 AM11/1/12
to ope...@googlegroups.com

Hi Sam,

yes, for me ... there seems to an issue when there are to many events to download and when the event's start-times overlap or are very similar. I will have to investigate in more detail. But in your case there is just one event which isn't executed properly.

If you copy the given url and paste it into your browser you should see your calendar feed with all recorded events, do you? If yes, you should see a log-entry like "found {} calendar events to process", do you?

Regards,

Thomas E.-E.

angel...@gmail.com

unread,
Mar 3, 2013, 5:23:01 PM3/3/13
to ope...@googlegroups.com, gino.h...@gmail.com

Hi everybody,

I'm a newbie to openHAB, I have tested on my own with raspberry pi, and I attached some RF-Switch sockets. The next step I want is schedule some actions, and I want to do with gcalbinding, but I don't see that in openHAB 1.1.0

Is the GCalBinding abandoned?

Thanks

Thomas Eichstädt-Engelen

unread,
Mar 3, 2013, 5:25:23 PM3/3/13
to ope...@googlegroups.com
no, the GCal support is under heavy use in my installation ... what is the problem?


--
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.

To post to this group, send email to ope...@googlegroups.com.

angel...@gmail.com

unread,
Mar 3, 2013, 5:28:10 PM3/3/13
to ope...@googlegroups.com
I don't see the jar file in the addons package. Is not an addon?

I have configured the openhab.cfg, Have I do something else?

Thomas Eichstädt-Engelen

unread,
Mar 3, 2013, 5:51:11 PM3/3/13
to ope...@googlegroups.com
no, it is contained in the runtime package ...

- sent from a mobile device -

Ángel Bueno Pardo

unread,
Mar 3, 2013, 5:57:52 PM3/3/13
to ope...@googlegroups.com
ok, I will try it. I saw the name GCalBinding in the wiki, and I cheated.

Thank you very much.


2013/3/3 Thomas Eichstädt-Engelen <teic...@gmail.com>

Ángel Bueno Pardo

unread,
Mar 4, 2013, 5:13:32 PM3/4/13
to ope...@googlegroups.com
I can't create events from gcal.
I have configured openhab.cfg with the email address, the password, the url (finish with full), and the timeout (30000 for a rapid refresh) but I don't see any https connection from my box to gcal, and the action is not executed.
I don't know how can I debug that. Can anyone help me?

Thanks


2013/3/3 Ángel Bueno Pardo <angel...@gmail.com>

Thomas Eichstädt-Engelen

unread,
Mar 6, 2013, 6:17:27 PM3/6/13
to ope...@googlegroups.com
Hi,

did you start in debug-mode (start_debug.xxx) ? If started in debug-mode you should see statements like:

* found {} calendar events to process
* gcal feed contains no events ...

My config in openhab.cfg looks like:

gcal:username=em...@gmail.com
gcal:password=password

Can you open the given url in your browser?

Hope this helps,

Thomas E.-E.

Ángel Bueno Pardo

unread,
Mar 6, 2013, 6:28:22 PM3/6/13
to ope...@googlegroups.com
Hi Thomas,

I have found some interesting information about the problem.

I can access correctly to my url calendar by any way, that's not the problem. When I start openHAB, I can't see any gcal events in the log (I remember you that I use a raspberry pi).
I have access to osgi command prompt and I have stopped and started the bundle again. After that, I have seen the gcal events in the log, and I don't know why I have to stop and start by this way.

I have to make more tests, because I only see the endJob, nor the start. My log seems like:

23:54:47.585 INFO  o.o.i.g.i.GCalEventDownloader[:246] - created new endJob 'openHAB' with details 'SchedulerJob [jobKey=9bfl9s1vj4omd...@google.com_end, jobGroup=gcal, 1 triggers=[Wed Mar 06 23:55:00 CET 2013], content=start {
  send Light_Outdoor_Garage ON
}
end {
  send Light_Outdoor_Garage OFF
}'

And It's executed only the finish action.

Thanks by your help


2013/3/7 Thomas Eichstädt-Engelen <teic...@gmail.com>

--
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/XOnvbuFJYT8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

Thomas Eichstädt-Engelen

unread,
Mar 6, 2013, 6:34:43 PM3/6/13
to ope...@googlegroups.com
hmmm, that's strange! Do you see a logstatement like "won't be started because it isn't properly configured" ?

would be great if you could dig into it any further!

Sam

unread,
Mar 7, 2013, 3:49:12 PM3/7/13
to ope...@googlegroups.com

I am still unable to get gcal to work either. I also am not sure on how to debug it.

I have the following configuration:

# the username and password for Google Calendar Account

gcal:username=(my google e-mail)@gmail.com

gcal:password=(my password)

# the url of the calendar feed

gcal:url=https://www.google.com/calendar/feeds/sam.calmes7%40gmail.com/private-fcd94e6c6ae219d765e5f7b4ebaea22c/full

# refresh interval in milliseconds (optional, defaults to 900000 [15 minutes])

gcal:refresh=90000

- I am running start_debug.bat but I am not getting any log on 'gcal' nor 'Google' nor 'Calendar'. I do not know how to edit the logback.xml file(s)? to increase loglevel.

- If I open the given url in a browser I get a lot of html text with my feeds embedded several times

- my url for the calendar feed looks quite different to Thomas' url 

Any suggestions? I tried to play with the url, removing the text between private and /full but to no avail.

I really would like to get Gcal to work, it is the last main functionality that is missing in my Openhab system!

Ángel Bueno Pardo

unread,
Mar 7, 2013, 4:06:06 PM3/7/13
to ope...@googlegroups.com
Hi Sam, you can try my workaround.

on osgi command prompt, you have to list the bundle gcal with the command "osgi>bundle org.openhab.io.gcal". With this you can see the ID of this bundle, like this:

osgi> bundle org.openhab.io.gcal
org.openhab.io.gcal_1.1.0.201212161747 [197]
  Id=197, Status=ACTIVE

As you can see in this example, the ID is 197. Now you can stop and start this bundle with

osgi>stop 197
osgi>start 197

after that, in my case, the gcal function is operational

2013/3/7 Sam <samc...@hotmail.com>

--

Sam

unread,
Mar 7, 2013, 5:00:26 PM3/7/13
to ope...@googlegroups.com
Angel, pardon my ignorance, but how do I open an osgi command prompt?

Ángel Bueno Pardo

unread,
Mar 7, 2013, 5:10:36 PM3/7/13
to ope...@googlegroups.com
It depends on how you start openhab. If you launch ./start.sh, by default you will have an osgi prompt on that console.

You can edit start.sh and add after "-console" a port number like 1080. When you start openhab, you will have a socket listening at that port. If you make a "telnet localhost 1080", you can do the trick


2013/3/7 Sam <samc...@hotmail.com>
Angel, pardon my ignorance, but how do I open an osgi command prompt?

Thomas Eichstädt-Engelen

unread,
Mar 7, 2013, 6:29:12 PM3/7/13
to ope...@googlegroups.com
Hi,

the problem seems to be that the recurring timer is started at bundle activation time. But only if the bundle is configured properly before. In most of my tests that is the case but the platform doesn't guaranty any call sequence. So i have to implement an asynchronous workaround / callback for that.

Thanks for investigating,

Thomas E.-E.


 
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.

Ángel Bueno Pardo

unread,
Mar 7, 2013, 6:35:35 PM3/7/13
to ope...@googlegroups.com
Ok, good news!!! by the moment, we have a workaround. Thank you very much!


2013/3/8 Thomas Eichstädt-Engelen <teic...@gmail.com>

Sam

unread,
Mar 8, 2013, 2:41:14 AM3/8/13
to ope...@googlegroups.com
I am not on Linux (nor am I versed on Linux), I am on Windows. Is there a way to test the workaround for me?

Ángel Bueno Pardo

unread,
Mar 8, 2013, 2:57:35 AM3/8/13
to ope...@googlegroups.com
It's the same. On my last instructions you have to change start.sh to start.bat.


2013/3/8 Sam <samc...@hotmail.com>
I am not on Linux (nor am I versed on Linux), I am on Windows. Is there a way to test the workaround for me?

Sam

unread,
Mar 8, 2013, 10:21:13 AM3/8/13
to ope...@googlegroups.com
Ok, works like a charm now with Angel's workaround, for both start and end events. Thanks for your patience Angel and let's hope it is not too hard to fix permanently.

Thomas Eichstädt-Engelen

unread,
Mar 8, 2013, 11:06:39 AM3/8/13
to ope...@googlegroups.com

let's hope it is not too hard to fix permanently.

we'll see :-)

Thanks to both of you!

Thomas E.-E.

Sam

unread,
Mar 11, 2013, 4:51:46 AM3/11/13
to ope...@googlegroups.com
I entered a dozen or so events per day but it seems that some events (not always the same?) are skipped/ignored. Most of my events include start and stop in the same event, Any ideas on preventing this? Is it better to split a start/stop event into 2 events?

angel...@gmail.com

unread,
Mar 11, 2013, 11:09:08 AM3/11/13
to ope...@googlegroups.com
You can see at openhab_directory\logs\events.log to get more detailed about your problem. If you don't have that file, you can configure the logback.xml file as "https://github.com/MehrCurry/openhab-config/blob/master/logback.xml"

Give us more details to determine the problem.

Thomas Eichstädt-Engelen

unread,
Mar 11, 2013, 3:56:38 PM3/11/13
to ope...@googlegroups.com
Hi,

if you use start_debug.xxx start script the appropriate log configuration is done already.

Wait until some evens are fired. "Hopefully" those events fail as well, so we could see something in the logs or better see what is missing.

Regards,

Thomas E.-E.


--
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.

Sam

unread,
Mar 13, 2013, 6:25:10 AM3/13/13
to ope...@googlegroups.com
My mistake, I had a copy/paste error in one of my events, resulting in switching off items without that I knew it. I have now about a dozen gCal events per day switching on and off without issues.
FYI, I created a second Google Calendar (not linked to openhab) to store events that are temporarily disabled (call it "Openhab disabled). This way you can disable certain (e.g. seasonal) events by just moving to the disabled calendar but not loose any details (times, conditions etc). If you choose a lighter color, and display both calendars in your calendar viewer, you get a nice overview of all your events, enabled and disabled.

Ángel Bueno Pardo

unread,
Mar 13, 2013, 6:31:23 AM3/13/13
to ope...@googlegroups.com
Good news Sam!

about the second calendar, has you ever try the parameter q in the URL? from the wiki: "Please enhance the calendar URL with the query parameter "q" with the fulltext to be searched in the events"

You can change the name of the location to openHAB on the items you want to be controlled by openHAB.

Best regards


2013/3/13 Sam <samc...@hotmail.com>
My mistake, I had a copy/paste error in one of my events, resulting in switching off items without that I knew it. I have now about a dozen gCal events per day switching on and off without issues.
FYI, I created a second Google Calendar (not linked to openhab) to store events that are temporarily disabled (call it "Openhab disabled). This way you can disable certain (e.g. seasonal) events by just moving to the disabled calendar but not loose any details (times, conditions etc). If you choose a lighter color, and display both calendars in your calendar viewer, you get a nice overview of all your events, enabled and disabled.

--
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/XOnvbuFJYT8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

Thomas Eichstädt-Engelen

unread,
Mar 20, 2013, 4:24:34 PM3/20/13
to ope...@googlegroups.com
+1 good to know that it works now :-)

Using the 'q' parameter is a really clever idea haven't thought about it yet ...



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.

wind...@gmail.com

unread,
Aug 10, 2014, 1:49:02 PM8/10/14
to ope...@googlegroups.com
Hello folks,

I'm new to OpenHAB and I'm using version 1.5.0.
I had the same bug you've described (the calender is loaded but not executed)
The workaround did well.
Is this bug still not fixed?

Christian
Reply all
Reply to author
Forward
0 new messages