In my earlier post, Garbage Cans with Contact Sensors, I described how I used duct tape to affix the sending part of the unit under the rim of the garbage can. Eventually, the tape yielded under the influence of temperature and gravity. The sending unit gradually rotated back to an always-open state. The following pictures show a simple fix to the yielding tape.
Although the Styrofoam will relax over time, I do not think it will ever allow the tape to yield. And it will last a long time.