Three-electrode battery device