Ad hoc solutions using tape and foam have multiple issues. The net result is often a damaged or stuck battery.
Problems with Tape or Foam:
We make Di2 battery holders for 25.4mm seat posts with various inside diameter size options. If your measurement is close, pick the smaller size. If the measurement is more than .5 mm from the available sizes, or an odd shape, contact us for a custom version. There are also versions made for 27.2 mm seat posts.
C2 - 19 mm ID
C3 - 19.5 mm ID
SL-K - 20 mm ID
Some seat posts are tapered on the inside, so if your seat post opening is bigger than 22 mm, check that it doesn't narrow further inside. We can make customized versions if you have a tapered seat post. If you have an aero seatpost, we can make versions to accomodate them as well, if we can get proper specifications. Use the Contact Us form to send a request for a custom holder.