An appliance includes an electrical connection to receive power from a mains line through an electrical grid to operate the appliance, at least one battery to supply power to operate the appliance, a battery charging circuit for charging the at least one battery and a controller. The controller is programmed to determine when to use power from the mains line to operate the appliance and/or to charge the at least one battery and determine when to use power from the at least one battery and/or to supply power back to the electrical grid.