[SOLVED] Setting up GCAL

is there a way to setup a calander for triggering rules/events on special days like christmas , birthdays

so i could setup a calander for kids school holidays and work holidays ect

Yes. See the CalDav binding.

Looks complicated will have a read through there see if a can get it up and running thanks namraccr

You also could try the Google Calendar Scheduler (gcal) binding. It’s under the Misc category in Paper UI.

Documentation is here.
http://docs.openhab.org/addons/ios/gcal/readme.html

1 Like

The Google one looks easyer to get up and running thanks for that

Sure. One thing I find helpful is to create a separate calendar for my OH stuff, which keeps it separate from my default calendar.

I agree with you I don’t want OH accessing my main email anyway for security concerns

I made a proposal that may get your interest, it’s not merged but maybe you shall give it a try : https://github.com/openhab/openhab2-addons/pull/2728

I have followed the docs that you sent too me
installed the binding, got an client ID and Secret ,Filled in the text file , followed instructions from log:tail and authorised,

I received an error , what next how can i see whats working and whats not ?

2018-02-15 19:36:24.944 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been started
2018-02-15 19:36:24.947 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for everybody: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal
2018-02-15 19:36:24.947 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for owner: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal
2018-02-15 19:36:25.297 [ERROR] [openhab.io.gcal.auth.GCalGoogleOAuth] - authentication I/O exception: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "Project ######### is not found and cannot be used for API calls. If it is recently created, enable Calendar API by visiting https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=############ then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "reason" : "accessNotConfigured",
    "extendedHelp" : "https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=###########"
  } ],
  "message" : "Project ########## is not found and cannot be used for API calls. If it is recently created, enable Calendar API by visiting https://console.developers.google.com/apis/api/calendar.googleapis.com/overview?project=######### then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."

Following the link google says “The API “calendar.googleapis.com” doesn’t exist or you don’t have permission to access it”

I have hashed out some numbers as it contained secret ID

i have no experience using an API so at the moment i havent a clue whats wrong any pointers?

@Sharpy

2018-02-15 19:36:24.947 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for everybody: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal
2018-02-15 19:36:24.947 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for owner: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal

I’m not too familiar with running openHAB on Windows (actually, I’m not familiar with it at all), but those two lines would seem to suggest a permissions problem creating and/or accessing the directory that contains the authorization token.

Sorry I can’t be much more help than that. On Linux, the gcal directory is owned by the openhab user and has permissions 700. I’m just not sure how that translates to the Windows world.

i think i solved that problem by running the start.bat as admin there is a gcal token in the folder it listed

i just don’t think its working as i don’t have access too the calander api

im not sure what to do or how to troubleshoot like i say this is my first experience using an api

Ok, but I’m a little confused. Are you not getting those warnings anymore?

i only saw those errors once after setup when i followed the link the error gave to enable the api google said i don’t have permission or the api doesen’t exist i tried creating a test event on the calendar nothing happened so assumed its not working

i’m not sure how too test whats working and whats not is there a place too check if OH has pulled any info from calendar

You can try putting the gcal binding into DEBUG or TRACE mode to see if it logs anything that helps pinpoint where the problem might be.

I didn’t know how too set it in debug for gcal found it in another post by you just running debug now

Good reading here.
https://docs.openhab.org/administration/console.html

You might also want to stop/start the gcal binding to see what it logs when it starts up.

sorry how do you restart the binding iv never used that command is it bundle:stop

i ran debug didnt find much will restart

Yep

bundle:stop org.openhab.io.gcal

and

bundle:start org.openhab.io.gcal
openhab> bundle:stop org.openhab.io.gcal
Error executing command: No matching bundles

same for bundle:start

i did installed the binding (just checked binding uninstalled) weird

[EDIT]

12:40:43.975 [INFO ] [b.core.service.AbstractActiveService] - Google Calendar Event Downloader has been started
12:40:43.978 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for everybody: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal
12:40:43.978 [WARN ] [ient.util.store.FileDataStoreFactory] - unable to change permissions for owner: C:\Program Files (x86)\openhab-2.1.0\userdata\gcal
12:40:43.979 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Loaded credential
12:40:43.979 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - device expires_in: 1518726985089
12:40:44.649 [DEBUG] [openhab.io.gcal.auth.GCalGoogleOAuth] - Got calendar primary CalendarID: s1@gmail.com
12:40:44.649 [DEBUG] [io.gcal.internal.GCalEventDownloader] - Downloading calendar feed for time interval: 2018-02-16T12:40:44.649Z to  2018-02-16T13:10:44.649Z```