Introducing HouseAgent


HouseAgent is a multi platform, open source home automation application.

That was the short introduction of something I have been working on for quite some months already. HouseAgent has been running as my own home automation software for some time.
I hear you asking, why not use one of the standard software products available? There are a couple of reasons for that:

  • Most software is expensive, for a full set-up €500,- is no exception;
  • I wanted to learn from my home automation hobby, by writing my own software I got and still get a lot of insight on new frameworks/protocols/techniques etc;
  • Really, I wanted free home automation software to be available to others out there as well!
  • Most software out there is not designed to run on a low power/low profile systems. HouseAgent can be run on low power system without hassle.
  • Also most software only runs on one platform i.e. Windows or Linux. I believe in a truly open platform where all kinds of developers can contribute.

Let’s look at some core components used in HouseAgent:

AMQP/RabbitMQ
One of the core components used in HouseAgent is AMQP. The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware. The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security.
AMQP is used within HouseAgent for plugin communication. Here is a picture, which hopefully explains all the bits and pieces a bit better:

As you can see all plug-ins are separate isolated components, in fact the plug-ins don’t even know about the coordinator or each other. The coordinator is the main HouseAgent application which runs important features such as the event handler and the web-based GUI. A plug-in communicates with the broker, and the message protocol used for this is AMQP.
Certain types of messages are “published” on the broker, for example a device_value_update message might be send to the broker by a plug-in. The coordinator is “subscribed” to such messages and handles them appropriately (i.e. run a certain action based upon an event or save history to a history file)
The coordinator on it’s turn can publish messages to the broker as well, commanding the plug-ins to do certain action. One example would be the power_on message. This message commands a certain plug-in to turn on a device with a certain address.

So what’s RabbitMQ? RabbitMQ is a broker which implements AMQP, there are several other AMQP implementations which might work as well with HouseAgent (not tested!). You can read more about AMQP on it’s wikipedia page. You can read more about RabbitMQ on it’s homepage.

Twisted (Matrix)
Twisted is used for serial communication and all networking communication in HouseAgent. Twisted is a networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers, and more. The main difference between Twisted and other networking engine’s is that Twisted is asynchronous. You can read about the differences between synchronous and asynchronous communication here. Twisted certainly was an eye opener for (thanks Rene) but also required a completely different way of thinking about networking and communication in general.

Among these core components some other frameworks/packages are used:

  • Mako Template (for web page templating)
  • PyRRD (for historic graphing)
  • py-serial (serial communication)
  • pywin32 (Windows only)

Although the development of HouseAgent is just getting started, it already includes some nice features. Some core functionality HouseAgent offers right now:

  • Storing and logging of device values
  • Graphing (based upon RRDtool)
  • Event handling (triggers include: time based, device value changes)
  • Flexible plug-in development and easy extension

This concludes the short introduction of HouseAgent. In future blog posts I will dive deeper in different aspects of HouseAgent.
Right now a group of beta testers has been selected, I will send out a first beta version a.s.a.p. after that a public version will come available.
As of today the source code is available for the core of HouseAgent! You can review the source code, and watch the development progress on Github. But please don’t expect a complete system out that source code, stand-by for binary releases.

Maarten

Hi, I am Maarten and I am the owner of this weblog. I post on various IT subjects that matter in my life as an IT professional.

Recent Posts