There are many people with interest (and time on their hands) that have used 'second hand cells' to build batteries and powerwalls. The basic idea is that many or even most of the cells in an e-bike battery (or medical battery or modem battery or laptop battery or RING pack or xxx) will still be useful even though the BMS has gone bad or a few cells have gone bad triggering BMS shut-off. I'm assuming these ebike batteries are 18650 NMC chemistry in general the process outline below. However, the concepts apply to any lithium-ion battery - e.g. test and assemble.
The basic process is....
1) Break the ebike battery apart into it's individual cells
2) Do a charge/discharge/charge test to see the capacity of each cell. There are testers such as an OPUS -
https://www.amazon.com/BT-C2000-cha...y-Analyzer-Portable/dp/B00JL3XL2G/ref=sr_1_1- but it's just a process of doing full-charge and full-discharge to measure capacity however you do it.
3) If the cells have 90% or better their original capacity - then keep/sort them into 100mah capacity groups at full charge and let them sit for a few weeks. I use 95% of original capacity for my personal criteria but cells with 85% or even 80% original capacity are quite useful.
4) Let the fully charged cells sit a few weeks. If the voltage is steady (>4.10 for NMC) after 3 weeks then keep. If the voltage drops below 4.10v after 3 weeks then discard as they're self-dischargers.
5) Measure IR to make sure they're in normal range.
6) Then...... assemble the individual cells into battery(s) - solder or spot-weld into packs, hook the packs in series, and add a BMS.
Search youtube "Build 18650 battery" for an idea. For 18650 cells, it takes ~700 cells (e.g. 14s50p @ avg 2600mah/cell @ 48v) to get a 6.25kwh battery. It's labor intensive to get 700 good cells but it can be cost effective if you get a source of mostly good cells and have spare time for this kind of hobby/work.