-
Notifications
You must be signed in to change notification settings - Fork 0
GCal Binding
Note that the current state of the binding in unclear. The documentation at the end refers to the Google API change in November 2014 and also links to repo describing how to implement a temp fix. However the binding included in the main distribution has not been updated.
There is an alternative binding using CalDAV.
An alternative method to schedule events is to setup the my.openHAB binding and use the openHAB/Google Calendar channels on IFTTT to trigger openHAB.
If you want to administer events in Google Calendar that will be executed by openHAB this bundle will do the job. See the following sections on how to configure the necessary data and how to obtain the GCal URL.
The event title can be anything and the event description will have the commands to execute.
The format of Calendar event description is simple and looks like this:
start {
send|update <item> <state>
}
end {
send|update <item> <state>
}
or just
send|update <item> <state>
The commands in the start
section will be executed at the event start time and the end
section at the event end time. If these sections are not present, the commands will be executed at the event start time.
As a result, your lines in a Calendar event might look like this:
start {
send Light_Garden ON
send Pump_Garden ON
}
end {
send Light_Garden OFF
send Pump_Garden OFF
}
or just
send Light_Garden ON
send Pump_Garden ON
openHAB must be configured with your google calendar of choice. The URL has to be configured in your openhab.cfg. The following cases are supported:
- URL, username, password (Calendar Address)
- URL (Private Address)
Alternative 1: To obtain the google calendar URL using username/password
- fill in gcal:url gcal:username, gcal:password in openhab.cfg
- login in to https://www.google.com/calendar/
- click "Settings" (under "My calendars") -> <your calendar>
- find the calendar URL in in heading "Calendar Address" -> "XML". The URL for will be something like this:
https://www.google.com/calendar/feeds/[email protected]/public/basic
- copy the given url and replace "basic" with "full". Note: if you want to write entries to your calendar (via gcal persistence for example), "public" must also be replaced with "private".
The final URL should be similar to:
https://www.google.com/calendar/feeds/[email protected]/private/full
Google added a new security feature which needs to be disabled for this method to work. Go to https://www.google.com/settings/security/lesssecureapps and allow access for less secure apps.
Alternative 2: To obtain the google calendar URL without password (only for reading !!):
- only gcal:url should be used in openhab.cfg
- login in to https://www.google.com/calendar/
- click "Settings" (under "My calendars") -> <your calendar>
- find the calendar URL in in heading "Private Address" -> "XML". The URL for will be something like this:
https://www.google.com/calendar/feeds/[email protected]/private-da2412ef24124f151214deedbeef1234/basic
- copy the given url and replace "basic" with "full".
The final URL should be similar to:
https://www.google.com/calendar/feeds/[email protected]/private-da2412ef24124f151214deedbeef1234/full
The GCal persistence bundle can be used to realize a simple but effective Presence Simulation feature (thanks Ralf for providing the concept). Every single change of an item that belongs to a certain group is posted as new calendar entry in the future. By default each entry is posted with an offset of 14 days (If you'd like to change the offset please change the parameter gcal-persistence:offset
in your openhab.cfg
). Each calendar entry looks like the following:
- title:
[PresenceSimulation] <itemname>
- content:
> if (PresenceSimulation.state == ON) sendCommand(<itemname>,<value>)
To make use of the Presence Simulation you have to walk through these configuration steps:
- make sure that you are using the correct openHAB release (at least 1.0.0-SNAPSHOT)
- configure the gcal-persistence bundle by adding the appropriate configuration in your
openhab.cfg
. All entries start withgcal-persistence
. You must at least add the username, password and url. Get the url using the 'alternative 1' method. The url must end with "/private/full". - make sure your items file contains items that belong to the group
PresenceSimulationGroup
- if you would like to change the group name change it atgcal.persist
. - make sure your items file contains an item called
PresenceSimulation
which is referred by the scripts executed at a certain point in time - if you would like to change the group name please change the parametergcal-persistence:executescript
in your openhab.cfg`. - make sure the referenced gcal calendar is writeable by the given user (google calendar website)
Note: you also need to configure the gcal-io binding (Google Calendar Configuration in 'openhab.cfg') to be able to read the entries from the calendar and act on it!
To activate the Presence Simulation simply set PresenceSimulation
to ON
and the already downloaded events are being executed. Your smartHome behaves like you did 14 days ago.
A sample gcal.persist
file looks like this:
Strategies {
default = everyChange
}
Items {
PresenceSimulationGroup* : strategy = everyChange
}
To solve any issues with any binding, increase the logging. For gcal, add these lines to your 'logback.xml'
<logger name="org.openhab.persistence.gcal" level="TRACE" />
<logger name="org.openhab.io.gcal" level="TRACE" />
-
"GCal PresenceSimulation Service isn't initialized properly! No entries will be uploaded to your Google Calendar"
The persistence configuration is not correct; username, password and url are required. Configuration entries must be prefixed by
gcal-persistence:
. -
"creating a new calendar entry throws an exception: Forbidden"
This can have several causes:
-
The username/password might not be correct
-
The url is not correct. Get the url from your calendar settings, in the 'calendar details' at the 'Calendar Address'. Get the XML url. Always use 'https'. Make sure the url ends with "/private/full".
-
If your not using your own calendar, make sure the sharing settings are correct and the user has sufficient rights to create calendar entries.
-
Since the 17th of November Google has introduced API 3.0 which needs a modified authentication procedure. If you want to use this binding, use the instruction given in the google groups thread: https://groups.google.com/forum/#!searchin/openhab/google/openhab/LbqKLEdlDCk/FUy-Q1oNTEEJ
Also, see here for a step-by-step list to enable the Calendar again: https://github.com/fmoor/gcal-fix-openhab#gcal-fix-openhab
###Linux / OS X
###Windows
- Cosm Persistence
- db4o Persistence
- Exec Persistence
- InfluxDB Persistence
- JDBC Persistence
- JPA Persistence
- Logging Persistence
- mapdb Persistence
- MongoDB Persistence
- MQTT Persistence
- my.openHAB Persistence
- MySQL Persistence
- rrd4j Persistence
- Sen.Se Persistence
- SiteWhere Persistence
- AlarmDecoder Binding
- Anel Binding
- Arduino SmartHome Souliss Binding
- Asterisk Binding
- Astro Binding
- Autelis Pool Control Binding
- BenQ Projector Binding
- Bluetooth Binding
- Bticino Binding
- CalDAV Binding
- Comfo Air Binding
- Config Admin Binding
- CUL Binding
- CUL Intertechno Binding
- CUPS Binding
- DAIKIN Binding
- Davis Binding
- Denon Binding
- digitalSTROM Binding
- DMX512 Binding
- DSC Alarm Binding
- DSMR Binding
- eBUS Binding
- Ecobee Binding
- EDS OWSever Binding
- eKey Binding
- Energenie Binding
- EnOcean Binding
- Enphase Energy Binding
- Epson Projector Binding
- Exec Binding
- Freebox Binding
- Freeswitch Binding
- Frontier Silicon Radio Binding
- Fritz AHA Binding
- Fritz!Box Binding
- FS20 Binding
- Global Cache IR Binding
- GPIO Binding
- HAI/Leviton OmniLink Binding
- HDAnywhere Binding
- Heatmiser Binding
- Homematic / Homegear Binding
- HTTP Binding
- IEC 62056-21 Binding
- IHC / ELKO Binding
- ImperiHome Binding
- Insteon Hub Binding
- Insteon PLM Binding
- IPX800 Binding
- IRtrans Binding
- jointSPACE-Binding
- KNX Binding
- Koubachi Binding
- LCN Binding
- LightwaveRF Binding
- Leviton/HAI Omnilink Binding
- Lg TV Binding
- Logitech Harmony Hub
- MailControl Binding
- MAX!Cube-Binding
- MAX! CUL Binding
- MiLight Binding
- MiOS Binding
- Modbus TCP Binding
- MPD Binding
- MQTT Binding
- MQTTitude binding
- Neohub Binding
- Nest Binding
- Netatmo Binding
- Network Health Binding
- Network UPS Tools Binding
- Nibe Heatpump Binding
- Nikobus Binding
- Novelan/Luxtronic Heatpump Binding
- NTP Binding
- One-Wire Binding
- Onkyo AV Receiver Binding
- Open Energy Monitor Binding
- OpenPaths presence detection binding
- OpenSprinkler Binding
- OSGi Configuration Admin Binding
- Panasonic TV Bindung
- panStamp Binding
- Philips Hue Binding
- Piface Binding
- pilight Binding
- Pioneer-AVR-Binding
- Plex Binding
- Plugwise Binding
- PLCBus Binding
- Primare Binding
- Pulseaudio Binding
- RFXCOM Binding
- RWE Smarthome Binding
- Sager WeatherCaster Binding
- Samsung AC Binding
- Samsung TV Binding
- Serial Binding
- Sallegra Binding
- Satel Alarm Binding
- Sinthesi Sapp Binding
- Snmp Binding
- Somfy URTSI II Binding
- Sonos Binding
- Squeezebox Binding
- Swegon ventilation Binding
- System Info Binding
- TA CMI Binding
- TCP/UDP Binding
- Tellstick Binding
- TinkerForge Binding
- Tivo Binding
- VDR Binding
- Velleman-K8055-Binding
- Wago Binding
- Wake-on-LAN Binding
- Waterkotte EcoTouch Heatpump Binding
- Weather Binding
- Wemo Binding
- Withings Binding
- XBMC Binding
- xPL Binding
- Yamahareceiver Binding
- Zibase Binding
- Z-Wave Binding
- Asterisk
- Google Calendar
- Linux Media Players
- ROS Robot Operating System
- Telldus Tellstick
- Zoneminder
- Wink Hub (rooted)
- Wink Monitoring
- Transformations
- XSLT
- JSON
- REST-API
- Security
- Service Discovery
- Voice Control
- BritishGasHive-Using-Ruby
- Dropbox Bundle
A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.
Please update the wiki if you do come across any out of date information.
- Comfo Air Binding
- Ecobee Examples
- Nest Examples
- Rollershutter Bindings
- Squeezebox
- WAC Binding
- WebSolarLog
- Alarm Clock
- Convert Farenheit to Celcius
- The mother of all lighting rules
- Reusable Rules via Functions
- Combining different Items
- Items, Rules and more Examples of a SmartHome
- Google Map
- Controlling openHAB with Android
- Usecase examples
- B-Control Manager
- Spell checking for foreign languages
- Flic via Tasker
- Chromecast via castnow