Showing posts with label Google Calendar. Show all posts
Showing posts with label Google Calendar. Show all posts

Monday, March 16, 2015

Reminder: remove calendar stored credentials when switching HVAC modes

If you've just switched from heating to cooling (or the other way around for those down under), the first run of the system will use the calendar credentials stored by Google calendar client library in ${HOME}/.dz/calendar/StoredCredential, and your system will try to use the wrong schedule (that is, if you followed our advice and are using two different calendars for heating and cooling).

Just move that file away, or remove it altogether - DZ will present the credentials screen next time the calendar needs to be consulted.

Monday, November 17, 2014

Early Access: Google Calendar API v3 Integration

Google shut down Calendar API v2 and v1 today, replaced by v3. v3 is not a drop-in replacement for earlier versions, changes are required.

BEFORE

You specify credentials either as a part of configuration (permanently), or via JMX (after server startup).

NOW

First time, DZ starts an external browser with OAuth callback URL, you choose credentials to use, grant the permission to use them, DZ stores the token (not credentials) until it expires. Afterwards, calendar updater reads the token and proceeds without requiring a browser.

CODE CHANGES

Get the current version from Github. Release will be following shortly.

CONFIGURATION CHANGES

You need to remove credentials from the configuration.

BEHAVIOR CHANGES

The only change you should notice is how to make DZ understand that you want to change the account associated with the calendar. Remove ${HOME}/.dz/calendar/StoredCredential file to make DZ request authentication again.

Friday, February 12, 2010

FAQ: Getting Google Calendar Dependencies

In order to successfully build dz3-scheduler-gcal, you need some extra dependencies, and in order to run it, you need some more (both come from gdata-java-client library). Following are the steps to make them available (implies wget(1) installed on your system):

cd /tmp && \
wget http://gdata-java-client.googlecode.com/files/gdata-src.java-1.40.2.zip && \
cd /usr/local/src && \
unzip /tmp/gdata-src.java-1.40.2.zip
The /usr/local/src location is hardcoded into dz3-scheduler-gcal/pom.xml, change it if it doesn't work for you.

1.40.2 was the latest version available at the time the development of dz3-schedule-gcal was finalized, feel free to replace it with the latest available - but make sure individual dependency version numbers match.

Why So Ugly?

Because gdata-java-client hasn't been made available to the Maven Central Repository yet.

If you want to make it happen and know how to do it, please do so. If you find out that dependencies in question are already in the central repository by the time you read this, please let me know.

Thursday, February 4, 2010

DZ 3.5.1 Release Is Out

Changes since 3.5

Fixed a bug in Google Calendar Schedule Updater causing period times not ending on the hour mark improperly calculated.

There are no other changes, you don't need to bother if you're not using Google Calendar schedule integration.

Monday, February 1, 2010

Early Access: Google Calendar Integration

Subversion contains code that allows to pull your schedule off your Google or Google Apps calendar.

As usual, if you can read source code (dz3-scheduler-gcal is the module to look at) and configure a Spring IoC container, you will have no trouble utilizing it.

Put Your Tinfoil Hat Away

For the paranoid out there: you don't have to write your precious authentication credentials into the configuration in plaintext - you can skip them from the configuration altogether and provide them to the runtime environment via JMX.

Saturday, January 30, 2010

Coming Up: Calendar Integration

You could see some pretty definite hints here, now it's coming to life. So, what exactly is it?

Generic Schedule Updater

ScheduleUpdater interface in dz3-scheduler module provides the interface, and AbstractScheduleUpdater provides the most generic baseline for implementing any back end integration. Want to store your schedule in a flat file? Be my guest. Want to read it off IRC? Anytime.

The updater is injected into the scheduler, so you're pretty much free in what and how you do it. That is, in case if you're not happy with the concrete implementation that will be a part of the release.

Google Calendar Integration

Just like it was planned, DZ will read the schedule from the the calendar of the account of your choice. Both Google and Google Apps accounts are supported, as well as pulling schedule details off any public calendars that you've subscribed to. Basic connectivity has already been implemented, details will be ironed out between now and next release.

Friday, January 22, 2010

FAQ: How Schedule Periods Work

(IMPORTANT: Google calendar has a bug which makes all "forever" recurring events to last for just two years. If the calendar looks empty, scroll the example back to November 2017 to see the actual complex schedule breakdown).

Period scheduling already looks very similar to what is displayed below, and it will look even more like so as wrinkles are ironed out:



Clicking on the calendar button will request to add this calendar to your list of calendars (if you already have a Google account and are logged in) , or present you with Google authentication page. Adding a calendar is a reversible action - you can always remove it later (go to Settings/Calendars and click on Unsubscribe).

The only benefit of adding the calendar to your list is a nice full screen view of the schedule.

In any case, don't forget to click on individual event descriptions to find out how things work (this doesn't require being logged in). Note that the embedded view is scrollable.

Keep in mind that the link is live, and the content will change as details are sorted out.

At this point it is expected that each zone will have its own calendar, to reduce clutter. Moreover, it is currently expected that cooling and heating schedules will be represented by two sets of calendars, with the same purpose - you can easily select and deselect individual calendars, but it'll be a mess if you have more than one set of settings in the same calendar.