I had that on my cube up in the head area.
I pulled the battery holder out and inserted a bit of foam pipe insulation up there around the cables. Actually it was the packaging material they used when the bike was delivered, so a bit thinner than the normal Pipe insulation. Made a HUGE difference.
I managed to get them out.. but it was a fiddleeeck washers in the frame ....more rattles
The World's largest electric mountain bike community.