An apparatus, comprising: a power conversion system, PCS; and a power control and compensation, PCC, circuit configured to operate with the PCS, the PCS being configured to control the conversion between direct current, DC, power for a battery system and alternating current, AC, power based on power command signals from an energy management system, EMS, that controls the PCS and coordinates power flow between a power system and an electrical panel or a load connected to the electrical panel, and the PCC circuit including: an input terminal to connect with an output from the power system; an output terminal to connect with the electrical panel or the load connected to the electrical panel, wherein the output terminal of the PCC is connected to an output terminal of the PCS; a relay coupled between the input terminal and the output terminal; a current measurement device coupled between the input and output terminal of the PCC configured to measure the power level from the power system; and a processor configured to monitor a power state for the power system, monitor a power state for the battery system, and selectively activate the relay to connect the power from the power system to the electrical panel or the load connected to the electrical panel based on the power states of the power system and the battery system, wherein the PCC circuit is configured to control the output of the power system separately from the power demand signals sent by the EMS to the PCS, and characterised in that the relay is configured to remain open until PCS is connected to the battery system or a power grid connected to the electrical panel and until the PCS is ready to manage power flow, thereby disconnecting the power system from the electrical panel, and configured to close based on the measured power level from the current measurement device that ensures that power can flow to the battery system, to the load connected to the electrical panel, or to the power grid connected to the electrical panel. a power conversion system, PCS; and a power control and compensation, PCC, circuit configured to operate with the PCS, the PCS being configured to control the conversion between direct current, DC, power for a battery system and alternating current, AC, power based on power command signals from an energy management system, EMS, that controls the PCS and coordinates power flow between a power system and an electrical panel or a load connected to the electrical panel, and the PCC circuit including: an input terminal to connect with an output from the power system; an output terminal to connect with the electrical panel or the load connected to the electrical panel, wherein the output terminal of the PCC is connected to an output terminal of the PCS; a relay coupled between the input terminal and the output terminal; a current measurement device coupled between the input and output terminal of the PCC configured to measure the power level from the power system; and a processor configured to monitor a power state for the power system, monitor a power state for the battery system, and selectively activate the relay to connect the power from the power system to the electrical panel or the load connected to the electrical panel based on the power states of the power system and the battery system, wherein the PCC circuit is configured to control the output of the power system separately from the power demand signals sent by the EMS to the PCS, and characterised in that the relay is configured to remain open until PCS is connected to the battery system or a power grid connected to the electrical panel and until the PCS is ready to manage power flow, thereby disconnecting the power system from the electrical panel, and configured to close based on the measured power level from the current measurement device that ensures that power can flow to the battery system, to the load connected to the electrical panel, or to the power grid connected to the electrical panel. an input terminal to connect with an output from the power system; an output terminal to connect with the electrical panel or the load connected to the electrical panel, wherein the output terminal of the PCC is connected to an output terminal of the PCS; a relay coupled between the input terminal and the output terminal; a current measurement device coupled between the input and output terminal of the PCC configured to measure the power level from the power system; and a processor configured to monitor a power state for the power system, monitor a power state for the battery system, and selectively activate the relay to connect the power from the power system to the electrical panel or the load connected to the electrical panel based on the power states of the power system and the battery system, wherein the PCC circuit is configured to control the output of the power system separately from the power demand signals sent by the EMS to the PCS, and characterised in that the relay is configured to remain open until PCS is connected to the battery system or a power grid connected to the electrical panel and until the PCS is ready to manage power flow, thereby disconnecting the power system from the electrical panel, and configured to close based on the measured power level from the current measurement device that ensures that power can flow to the battery system, to the load connected to the electrical panel, or to the power grid connected to the electrical panel.