Version 5 (modified by psykokwak, 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 or without a particular name will be active in a near futur in the calendar. When the calendar event starts 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. You also can set no keyword. In this case the switch will trigger on every calendar event whatever the name. (It could be usefull for public calendar like "public holidays")
How it works
The plugin periodically contacts a google calendar and requests all calendar events in a window of "gcalinterval" seconds. Google Calendar returns all active events in this period as a JSON output. In that output it looks for the next event eventually that has "keyword" as name defined in the control tab of the plugin. If there is a such event, the plugin waits until the event starts and triggers to 1. When the event finishes, trigger returns to 0.
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. You can also do this manipulation for a public calendar.
- Two ways :
- You can install the plugin directly from the Mios Market : Google calendar plugin
- Install the following files on vera and create a device using D_GCal.xml. Put all files into /etc/cmh-ludl/ directory except "json.lua" which goes into /usr/lib/lua/ directory.
- 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 leave this box empty to catch all events whatever the name.
- You can use the button "check" to see if events in the calendar are picked up. Otherwise the plugin will check every "gcalinterval" seconds (this value can be configured).
More detailed installation steps and exemples can be found here: http://forum.micasaverde.com/index.php/topic,7558.msg74154.html#msg74154