The thermoelectric effect is the direct conversion of temperature differences to electric voltage. This voltage can be used to measure temperature (it’s how a thermocouple works), or to generate electricity, which I’ll be using: specifically, the thermodynamically-reversible Peltier–Seebeck effect.
The heat/energy source of my battery is still tbd, but ideally would be solar thermal (using heat from the sun to heat the sand) and/or potentially solar photoelectric (using electricity from the sun through a photovoltaic panel to heat the sand).
The battery will be a thermal flywheel, where the heat stored provides inertia against outside temperature fluctuations.