Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Home monitoring and automation framework built on XBees and RabbitMQ
JavaScript Python
branch: master

Fix incorrect timestamp when serializing with BSON

Need to explicitly specify timezone
latest commit 842df900cd
@blalor authored
Failed to load latest commit information.
schema making humidity not required
support Fix incorrect timestamp when serializing with BSON
ui Quick and dirty iPhone button for sprinkler
util Work-around for pytz bug
xbee correcting zb_tx_status
.gitignore ignoring sqlite3 databases Implementing logging with log4js-node Finalize weather publisher Switch from pickle to bson
crontab fixing crontab typo Correct sys.path for message_logger Implement external config repository make scripts executable make scripts executable include all furnace info in message to sensor_data make scripts executable Prefix command to match updated RPC routing scheme adding xbee_network_monitor to startup script
system layout.graffle initial commit add config to upload furnace activity make scripts executable Fix incorrect timestamp when serializing with BSON Add support for requests with multiple replies Adding support for "volt-o-meter" Fix incorrect timestamp when serializing with BSON make scripts executable Improved event publishing
xbee_notes.txt Adding overview documentation Use serializer_utils instead of pickle directly

Home Automator

Home monitoring and (fledgling) automation framework built on the RabbitMQ message broker.


I'm slowly making my house "smart". Currently active are:

  • temperature and humidity sensors throughout the house
  • a power monitor attached to the electric meter • an antique voltmeter reflecting real-time power consumption
  • a remotely-operated sprinkler controller for my lawn
  • an occasionally-working device in my fuel oil tank to measure volume
  • a furnace activity monitor and timer-based override

All of this data needs to go somewhere, and often several somewheres. Long-term data collection, event response, real-time analysis and graphing, and behavior modification (both for me and the house) are some of the goals I have for this system. It's been a work in progress over several years, frequently interrupted as I context-switch between this and other electronics, car, home, work and personal projects.

A few months ago I heard about RabbitMQ, started learning a bit more about message brokers, and realized that pub/sub was the ideal model for this system: multiple sources of information being presented to multiple consumers at once. I'd known for a while that I was reinventing the wheel by implementing my own — not terribly efficient — hub-and-spoke system for getting information from a sensor to a consumer, but it finally dawned on me that if I wanted to grow the system I needed a better backbone.

Currently, most of the devices have Arduino-based microcontrollers that communicate wirelessly with a central gateway using XBee modules.

system layout


Receives XBee frames and publishes them to the raw_xbee_frames exchange. Also consumes messages from the xbee_tx queue to be transmitted as frames to remote XBee devices.

Sensor data handlers

The following scripts consume device-specific frames from the raw_xbee_frames exchange and publish usable to the sensor_data exchange. They are essentially device drivers.


The script also exposes some methods via RPC to control an override timer so that we can get enough hot water for a shower. It's a long story…

Consumes power monitor data published by on the sensor_data exchange and transmits frames (via the xbee_tx queue) to an XBee/microcontroller device housed in an antique voltmeter (aka the "volt-o-meter") in the living room that reflects real-time power consumption.

Invoked hourly to retrieve weather forecasts and current conditions, published to the weather exchange. Not really used at this time, but I'm hoping to be able stay ahead of the heating and cooling needs of the house by reacting to the weather.

Sensor data logger

  • stores data published on the sensor_data exhange to an sqlite3 database
  • periodically uploads the data to a more powerful server for graphing and longer-term trend analysis

XML-RPC bridge to the messaging-based RPC mechanism used by and Python's XML-RPC library is so very handy, but I didn't like keeping track of multiple XML-RPC servers (one for each endpoint).

Sprinkler controller

Interfaces with the remotely-operated sprinkler controller I built. Sprinkler is (de-)activated via cron.



This is an AMQP-to-WebSocket gateway written in Node.js. The WebSocket part is actually an implementation detail under the covers of the very cool (and poorly documented) Socket.IO. There's some boilerplate code at the top of the file that shows how to hook the browser up so that you can subscribe to topics on an exchange and invoke RPC methods.

Several libraries are required:

Just install these in the current directory with npm

$ npm install
$ npm install amqp@0.1.1
$ npm install node-uuid@1.2.0
$ npm install node-static@0.5.9
$ npm install log4js@0.4.0


$ node amqp_socketio_bridge.js

Furnace Timer UI

Simple HTML and jQuery iPhone web app. Start the amqp_socketio_bridge.js and point your browser to http://localhost:8000/furnace_timer/.

Something went wrong with that request. Please try again.