Structuring a home automation appplication


I’m about to start a home automation application and need to get some idea on how to structure the main loop. These are the primary components that I’ll need right away.

  1. Zigbee sensors. At least 3. How do you set up the FEZ Zigbee component to talk to many individual Zigbee transceivers?

  2. TCP on multiple ports. Maybe a separate port for component. I’ll be using the Sparkfun Wiznet board to convert hardware with serial ports to work on the home internal network. Here’s the link the Sparkfun product.

  3. Some serial devices will be directly connected to the FEZ Domino.

  4. I will use a FEZ Bluetooth component to talk to some home health monitoring equipment such as weigh scales and blood pressure monitors.

All these components need to have ample time to complete there operations and respond to events. I’m assuming each item will need its own thread.

How would you guys structure a main loop to accomodate all these components. Think of this as a robotics project but the house is the actual robot.



First of all I would create classes. In those classes I would create several methods.


Class Zigbee holds the zigbee sensors. You can divide this into separate metods for controlling lights, sound, whatever.

Class TCP holds the data send and recieve methods


When you got this basic structure, I would then focus onto the main loop.
If you already did this, please ignore my post.

Keep us posted, love these projects :wink: