My Automation Software

As usual, I don’t really want to use an off-the-shelf automation package (like Mister House, Homeseer) – I can’t believe they’ll be as flexible as I’d like them to be, without having to write a lot of perl (in Mister House’s case) or buying the full version (in Homeseer’s case).  So, I’m in the process of writing my own.

Requirements:

  1. Listen to events from home easy devices (primarily motion detectors and for a less automated approach, the remote control)
  2. Listen to sensors (temperature, power consumption)
  3. Listen for other events (number of unread emails, bad traffic, bad weather)
  4. Perform an action based on an easily changeable sequence of these, where each step can say how long it is prepared to wait for the next step to be fired before having to restart the sequence.
  5. Run events on a scheduled basis.
  6. Web interface that performs reasonably running on slow hardware (MPC-L)
  7. Server also running on slow hardware.

A couple of examples:

Central heating – simplest idea for this is to only turn on the heating if the house has had movement in the last hour and the temperature is below a threshold.  No point turning heating on when we’re no in.  Should turn off as soon as the desired temperature is reached, or at a set time (don’t want to heat the house when we’re asleep).  Little more complicated is saying “I want the house to be at this temperature at this time, so turn the heating on in advance, according to the current temperature, to give it enough time to heat the house up”.

Ambient lights – can show the power consumption, so green is good, amber ok and red bad.  As it’ll be in my bedroom, I only want it on between 8am – 11pm – except if there’s a stupid amount of power been drawn, then I want it on whatever the time (i.e. someone’s left the oven/iron on).  Would also like it to flash if I’ve got unread emails.  Finally, it could show the weather, traffic or a combination (possibly controlled by the home easy remote).  Will probably have a couple dotted around the house.

Communications

MQTT seems perfect for this, especially as Nicholas O’Leary has written a client for the official ethernet shield for arduinos (shame I’ve currenlty got a nuelectronics one – official one on order).  It also means I can easily fake events while developing the software by using the provided java sample program.  Sadly, I’m not made of money, and while I have wired most of my house with CAT5, it doesn’t reach everywhere – so, given I can send and receive home easy messages via the AM transmitters/receivers, I’ll use them to communicate between devices that don’t have ethernet (i.e. gas meter outside).  Just so I don’t waste the nuelectronics shield, I’ve got a “web relay” that listens to topics, and sends messages via the ethernet to the nuelectronics shield.  Obviously the server will listen to everything and send messages appropriately.  Things like email counting will be done via random other java programs that’ll just send a message to the specified topic.

So, the primary arduino will have the official ethernet shield, an AM transmitter and a receiver attached.  One other arduino will have the nuelectronics one on (as I’ve got it already) and the rest will just have AM transmitters/receivers.

Current state:

Looking good! Scheduled events are working, sequences of events work, firing multiple actions. Intelligent central heating looks like it’ll work, but currently I’m guessing at it taking 10mins to heat up 0.5 degrees, probably way out, but as the house isn’t cold enough for heating, it’ll do.  Once I’ve got the rest working, I’ll make it calculate the time based on past data.

Web interface
Web view
Currently the interface is a simple view of the state of the house, along with some graphs with flot, that when selected, pops up more detailed graph of the selected time period.

Links:

  1. No comments yet.
  1. No trackbacks yet.