Monday, 12 May 2014

Ultimate outdoor light (with Arduino)


Coming home to a house with the outdoor lights on is much nicer than coming home to a dark house. With a bit of scripting it was possible to automate the outside lights to follow this logic,

 - if it's 30 minutes after sunset, and at least one person is not home, then turn the lights on.
 - if it's after sunset and everyone is home then turn the lights off.
 - if the lights have been manually turned on, leave them on (i.e. guests are expected).

Sunset & Sunrise times.
An easy way to get sunset/sunrise times is from wundermap. You'll need to register (for free) to get an api key, once done you can get current conditions, forecasts, astronomy info etc. The following will download theastronomy json file for Sydney. Put this in a crontab and download it once a day.
 curl http://api.wunderground.com/api/<your_api_key_here>/astronomy/q/Australia/Sydney.json >astro.json

A simple parser can then pull out the hour and minute for sunset and sunrise.

Presence.
Presence is a common issue in home automation systems, i.e. knowing who is home (or even who is in each room). To deduce who is home I used a simple cheat - ping everyones mobile phone on the wifi and see which respond. If the mobile doesn't respond we'll assume the person is out. Of course this assumes the mobile hasn't just gone flat, been lost or had the wifi turned off. 
 

Thursday, 8 May 2014

CBUS programming


Being a little technical I programmed the CBUS system myself. This is when you learn the true age (sorry maturity) of the product. To learn the programming I first made a test bench with some of the units wired to a switch and a motion senor. Whilst the documentation is thorough a test bench was invaluable to learning how to program the units and use some of the logic within the units.
 For example some interesting logic can be applied to link a motion sensor to a light switch. The end result is that the light only turns on when both the light switch is on and the motion sensor detects motions. When the motion detector times out (after a configurable amount of time) the llight switches off, even though the light switch is still on.

 

Thursday, 12 December 2013

CBUS fit out




For our home automation system we went with CBUS. This is a mature product and is used as much if not more in the commercial space as in residential. It's main attraction is that it's very well known in the industry and is bullet proof.
 Installing a wired cbus solution (as opposed to wireless cbus) really needs to be done at build time. Each light, fan, GPO is wired back to a central switchboard. In the switchboard are the relays/dimmers/fan controllers.
 In the picutre below you can also see the cbus pink cable. This is the data cable that links all cbus units. It's basically cat5 with a mains rated insulation on it. Note that the protocol is not TCP/IP, it's proprietary CBUS. So don't try plugging it in to your router!
  It runs around the house to every light switch, sensor etc. The pink cable can be wired in any topology, i.e. a straight run, star or any combination (it can't however form a loop).



Three relay unit (each unit has 12 relays) and three ceiling fan controllers. Each ceiling fan controller does three speeds and add some intelligence - more later).