What battery you have in mind? Can you share name/model?
In my case, it's configured to track the readings of my digital electricity meter. The battery charges itself when my solar panels produce excess power and discharges when it detects grid consumption. Throughout the day, it buffers the intermittent solar power, and during the evening, night, and early morning hours, it keeps my grid power consumption close to zero.