Showing posts with label schedule. Show all posts
Showing posts with label schedule. 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.

Thursday, January 28, 2010

DZ 3.4.1 "Scheduler-Console" Release Is Out

Changes since 3.4

  • Current period is now displayed at the console;
  • If the settings for a zone were altered against those specified for the period, a visible mark appears;
  • Pressing 'S' will make the system follow the schedule again.

Configuration Changes Necessary

Scheduler bean needs to be injected into the console bean, just like other elements - see configuration guide for details.

A telltale sign that you forgot to do that would be absence of period information displayed despite scheduler working normally (can be verified by logs and charts generated).

Early Access: Period Display and "Back to Schedule"

Subversion contains code that allows to display the currently running period on the console. Also, pressing 'S' will now revert thermostat settings back to current period settings if they were altered (and there's a visible indicator for that, too).

Tuesday, January 26, 2010

DZ 3.4 "Scheduler-Barebones" Release Is Out

Changes since 3.3.2

Ability to change thermostat settings based on a schedule. Following settings can be changed:
No user interface is provided, the schedule can be set via configuration file only and cannot be changed during runtime - the focus of this release is to provide a stable and usable feature. Correctness of scheduler operation can for now be verified with data loggers - see configuration guide for details.

And this is how to configure the schedule for now:



The next major release will provide scheduling functionality with Google Calendar being the user interface. Details are described in FAQ: How Schedule Periods Work. Functionality provided by this release will be used as a bootstrap, default or fallback implementation.

* This feature is configurable, but not yet activated

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.

Wednesday, January 20, 2010

Early Access: Scheduler

Subversion contains code that allows to change zone settings based on schedule. If you can read source code (dz3-scheduler is the module to look at) and configure a Spring IoC container, you will have no trouble utilizing it.

Test cases will give you a good idea how to put a schedule together.

Saturday, August 4, 2007

Google Calendar as external scheduler for DZ???

Just thinking aloud - would using Google Calendar API be a gross overkill or actually a smart idea?

Let me see...

  • Unlimited number of zones supported...
  • Unlimited number of periods scheduled...
  • Arbitrarily flexible scheduling - you want 5+2? We have it. You want 5+1+1? We have it. You want 7-Day? we have it, too.
  • Accessible from Internet...
  • Accessible from your mobile phone...
  • Relatively nice and user friendly user interface...
  • They even work on improving it while you sleep...
Actually, this may not be such a bad idea at all.