TellstickController modified for Google Calendar

Finally. As promised, here are the details about my Google Calendar controlled home automation 🙂

Quite some time ago, I bought the tellstick to automate the lights at home. I was fed up with walking around the house every night to turn the lamps off in the various rooms and windows. At the same time I also bought some Nexa remote power controllers to have it all work together from start.

Now, I had to choose the software to use for the setup. As I already had a Linux server running 24/7 one of the requirements was that it should run on that platform. And preferably controllable by something else than just a graphical interface. If I also could control everything from my smartphone it would be great.

So, something controlled from the command line that could be scripted to work with the web too, and I would be set. After testing a few different solutions I found that TellstickController would work best. And in top of that put the mobile adopted interface Tellit (The developers URL no longer work) to control things manually (when needed) from my Android phone webbrowser.

After a while, although very used to it, I found scheduling the lights and outlets through the configuration file on the server was not the best solution. Doing that from the phone worked, but far from good. And I did not want to add scheduling to the web interface. As we use Google calendar to plan the life of our family, I thought it would be nice if we could control the lights with it too. So. I started to look at the gcal API and modify the TellstickController code.

Pretty soon I had a solution. I can now add my lights as ”meetings” in my dedicated Tellstick calendar. If I want to use random timings, sunrise, sunset or offsets I can do that with some simple text entries for the ”meeting”. And i can do it from any computer, or even the native Google calendar application on my phone!

Lamor och motorvärmare styrda via Google Calendar

Lights and car engine heater controlled via Google Calendar

Scheduled light with random offsets

Scheduled light with random and sunrise offsets

Next step is to add some code to allow controlling outlets depending on the temperature outside. Or in any location my server is already measuring the temperature in and around our house with 1-wire sensors. For example, turn the car  engine heater on one hour earlier if it is colder than usual one day. Or not at all even if It is scheduled, if it is too warm. Or powering up the heating cable on the water pipes in the garage when the temperature reaches freezing. Or… whatever you can think of 😉

And here is the modified tellstickController perl script and an example config with instructions on how to find the private gcal XML URL you need to set.


3 svar

  1. strankan skriver:

    This looks awesome! Thank’s for the tip. Definitely gonna try this out tonight.

  2. Markus skriver:

    Detta var fräckt och en väldigt bra idé. Tack för det!

    Har laddat ned och testar lite smått. Funderar lite på hur du läser in de ändringar som görs i Google Calendar, kör du skriptet var x minut eller finns det något snyggare sätt? 🙂

    • Thomas skriver:

      Scriptet var från början skapat för att manuellt ladda om konfigurationen har jag för mig. Jag ändrade till att automatiskt ladda om den efter midnatt varje dag, och när jag stoppade in gcal så läser jag även in den då konfen laddas om. Så för tillfället läses det in en gång per dygn bara. För mina ändamål räcker det fint för det mesta. Utom när jag vid 0130-tiden kommer på att jag ska slå på motorvärmaren på följande söndagmorgon 😉

Kommentera gärna