An energy managing system for a thermostat, comprising: one or more processors; and a power broker incorporated by one or more processors; and wherein: the power broker is connectable to one or more energy sources; the power broker is connectable to one or more peripherals; the power broker is operable to manages, according to a power scheme, power received from the one or more energy sources and specified power requested for use by the one or more peripherals related to the thermostat, the power scheme comprises a set of rules as to how energy usage by the one or more peripherals is to be managed and how the energy sources are to be managed; the power broker is operable to manages the power requested for use based on current power usage by the one or more peripherals relative to the power received from the one or more energy sources; the one or more energy sources are selected from a group consisting of batteries, energy harvesting modules, energy storage capacitors, and power line sources; and the power broker is operable to approve the specified power requested, based on the power scheme and the specified power prior to the specified power being used by the one or more peripherals; if the power broker disapproves approval of the specified power requested by the one or more peripherals, the power broker is operable to again receive a request from the one or more peripherals for approval for the specified power requested; and if the power broker approves the specified power requested, then the one or more peripherals can use the specified power requested. one or more processors; and a power broker incorporated by one or more processors; and wherein: the power broker is connectable to one or more energy sources; the power broker is connectable to one or more peripherals; the power broker is operable to manages, according to a power scheme, power received from the one or more energy sources and specified power requested for use by the one or more peripherals related to the thermostat, the power scheme comprises a set of rules as to how energy usage by the one or more peripherals is to be managed and how the energy sources are to be managed; the power broker is operable to manages the power requested for use based on current power usage by the one or more peripherals relative to the power received from the one or more energy sources; the one or more energy sources are selected from a group consisting of batteries, energy harvesting modules, energy storage capacitors, and power line sources; and the power broker is operable to approve the specified power requested, based on the power scheme and the specified power prior to the specified power being used by the one or more peripherals; if the power broker disapproves approval of the specified power requested by the one or more peripherals, the power broker is operable to again receive a request from the one or more peripherals for approval for the specified power requested; and if the power broker approves the specified power requested, then the one or more peripherals can use the specified power requested. the power broker is connectable to one or more energy sources; the power broker is connectable to one or more peripherals; the power broker is operable to manages, according to a power scheme, power received from the one or more energy sources and specified power requested for use by the one or more peripherals related to the thermostat, the power scheme comprises a set of rules as to how energy usage by the one or more peripherals is to be managed and how the energy sources are to be managed; the power broker is operable to manages the power requested for use based on current power usage by the one or more peripherals relative to the power received from the one or more energy sources; the one or more energy sources are selected from a group consisting of batteries, energy harvesting modules, energy storage capacitors, and power line sources; and the power broker is operable to approve the specified power requested, based on the power scheme and the specified power prior to the specified power being used by the one or more peripherals; if the power broker disapproves approval of the specified power requested by the one or more peripherals, the power broker is operable to again receive a request from the one or more peripherals for approval for the specified power requested; and if the power broker approves the specified power requested, then the one or more peripherals can use the specified power requested.