Automating household devices with Google Calendar

[Shane] is building a new house and wants some, “subtle home automation” as he calls it. His first project is hooking up a small heater to the Internet, and judging from his demo video everything is going swimmingly.

[Shane]‘s project is built around an mbed microcontroller that connects to the Internet via an Ethernet connection. The mbed has a temperature controller and a solid state relay to turn the heater on an off; simple enough, but we really like how easily [Shane] connected his project to Google Calendar.

After looking over the Google API, [Shane] was understandably overwhelmed. He figured out that by syncing the mbed’s clock to network time and sending a GET request for one minute in the future, the mbed would always know what was scheduled with a minimal delay.

Now, all [Shane] does to turn on his heater is schedule a time and temperature in Google Calendar. He can do this from across the globe or country and makes for a really slick part of a home automation system.

Comments

  1. jukus says:

    I really enjoy the simplicity of the user interaction for this

  2. jamen lang says:

    I would love to see the code he used for this, I use gcal that runs a cronjob to control my sprinkler system, I’d like to get it all running off of a microcontroller at some point, but I’m logging everything to a database and doing other things like checking temperature/forecast to see if it’s going to rain tomorrow as well. So I guess I’ll put that on the backburner.

    • fightcube says:

      Really good idea… wish I had a sprinkler system as well.

    • Shane says:

      Hey Jamen,

      I’ll post the code on the the blog in the next day or so, just need to tidy it up.

      Re: your sprinkler idea, I’ve already got an mbed doing this. It checks the forecasts and the local rainfall (from a neighbour’s web connected weather station up the road) and determines how long to run the sprinklers for. I was going to write that one up and submit it next week. Race ya! ;)
      One thing I wanted to add was to delay a watering if the wind speed is too high because it gets very windy here and the other day it turned on and washed my car rather than watered the garden.

      :)

  3. fosselius says:

    “He figured out that by syncing the mbed’s clock to network time and sending a GET request for one minute in the future”

    That sounds “optimal”.. 1h buffer?

    • Shane says:

      2 reasons why I poll the API every 30 seconds rather than buffering it in blocks:
      1. I’m not a very good C programmer and this way is easier
      2. I wanted it to respond to changes of the temperature and schedule immediately.

  4. i really want to look at the code of this, i have a cortex-m4 development board with WLAN and Ethernet on it so i can do so many things with this board n google!
    please share the code.

  5. dopey says:

    I love the project, but this sadly falls into the category of ‘cloud based misadventure’ when it goes pear-shaped.

    Client-Server and Socket based remoting have been around for years, but are still dependent on the hosts lawyers, and the guy that fixes your cable or telephone jack for it’s reliability. Not where I’d be putting all my eggs.

    P.S I do the same thing – using an extra calendar on my Outlook client.

    For non-critical activities – like watering the garden on odd occasions or filling the dog bowl for a couple of days – fine, but remember the fundamentals behind ‘CLOUD’ ase ‘Centralized Lock On User Data’… and ‘SOCKETS’… ‘Some Other Controller Knows Every Thing Said’…

  6. Shane says:
  7. simonvpe says:

    I got inspired by this and made a google calendar based task scheduler. I published the source code on my webpage. Check it out @ http://simonslinuxworld.blogspot.se/2012/04/google-command-line-tools-google.html

    Simon

  8. crabbypup says:

    very cool – i just started work on my arduino based home automation system, though when i get around to the task scheduling i’ll probably have my automation server look at a local whole house email/calendar server instead of the cloud. I love using google services, but having the schedule for everything that happens in my house accessible to google staff is not exactly something i’d want.

  9. eKatSS says:

    I stumbled on this article while looking how to query Google Calendar for a heater too. Very happy I found this. At least I’m not the only one who had that idea. Good job Shane!

  10. Yibin Zhang says:

    I’m really curious how you did this; I’m trying to do something similar with an Arduino…could you give me some leads?

  11. gipz says:

    Hello Shane,
    I am doin the same project on ARM CORTEX M3. Can I use the code done by you.Its really urgent for me.What about the header(.h) files. Expecting a favour from you.Please help me go through my final year project.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,731 other followers