No! You can also benefit from cheaper electricity with a home battery even without solar panels. With a dynamic energy contract, the battery can purchase and store electricity when it's cheap and consume or sell it when prices rise.
However, with solar panels, you ensure more efficient use of the electricity you generate. The generated alternating current (AC) needs to be consumed immediately, or it will be fed into the power grid. A home battery with an inverter can convert this AC into direct current (DC) and store it for later use.