The following outlines how to configure Energy Manager to do exactly what you want. It is very customisable but the defaults should suit most use cases - however you should confirm the defaults do suit your situation. What is optimal for you may not be optimal for someone else due to a number of aspects, including solar array size, inverter rating, battery size, and your mindset on how aggressive you would like to trade. You should closely watch how your system behaves when you first enable the Energy Manager to make sure that it is working appropriately for you.
Read about the Basic Principles of energy management.
Details on how to enable or disable Energy Manager
Details on how to configure Spike Prepration and Buy Pricing [Premium]
Details on how to configure Normal Mode Export Pricing [Premium]
Details on how to configure High Sell Mode [Premium]
Details on how to configure Weather Dependent Discharge Settings [Premium]
Details on how to configure the Inverter tab settings
Details on how to configure the Exclusion Period
Details on various dashboards included with Energy Manager
Once everything above has been configured to your personal requirements, the following is the recommended commissioning approach