A control system is extremely flexible and modular and can be equipped or upgraded to have any number or combination of features, such as security, home theater/audio, HVAC, energy management, and lighting with each feature having a separate task unit. The task units can be added or removed from a core set of units within minimal impact on the core set of units. The core set of units includes a control database unit that stores sets of commands in a relational database according to an input/output event and a command execution unit that routes the commands to the appropriate task units for execution. The core set of units do not need to understand the input/output event or the commands but rather routes the commands to the task units addressed for execution. The system has a variable database that contains a relational database of variables shared between the various task units and stores such things as all keypad displays. The individual task units query the variable database unit for values of all shared variables and automatically receive any updates in values of the shared variables from the variable database unit. The software for the system is stored in flash ROM and can be automatically upgraded through a download task unit. The system may have an energy task unit that adjusts consumption of electricity based on any changes in rate and which provides a pathway of communication with the electrical utility company.