Version 2 (modified by utz, 12 years ago) (diff)

--

Google Calendar Plugin

Overview

The plugin is a simple switch (similar to a motion detector) which uses a Google Calendar as input. The plugin will check periodically if an event with a particular name is active in the calendar. If such event is currently active the plugin will go to state tripped=1, if not then tripped=0. In addition a variable is set that can be additionally specified in the event and may be used in a scene.

For example, I control my central heating that way. I specify in Google Calendar events throughout the day that are called HEATING_ON. When an event with such name is present the scene running the heating is triggered. I can also specify an event in the form of HEATING_ON{20}. In this case the 20 is extracted and stored in a variable. I use the 20 to override the temperature set-point of the heating (it now will heat to 20 degree and not use the set-point of the room thermostat). Other options would be to use events such as LIGHT_ON or ALARM_ON which could be specified in the same calendar that several instances of the plugin use.

How it works

The plugin periodically (period defined in I_GCAl.xml in UPDATE_FREQU with 5min as a reasonable value) contacts a google calendar and requests all calendar events in a window of UPDATE_FREQU. Google Calendar returns all active events in this period as a JSON output. In that output I look for a keyword defined in the control tab of the plugin (I do not parse the JSON properly, it is just a pattern matching in the output for the keyword). If the keyword is found the plugin goes to the state Tripped.

Install

  • Get a Google account and setup a calendar. You may want to create a separate calendar instance for the home automation stuff.
  • Click on calendar settings and then click on the XML button at "Private Address". You will now see a link that vera will use as a pointer to access the calendar. Copy this link and change at the start https to http (have not figured out yet how to use https).
  • Click on the device you created. In the control tab there will be 2 boxes. In the first one you have to insert the link to the calendar (The box is a bit small but it works). Then press set. In the second box you enter the event name you want to use (e.g. HEATING_ON). Then press set.
  • You can use the button "check" to see if events in the calendar are picked up. Otherwise the plugin will check every 5min (this value can be configured).

More detailed installation steps can be found here: http://forum.micasaverde.com/index.php/topic,7558.0.html