We make Di2 battery holders for 25.4mm seat posts with various inside diameter size options. If you are using a seatpost not listed here, please contact us for assistance.
C2 - 19 mm ID (Carbon)
C3 - 19.5 mm ID (Aluminum)
SAVE - (unmodified)
BBB Basic - 19.65 mm ID (Aluminum)
SLK Carbon - 20.5 mm ID (Carbon)
Zipp Service Course SL Carbon - 22 mm mm ID (Carbon)
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:
Removing the holder requires pliers. Never use pliers on the battery itself.